How to Execute HelloWorld.bin from DDRAM?

Moderator: nferre

Ishmeet
Posts: 8
Joined: Mon Jan 05, 2015 2:22 pm

How to Execute HelloWorld.bin from DDRAM?

Mon Jan 05, 2015 2:32 pm

I am able to execute OS less applications from SRAM.
For executing from SRAM, I only flashed the helloworld.bin in NANDFLASH as "boot file". However, this does not work for binaries compiled for DDRAM.

As SRAM only contains 128KB memory. I need around 300-400 KB for my application, thus I was hoping to boot from DDRAM as it has more than 1 GB of memory (I think!!).

I have read on linux4SAM, it says ROMboot downloads executable code from NANDFLASH to SRAM. Is there a feature to do this to DDRAM instead?

Also, I tried with AT91BootStrap firmware, but it is only booting u-boot not my application. 

Any Ideas??
blue_z
Location: USA
Posts: 1736
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to Execute HelloWorld.bin from DDRAM?

Tue Jan 06, 2015 1:38 am

Ishmeet wrote:I have read on linux4SAM, it says ROMboot downloads executable code from NANDFLASH to SRAM. Is there a feature to do this to DDRAM instead?
No. You should read the SoC datasheet for the full explanation (in the Boot Strategies chapter).
Ishmeet wrote:Also, I tried with AT91BootStrap firmware, but it is only booting u-boot not my application. 
You could install your app in place of U-Boot (assuming that it is linked for the same load address).

There are several schemes for loading a standalone program into an AT91SAM's main memory.

A. SAM-BA
Probably the simplest and the recommended method for Softpac example code. But I've not used this nor know of a tutorial doc.

B. AT91Bootstrap
The default load target of U-Boot can be replaced with the binary image of another program, as long as this other program is linked to execute at the same load address.
You could also modify the AT91Bootstrap source code to use a different load address, and if using SDcard look for a filename other than "u-boot.bin"
Recent versions have a menuconfig that simplify this customization.


C. U-Boot
U-Boot can load (assuming it's configured with the capability) standalone programs from Ethernet (using TFTP), SDcard, USB flash drive (with FAT or ext filesystems) and flash chips, and execute them using its go command.
If the "standalone" program is built within U-Boot's framework, then that program can invoke U-Boot functions (e.g. printf()) and upon termination, you're back to the U-Boot command prompt.

Regards
Last edited by blue_z on Tue Jan 27, 2015 11:09 pm, edited 1 time in total.
Ishmeet
Posts: 8
Joined: Mon Jan 05, 2015 2:22 pm

Re: How to Execute HelloWorld.bin from DDRAM?

Tue Jan 06, 2015 12:51 pm

Thanks for the reply, I tried step B with the following steps.

1. Connect SAMBA tool to ATSAMA5D3 Xplained
2. NANDFLASH Section --> Address (0x0) --> Enable NANDFLASH --> Execute
3. Erase NANDFLASH --> Execute
4. Enable OS PMEC parameters --> Execute
5. Send Boot file --> Execute --> Give AT91BootStrap binary file.
6. Reset
7. Again Connect SAMBA tool to ATSAMA5D3 Xplained.
8. NANDFLASH Section --> Address (0x40000) --> Enable NANDFLASH --> Execute
9. Enable OS PMEC parameters --> Execute.
10. Send File name (DDRAM.bin) --> Send file
11. Reset

The DDRAM.bin binary file does not seems to be executed by AT91BootStrap firmware, see the image attached.

I also tried the same with SRAM.bin, however, that didn't work either.

Am I sure that the binary address is 0x40000? it is the u-boot address thats for sure, u-boot is working if I download u-boot instead.

I am using the getting started example programs from http://www.atmel.com/tools/SAMA5D3SOFTWAREPACKAGE.aspx
Attachments
AT91Bootstrap.png
AT91Bootstrap.png (5.61 KiB) Viewed 3565 times
blue_z
Location: USA
Posts: 1736
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to Execute HelloWorld.bin from DDRAM?

Tue Jan 06, 2015 11:26 pm

Ishmeet wrote:Thanks for the reply, I tried step B with the following steps.

1. Connect SAMBA tool to ATSAMA5D3 Xplained
If you're using the SAM-BA tool, then why aren't you using Method A?
BTW it's SAM-BA not "SAMBA", which is an open-source network service.
Ishmeet wrote:The DDRAM.bin binary file does not seems to be executed by AT91BootStrap firmware, see the image attached.
(Instead of images, you should learn how to use a terminal emulator program that can capture the session as a text log file.)
How is this sequence different from your original post (i.e. "Also, I tried with AT91BootStrap firmware, but it is only booting u-boot not my application")?
In other words, have you tried to utilize any of the information I provided?
Ishmeet wrote:Am I sure that the binary address is 0x40000?
What is a "binary" address? IMO that's a meaningless combination of words.

I stipulated that your program has to be linked to execute at the load address for the AT91Bootstrap method to work.
The screenshot indicates that the booted file is loaded to memory address 0x26f00000 (i.e. upper memory).
Most likely your Softpac program is linked to execute at 0x20000000 (i.e. the start of physical main memory). You can verify that by examining the .map file that should be generated with the .bin file.

Regards

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 1 guest