Hi Everyone,
I'm trying to get the U-Boot standalone Hello World demo to 
work on a modified Atmel NGW100 board and I am a bit confused 
about all the addresses:
- examples/Makefile: LOAD_ADDR
  . Currently set to 0x00000000 for avr32
- mkimage load address (-a) parameter
- mkimage entry point (-e) parameter
- U-Boot go command address

My ultimate goal (with this little project) is to erase
an environment variable and reset the processor. I know this
would be very easy with a U-Boot script:
  http://www.denx.de/wiki/DULG/UBootCmdGroupExec
but one of my constraints is that I need to use the 
fsload + bootm commands to start something that will do 
just that.

I'll resume my understanding of all that I have read and
I would really appreciate if someone could correct or 
complete this. This is a bit long, but I am trying
to put all the information in one place so the next
person who needs to do the same will have a single
source of information.

I am using U-Boot 1.3.0.atmel.2
My system's memory is as follows:
- Flash   0x00000000 - 0x02000000 (32 MB)
- RAM     0x10000000 - 0x14000000 (64 MB)
Architecture: avr32
- U-Boot resides in sector 0 of the Flash at
address 0x00000000


>From what I understand, when compiling a U-Boot standalone 
program, one needs to define where the program will be 
executed since function calls are using absolute addresses.
The example/Makefile LOAD_ADDR for the selected architecture
should be set to the program's load address.


The steps for running a standalone application using 
the go command in U-Boot are:
====================================================
1- Compile the standalone Hello World Demo with the
  "make examples" command from the U-Boot top directory.
  This step will run the following commands:
  $ avr32-linux-gcc     (compile hello_world.c)
  $ avr32-linux-ld      (link against the linux-uclibc library)
    . This is also where the start address is defined
  $ avr32-linux-objcopy (to copy to binary or srec format)
2- Load U-Boot program in memory
  http://www.denx.de/wiki/DULG/UBootStandalone
  According to the LOAD_ADDR, the program should be loaded
  at 0x00000000 (in Flash, over U-Boot). This would
  overwrite the U-Boot in Flash, already residing in this
  sector of memory. I would need to load it in RAM.
  $ tftpboot 0x10300000 hello_world.bin
3- Run using the U-Boot "go" command
  $ go 0x10300004 This is a test


Problem 1:
==========
When I change the LOAD_ADDR to 0x10300000, I get a linker error:
avr32-linux-ld: hello_world: Not enough room for program headers (allocated 2, 
need 3)
  Segment              Sections...
  00:           LOAD:  .rela.dyn
  01:           LOAD:  .text .rodata
  02:           LOAD:  .got
avr32-linux-ld: final link failed: Bad value

(?) Does anyone have an idea what I can do for this?


Steps for running a standalone program using bootm:
===================================================
Let's assume I was able to run the standalone program usinng the
go command. My next step is to create an image that can be
started using bootm.
1- Compile the standalone Demo with "make examples"
2- Create an image (.img) using mkimage
  I assume the address (-a) needs to be the same as the
  Makefile LOAD_ADDR and the entry point (-e) will be 4 bytes
  after that.
  $ mkimage -A avr32 -O u-boot -T standalone -C none \
    -a 0x10300000 -e 0x10300004 -n "Hello World" \
    -d hello_world.bin hello_world.img
3- Load the image in memory (not the execution place)
  $ tftpboot 0x11000000 hello_world.img
4- Run the application
  $ bootm
  (autostart is set to yes and bootm works when I start linux)

  
(?) Anything wrong in there?

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to