Home arrow Support arrow Forums

Luminary Micro Forums

dull_boy

Fresh Boarder
Click here to see the profile of this user

2007/08/23 08:22

Can't work with Serial Flash Loader and sflash.exe

Hi all,

When I use the Serial Flash Loader and sflash.exe from the http://www.luminarymicro.com/products/software_updates.html, it can't run my application right. Any suggestion?
I do it as the below:
1. Download the tgpio.bin with Jtag with address 0x0,it work right.
2. Then download bootloader.bin with address 0x0, and download tgpio.bin with 0x800 as below:
G:TrainingbookLuminary_docdatasheetSoftwareBootloaderSerial Flash Loader>
sflash tgpio.bin -p 0x800 -r 0x9c4 -c 1

Application : tgpio.bin
Program Address: 0x800
COM Port: COM1
Baud Rate: 115200
Erasing Flash:
Remaining Bytes: 00000000
Running from address 000009c4
Successfully downloaded to device.

But I can't observe the app blink the LED as download it with 0x0.

I also use jtag to verify the bin file downloading with sflash, which is indeed same as bin file.

And when I using jtag change PC to it, it will work right.

I doubt the bootloader don't run my app right, Or it should blink the LED.

I hope someone can help me, thanks.

johnson

login or register to reply

LMI Eric

Moderator
Click here to see the profile of this user

2007/08/23 09:05

Re:Can't work with Serial Flash Loader and sflash.

You have to link your application (tgpio) to run from 0x800 if you plan on using it with the bootloader. Compilers generate a lot of PC-relative code, so having everything shifted by 0x800 bytes will result in miscalculations and bad data.

login or register to reply

dull_boy

Fresh Boarder
Click here to see the profile of this user

2007/08/23 23:01

Re:Can't work with Serial Flash Loader and sflash.

Thanks your input. For I am a fresh for it, Can you give me the details about how to link to address 0x800?

thanks lots.

login or register to reply

LMI Eric

Moderator
Click here to see the profile of this user

2007/08/24 14:02

Re:Can't work with Serial Flash Loader and sflash.

The answer to your questions depends on which tools you are using. In all cases, you'll be moving the RO base address from 0x0, to 0x800. IAR and Keil should have the option to do that through the GUI, although they may prevent linker file modifications in the evaluation versions of their tools. For CodeSourcery/GNU tools, you only need to modify the scatter file.

login or register to reply