Custom board based on AT91SAM9260 PQFP Processor

I have recently designed and built a custom board using the AT91SAM9260 (Rev A) processor. The design consists of one MT48LC16M16A2 memory chip (instead of using two chips in similar fashion to the evaluation kit); the CS of the boot code memory (AT45DB642D) is on CS1 of SPI0; and a number of peripherals have been interfaced (image sensor, I2C, SPI). I intend to boot with BMS = 1 (Boot on embedded ROM).

My goal is to use the AT91 bootloader (available from the Atmel website), and to load this bootloader into the first 4k of flash memory using the SAM-ICE version 6.0 and the SAM-BA software over JTAG. I have modified the SDRAM configuration in the bootloader and in the SAM-BA TCL scripts to ensure 16-bit instead of 32-bit (because I am only using one SDRAM memory chip).

I have been successful in loading the AT91bootloader using SAM-BA. I have also modified the bootloader to turn on two LEDs that have been interfaced with GPIOs. So far, so good.

My next step is to write an application that is placed at some other address in flash, and to have the bootloader download the application into SDRAM.

As part of my first try, I once again used the bootloader code as a "skeleton app" that is placed at some other location in flash memory. However, I cannot get the bootloader to load the "skeleton app" that I have prepared.

Has anyone done something similar? How do I select the:

IMG_ADDRESS

JUMP_ADDR

(as defined in "at91sam9260ek.h").

In addition, the Makefile for the bootloader lists

LINK_ADDR=0x200000 TOP_OF_MEMORY=0x301000

Do I need to change the link address and top of memory variables to be able to load this "skeleton app"? Where do I load my application using SAM-BA?

Since the AT91 bootloader has configured the processor, do I need to configure it once again in my application? If I do not have to configure it once again (i.e. the assembler startup crt0_gnu.s is not required), then how do I write a program that will be loaded by the bootloader? Do I still need an assembler routine?

Can anyone point me to an example? I think that most of the code posted on the Atmel website relies on startup routines. These routines go through and start up the processor, etc. For my application, the startup routine is probably not necessary (since the bootloader has done the startup). I don't intend to run Linux on the AT91SAM9260, and the code loaded by the bootloader would be my own code.

Thank you so much for your time and assistance.

Nicholas

Reply to
Nicholas Kinar
Loading thread data ...

"Nicholas Kinar" skrev i meddelandet news: snipped-for-privacy@usask.ca...

This is where the application is stored in dataflash. Typically this is 0x8400. Older Atmel S/W will use 0x8000.

This is the start address of the application and should be located somehwere in SDRAM.

AT91bootstrap will copy from IMG_ADDRESS to JUMP_ADDRESS.

This is the top of memory of the internal SRAM.

No

0x8400

You need to ensure that the variable areas are cleared. If your application uses interrupts, the exception table needs to be initialized, so yes, yoiu need some assembler for more complex applications.

Why not load U-Boot? That will make things a lot easier.

--
Best Regards,
Ulf Samuelsson
This is intended to be my personal opinion which may,
or may not be shared by my employer Atmel Nordic AB
Reply to
Ulf Samuelsson

Ulf,

Thank you so much for your reply; it is greatly appreciated. This certainly helped to shed lots of light on the matter.

Once again, thank you!

Nicholas

Reply to
n.kinar

skrev i meddelandet news: snipped-for-privacy@d4g2000prg.googlegroups.com...

Zü Befehl!

--
Best Regards,
Ulf Samuelsson
This is intended to be my personal opinion which may,
or may not be shared by my employer Atmel Nordic AB
Reply to
Ulf Samuelsson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.