|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
RAM Images on AT91SAM7s256Hi,
I currently working with a AT91SAM7s256 based board. For debugging and testing I like to devlop RAM only images. As the existing eCos support for this platform has only definitions for rom images I tried to use the existing files for ram linker file definitions. After looking through several ldi files and googling around I'm not quite shure if made the right placement for the 'SECTION_rom_vectors' and the 'SECTION_fixed_vectors' sections. Currently my ram.ldi looks like: MEMORY { ram : ORIGIN = 0x00200000, LENGTH = 0x10000 } SECTIONS { SECTIONS_BEGIN SECTION_rom_vectors (ram, 0x00200000, LMA_EQ_VMA) SECTION_fixed_vectors (ram, ALIGN (0x1), LMA_EQ_VMA) SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA) SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_data (ram, ALIGN (0x4), FOLLOWING (.gcc_except_table)) SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); SECTIONS_END } the original rom.ldi has been: MEMORY { ram : ORIGIN = 0x00200000, LENGTH = 0x10000 rom : ORIGIN = 0x00100000, LENGTH = 0x40000 } SECTIONS { SECTIONS_BEGIN CYG_LABEL_DEFN(__reserved_bootmon) = 0x00000000; . = CYG_LABEL_DEFN(__reserved_bootmon) + 0x01000; SECTION_rom_vectors (rom, CYGNUM_HAL_ARM_AT91_IMAGE_ADDRESS, LMA_EQ_VMA) SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA) SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA) SECTION_fixed_vectors (ram, 0x00200040, LMA_EQ_VMA) SECTION_data (ram, ALIGN (0x4), FOLLOWING (.gcc_except_table)) SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); SECTIONS_END } Did I made a correct placement or not? Thanks in advance, Alois -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss |
|
|
Re: RAM Images on AT91SAM7s256On Mon, Jan 28, 2008 at 05:07:38PM +0100, Alois Z. wrote:
> Hi, > > I currently working with a AT91SAM7s256 based board. For debugging > and testing I like to devlop RAM only images. With only 64Kbytes of RAM, you will be very limited to what you can do. I strongly suggest you get a JTAG debugger which can set hardware breakpoints. You can then run your application from ROM and single step, set a couple of breakpoints etc. > As the existing eCos > support for this platform has only definitions for rom images I > tried to use the existing files for ram linker file > definitions. After looking through several ldi files and googling > around I'm not quite shure if made the right placement for the > 'SECTION_rom_vectors' and the 'SECTION_fixed_vectors' sections. > > Currently my ram.ldi looks like: > > MEMORY > { > ram : ORIGIN = 0x00200000, LENGTH = 0x10000 > } > > SECTIONS > { > SECTIONS_BEGIN > SECTION_rom_vectors (ram, 0x00200000, LMA_EQ_VMA) > SECTION_fixed_vectors (ram, ALIGN (0x1), LMA_EQ_VMA) > SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA) > SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_data (ram, ALIGN (0x4), FOLLOWING (.gcc_except_table)) > SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) > CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); > SECTIONS_END > } This looks reasonable. How are you going to get this image into RAM? You also need to make sure that RAM is mapped to address 0x0 as well as 0x00200000. I know ROM startup does this, but i think RAM startup probably does not. -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss |
|
|
Re: RAM Images on AT91SAM7s256>
> With only 64Kbytes of RAM, you will be very limited to what you can > do. I strongly suggest you get a JTAG debugger which can set hardware > breakpoints. You can then run your application from ROM and single > step, set a couple of breakpoints etc. > I know, but for first test 64k are quite fine. And for my first tests I like to be as none invasive as possible. The board is the mindstorms NXT board and to have JTAG debugging I would need to disassamble the brick and solder a connector in. However I can image that I will not come far without debugging support. > > How are you going to get this image into RAM? I thought of useing sam-ba for loading and starting images. > > You also need to make sure that RAM is mapped to address 0x0 as well > as 0x00200000. I know ROM startup does this, but i think RAM startup > probably does not. Is this necessary for the vectors to be at the right place? -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss |
|
|
Re: RAM Images on AT91SAM7s256> > How are you going to get this image into RAM?
> > I thought of useing sam-ba for loading and starting images. O.K. But you need to find out what RAM sam-ba uses so you can avoid it. > > You also need to make sure that RAM is mapped to address 0x0 as well > > as 0x00200000. I know ROM startup does this, but i think RAM startup > > probably does not. > Is this necessary for the vectors to be at the right place? Yes. Without this, all your interrupts are not going to work etc. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss |
|
|
Re: RAM Images on AT91SAM7s256- > > > How are you going to get this image into RAM? > > > > I thought of useing sam-ba for loading and starting images. > > O.K. But you need to find out what RAM sam-ba uses so you can avoid > it. > > > > You also need to make sure that RAM is mapped to address 0x0 as well > > > as 0x00200000. I know ROM startup does this, but i think RAM startup > > > probably does not. > > Is this necessary for the vectors to be at the right place? > > Yes. Without this, all your interrupts are not going to work etc. > > Andrew Thanks that realy helped. So much to learn;-) Alois -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss |
|
|
Re: RAM Images on AT91SAM7s256Hi,
As Andrew stated, you will have to alter the startup code for the RAM image to do the memory remapping so the vectors are located at 0x0. Look at the ROM startup for reference. I've done something similar on a AT91SAM7SE512, I used a BDI2000 JTAG probe to load in my image though. Regards, Tom On Jan 28, 2008 6:19 PM, Alois Z. <alois@...> wrote: > > - > > > > How are you going to get this image into RAM? > > > > > > I thought of useing sam-ba for loading and starting images. > > > > O.K. But you need to find out what RAM sam-ba uses so you can avoid > > it. > > > > > > You also need to make sure that RAM is mapped to address 0x0 as well > > > > as 0x00200000. I know ROM startup does this, but i think RAM startup > > > > probably does not. > > > Is this necessary for the vectors to be at the right place? > > > > Yes. Without this, all your interrupts are not going to work etc. > > > > Andrew > > Thanks that realy helped. So much to learn;-) > Alois > > -- > Psssst! Schon vom neuen GMX MultiMessenger gehört? > Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger > > -- > > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss |
|
|
Re: RAM Images on AT91SAM7s256I am also trying to get a RAM image running on an AT91SAM7s256. I ultimately will run my applications from the flash, would like to debug in RAM. Currently I can load via sam-ba a rom image that will communicate over the serial port, so I have this to start from.
Sam-ba I believe uses the first 8k of RAM. So I think that the ldi file should look like this: MEMORY { ram : ORIGIN = 0x00202000, LENGTH = 0xE000 } SECTIONS { SECTIONS_BEGIN SECTION_rom_vectors (ram, 0x00202000, LMA_EQ_VMA) SECTION_fixed_vectors (ram, 0x00200040, LMA_EQ_VMA) SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); SECTIONS_END } Is the SECTION_fixed_vectors section correct? Or should it be: SECTION_fixed_vectors (ram, ALIGN (0x1), LMA_EQ_VMA) I think I found my version in some other arm variant... Also should I modify these? #define CYGMEM_REGION_ram (0x00200000) #define CYGMEM_REGION_ram_SIZE (0x10000) Now I need to modify startup code for vector memory remapping. Where do I find the RAM code that needs to be modified? thanks, Aaron |
|
|
Re: RAM Images on AT91SAM7s256On Wed, Apr 2, 2008 at 3:48 AM, airdelroy
<aaron-nabble@...> wrote: > > I am also trying to get a RAM image running on an AT91SAM7s256. I ultimately > will run my applications from the flash, would like to debug in RAM. > Currently I can load via sam-ba a rom image that will communicate over the > serial port, so I have this to start from. > > Sam-ba I believe uses the first 8k of RAM. So I think that the ldi file > should look like this: > > > MEMORY > { > ram : ORIGIN = 0x00202000, LENGTH = 0xE000 > } > > SECTIONS > { > SECTIONS_BEGIN > SECTION_rom_vectors (ram, 0x00202000, LMA_EQ_VMA) > SECTION_fixed_vectors (ram, 0x00200040, LMA_EQ_VMA) > SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA) > > SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA) > SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA) > > SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA) > CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); > SECTIONS_END > } > > Is the SECTION_fixed_vectors section correct? Or should it be: > > SECTION_fixed_vectors (ram, ALIGN (0x1), LMA_EQ_VMA) > > I think I found my version in some other arm variant... > > Also should I modify these? > #define CYGMEM_REGION_ram (0x00200000) > #define CYGMEM_REGION_ram_SIZE (0x10000) > > Now I need to modify startup code for vector memory remapping. Where do I > find the RAM code that needs to be modified? > > thanks, > Aaron > -- > View this message in context: http://www.nabble.com/RAM-Images-on-AT91SAM7s256-tp15138638p16435229.html > Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com. > > According to me, your fixed_vectors section is correct, if you use SECTION_fixed_vectors (ram, ALIGN (0x1), LMA_EQ_VMA), the linker will place the vectors just after the rom section. However since you talk about the SAM-BA boot, this setting will probably overwrite a part of that bootloader and cause havoc. If you would use a JTAG probe to load in your RAM image, that setting is correct, in your case you probably need to place them after the SAM-BA boot thing. Note that the exception and interrupt vectors have to be at address 0x0. Startup assembly code can be found in hal\arm\at91\at91sam7s\current\include\hal_platform_setup.h specific for AT91 and alikes And the code that relocates vectors and such: hal\arm\arch\current\src\vectors.S Tom -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss |
|
|
Re: RAM Images on AT91SAM7s256Should I also modify the values in the mlt_arm_at91sam7s256_ram.h file?
#define CYGMEM_REGION_ram (0x00200000) #define CYGMEM_REGION_ram_SIZE (0x10000) thanks, Aaron |
| Free embeddable forum powered by Nabble | Forum Help |