Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Booting behaviour of AT91SAM9XE512
PostPosted: Tue Nov 29, 2011 7:46 pm 
Offline

Joined: Tue Nov 29, 2011 7:05 pm
Posts: 5
Hi,
This is my first project on a AT91SAM9XE512 microcontroller, I just need to run a simple program on my board, that is AT91SAM9XE-EK. I complied basic adc example (basic-adc-project-at91sam9xe-ek-keil.zip) for the keil compiler for both sdram and internal flash configurations.

I programmed this using SAM-BA (v2.11) to the flash area using serial port (which can be only getting connected if move J7 to 1, 2), and runs the script "boot from flash (GPNVM3)" and place jumper to 2,3, and the program executed and displays messages in terminal. Later I changed jumper back to 1, 2 then terminal shows a romboot promt and struck there. Now placing jumper back to the 2,3 then also goes to romboot not to my program. Is this behavior is normal? Or can you tell me how to program and boot from flash memory using SAM-BA?

According to user guide of AT91SA9XE-EK/AT91SAM9260-EK schematics, J7 is a two pin jumper, but my board has 3 pin jumper!!

Thanking You,
Ras
P.S This is my first experience with a uC with a MMU, so please let me how to program and boot from different memories available in the board.


Top
 Profile  
 
 Post subject: Re: Booting behaviour of AT91SAM9XE512
PostPosted: Tue Nov 29, 2011 9:54 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
You're clearly looking at the wrong documentation for your board
http://www.atmel.com/dyn/resources/prod ... oc6311.pdf
http://www.atmel.com/dyn/products/tools ... ol_id=4281

On the AT91SAM9XE-EK board J7 is the TST/ERASE jumper. Putting it on 1-2 erases the internal FLASH. So unsurprisingly your code disappears.

On the AT91SAM9260-EK board J7 is the BMS jumper, and picks whether the 9260 boots from the internal ROM, or external NOR

If you want to run code from SDRAM, you can do so with SAM-BA, but the much simpler way to run/debug code is to use the Keil ATMEL projects with the "SAM9xxx Ext SDRAM - SAM-ICE" target and use the SAM-ICE/J-LINK JTAG pod. I'm pretty sure these download/initialization scripts could also be used with the Keil U-LINK.


Top
 Profile  
 
 Post subject: Re: Booting behaviour of AT91SAM9XE512
PostPosted: Wed Nov 30, 2011 10:18 am 
Offline

Joined: Tue Nov 29, 2011 7:05 pm
Posts: 5
Hi,
Thanks, now I load and run program from flash, but I couldn't understand the details. After flashing, do I need to run "Boot from Flash (GPNVM3)" script in SAM-BA?

And what to do run from NAND flash? Only need to adjust the linker script (scatter file for keil)?


Top
 Profile  
 
 Post subject: Re: Booting behaviour of AT91SAM9XE512
PostPosted: Wed Nov 30, 2011 5:58 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
I haven't read the documentation for SAM-BA on an AT91SAM9XE-EK, it's not a part I'm using. Yes, I suspect you'll need to run the "Boot from Flash", to configure the processor to do that.

To boot from NAND, you'll need to look at the AT91BootStrap code, but you're typically limited to about 16 or 32KB of code that can be copied into SRAM by RomBoot.

Therefore the base address you compile code for should match the SRAM address for your part. So 0x300000 ?

When SAM-BA writes the code into NAND it tags it with a length, so you must use the NAND "Send Boot File" to upload it. The lack of this option for the 9XE suggests it's not available.

My educated guess however is that the 9XE does not permit booting from NAND, because you have a FLASH memory to put the boot strapping code into. Again the AT91BootStrap package contains NAND/DataFlash code to pull things like uBoot or the Kernel out of NAND and copy it to the SDRAM it has initialized. Then again the size of the FLASH should permit uBoot to be implemented directly.

The summary and datasheets should provide details of your booting options.


Top
 Profile  
 
 Post subject: Re: Booting behaviour of AT91SAM9XE512
PostPosted: Thu Dec 01, 2011 7:58 pm 
Offline

Joined: Tue Nov 29, 2011 7:05 pm
Posts: 5
Hi,
I will get the JTAG from soon, so I need to use SAM-BA for few more days. Since my primary experience is with uC which have only flash memory area, so booting of at91sam9xe is somewhat complex to me.
How the processor knows, the flash area (or any other) doesn't have a program to boot? Do I need to copy NAND/DATA flash to SDRAM to execute the program in NAND/DATA? and so a Uboot is required?

I have no plan to use kernels like linux/android, but only RTOS is required, and which must be reside in the permanent memory.

Thanking You,
Ras


Top
 Profile  
 
 Post subject: Re: Booting behaviour of AT91SAM9XE512
PostPosted: Fri Dec 02, 2011 4:13 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Well you have a number of options.

Yes, you could put your entire application in on-board flash and run it in place, flash is relatively slow (figure it is probably 24-35ns without reading the manual), this can be masked by the cache when enabled.

It is relatively small, will your application fit?

It can be expensive, in some cases it might be more cost effective to compress the application and decompress it into SDRAM to run. If it is really big, pull it from NAND, and pick the smallest on-board flash that can accommodate a loader, 128KB should be plenty.

The SRAM is the fastest, tightly coupled, single cycle, 32-bit, use it for stacks, fast code, and fast data.

The SDRAM space is large, as is the NAND.

SD/MMC cards can be used in place of rapidly obsoleting NAND devices.

uBoot is used for Linux loading, on the AT91SAM9xxx series, it will fit in 256KB. If you don't need it then don't worry about it. You probably don't need the MMU either.

Your boot code needs to initialize the SDRAM and cache.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: