AT91SAM7S256

nobody wrote on Tuesday, February 21, 2006:

Does anyone have a full port for the AT91SAM7S256?

Thanks.

nobody wrote on Tuesday, February 21, 2006:

The existing SAM7S port should work straight off I think.  The 256 just has more RAM doesn’t it?  Maybe you need to change the build/link options from 64 to 256?

nobody wrote on Tuesday, February 21, 2006:

The IAR one should just by changing the target,

If you’re using Gcc, u just change the linker script atmel-rom.ld with the RAM and FLASH segment sizes, and check SFR addresses are the same… i think there are some differences in the memory map for SFR’s between 64 & 256.

henkvisser wrote on Tuesday, February 21, 2006:

All I need to do is change the target in the project settings?  There are also cstartup and other type files that I will probably have to drop in.

jra01 wrote on Wednesday, February 22, 2006:

The only setting that needs to be changed (to just run) from S64 to S256 is for the flash programmer. Therefore you need to change the target in your IDE. Then to make use of the extra ram and flash you need of course to change your link command files.
All the start-up code is identical, since all the periferals are (almost) identical. (I think there are some extra features in e g the USARTs for the bigger chips in the series.)

Jokke

henkvisser wrote on Wednesday, February 22, 2006:

Jokke,

Thanks for the post.  The only thing I see regarding the linker options is a file called:

$PROJ_DIR$\resource\at91SAM7S256_NoRemap.xcl

Here the ROM and RAM addresses ranges are defined. What is really scaring me are the definitions for the CSTACK size, IRQ stack size and the heap size.  Do you think that the default setting from the IAR sample projects are correct?

What is the difference between this file and changing the target?  I was expecting that just changing the target would handle everything for me. :slight_smile:

Thanks!

rtel wrote on Wednesday, February 22, 2006:

From my very quick look I would say (as partly said already):

+ In the project settings->General options->Settings set the target to the SAM7S256.

+ In the project settings->Linker set the linker command line.

+ In board.h, change the include file from including AT91SAM7S64.h and lib_AT91SAM7S64.h to the 256 equivalents.

The Supervisor stack size has to be large enough to get to the where the scheduler starts, and hold the stack used by your ISR’s.

The IRQ stack has to be large enough for your IRQ’s (stating the obvious there!).

User/System mode stacks do not need to be setup up as these are allocated to each task by the scheduler.

Other stacks are only required if your application uses the mode.

Regards.

jra01 wrote on Thursday, February 23, 2006:

When I did this migration I had an older version of IAR, without “at91SAM7S256_NoRemap.xcl”, so I don’t know if they made anything special there. I just made a copy of the 64-file and changed the sizes for RAM and ROM.
I still use AT91SAM7S64.h and lib_AT91SAM7S64.h for both targets, and saw no problems so far.
I guess they cannot change the linker command file just like that, since it is likely that the user may have changed it.

nobody wrote on Friday, March 10, 2006:

Hi…
I tried to use AT91SAM7S64 IAR port on my s256 chip.
I followed Richard instruction, but i got the following errors:

+ Error[Pe020]: identifier "AT91C_SYSC_WDDIS" is undefined C:\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\SrcIAR\Cstartup_SAM7.c 44

+ Error[Pe020]: identifier "AT91C_SYSC_URSTEN" is undefined C:\FreeRTOS\Demo\ARM7_AT91SAM7S64_IAR\SrcIAR\Cstartup_SAM7.c 72

any suggestions?
thanks a lot

mirza
note: i use IAR EWARM Kickstart V4.30A

nobody wrote on Friday, March 10, 2006:

AT91C_SYSC_WDDIS is defined within the header files included in the download (FreeRTOS/Source/Portable/IAR/AT91SAM7S64 directory).

The project file includes this directory in its include path so they should get picked up.

Have you:

i/ Modified the project at all?
ii/ Got some other header files that are being picked up first?
iii/ Changed the directory structure?
iv/ Created your own project?

Does the demo exactly as downloaded build correctly.

This just seems to be an include or path problem with your particular project or installation.

mirza_4 wrote on Friday, March 10, 2006:

Hi again…
I changed line 44 of Cstartup_SAM7.c to:
AT91C_BASE_WDTC->WDTC_WDMR= AT91C_WDTC_WDDIS;

and line 72 to:
AT91C_BASE_RSTC->RSTC_RMR = AT91C_RSTC_URSTEN | (0x4<<8) | (unsigned int) (0xA5<<24);

Everythings went fine…

In S64 include file, URSTEN (User Reset Enable) defined as AT91C_SYSC_URSTEN. And WDDIS (Watchdog Disable) defined as AT91C_SYSC_WDDIS.
In S256 include file: AT91C_WDTC_WDDIS and AT91C_RSTC_URSTEN respectively.

Thank you
mirza