This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

What I did for the eb40a


Ok, I've been promising this for a while, so here goes a hopefully accurate
description of what I did to get my eb40a up and running.

Some background: Firstly, all of this is really based on Christophe Part's
post to this list - he and the others who did the actual patches get the
credit, I just copied what they did - thank you!

Secondly, my eb40a does not have the external RAM. I plan to add it as it
will make many things much much easier (if nothing else put redboot
somewhere else so that my app can have all of the internal sram as it would
expect to).

Christophe's post is at:

http://www.spinics.net/lists/ecos/msg12692.html

Since I don't have the external ram, I made some additional changes to get
everything working with just the internal sram. My first attempt was to make
a redboot_SRAM.ecm setup. This actually worked for redboot, but failed when
I went to build an application. The problems was all the checks against a
ROM or RAM (I can't remember the actual name, it was something
CYG_HAL_STARTUP_SRAM) boot didn't know about my SRAM creation. So I went
back and modified the RAM config to be just internal sram. After that I was
able to get both redboot and my application working.

To make things easier, I've put my at91 tree and ecos.db at:

http://www.loser.net/at91.tar.gz
http://www.loser.net/ecos-db.tar.gz

I had lots of trouble getting redboot to work when downloading it through
the built in angel debugger. Since I had a Wiggler JTAG programmer I ended
up using that.

I first built a RAM version of redboot:

mkdir rb-ram-eb40a
cd rb-ram-eb40a
ecosconfig new eb40a redboot
ecosconfig import
../ecos/packages/hal/arm/at91/eb40a/current/misc/redboot_RAM.ecm
ecosconfig tree
make

If I then booted the eb40a board (taking advantage of angel to setup all the
memory mapping) but then stopped it using wiggler and downloaded my code, I
was able to get it to work. You should be able to do something similar using
one of the atmel provided ram/flash downloaders. I had the wiggler so it
just seemed to be easier!

This would get me to the point where I had redboot running. I next built a
ROM version of redboot:
mkdir rb-rom-eb40a
cd rb-rom-eb40a
ecosconfig new eb40a redboot
ecosconfig import
../ecos/packages/hal/arm/at91/eb40a/current/misc/redboot_ROM.ecm
ecosconfig tree
make

I may get this next part wrong as it's been a while:

When redboot boots, it will tell you what it's doing as far as RAM. I get
something like:

RAM: 0x00000000-0x00040000, 0x00007568-0x0003f000 available

So I picked an address in the middle of this to download the new redboot:

load -v -m ymodem -b 0x10000

then use the ymodem transfer from your terminal program to download the
redboot.bin from rb-rom-eb40a/install/bin

Then you need to write this image to flash. When the flash jumper is set to
the std position, angel is loaded. I didn't want to kill angel just yet (no
idea why - angel hates me and I learned to hate it back) so I saved the new
redboot image to the second flash chip (0x01010000) and then put the jumper
in the user position (which causes the cpu to jump to the second (redboot)
image on reset).

I think I used a flash command like:

fis write -f 0x01010000 -l 0x10000 -b 0x10000

the param to -b is the sram address you downloaded the redboot.bin image to.
The length of 0x10000 was longer than my redboot, but I'd rather longer than
shorter and nice round numbers always make me happy (in that head in the
sand kind of way).

So, I hope this helps! Please pester me if it doesn't work or make sense!

Shannon



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]