Execution stops when code executed in flash : CWarrior for MobileGT V9.2 with dev board Lite5200B

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Execution stops when code executed in flash : CWarrior for MobileGT V9.2 with dev board Lite5200B

2,215 Views
DavidFournier
Contributor I

Hi,  

I am trying to execute and debug my code from flash and I have few problems. I read every documents that I found about this subject but I still have a hard time to find what exactly must be done. Here is what I have done until now:


 

1- Create a project with linker file Lite5200B_flash_bl.lcf (Lite5200B Run-from-Flash, boot-low linker command file (data in SRAM)).

vectors_rom : org = 0x0, length = 0x3000
boot_rom : org = 0x3000, length = 0xffd000
sram : org = 0xf0008000, length = 0x4000 /* ASSUMING MBAR_BASE == 0xf0000000 */
cs1_rom : org = 0xfe000000, length = 0x01000000
cs0_rom : org = 0xff003000, length = 0x00ffd000 /* physical device same as boot_rom */

2- Set project options to use the prefix_runflash.h file


 

3- Set project options to use {Project}SystemConfig\init_ram.cfg file (Standard Initialization Code for Lite5200B board).


 

4- Use {Project}SystemConfig\mmap_fbl.mem (Lite5200B Memory Map for Boot-Low-like FLASH (no SDRAM) - can be used to debug Boot-Low startup code running from flash)


 

5- Then make the project with Generate ROM Image enabled. RAM Buffer Address and ROM Image Address are set to 0xFF000000.


 

6- Program the flash memory (at 0xFF000000) successfully with the Flash Programmer using the *.elf file build previously. The programmed data found in flash correspond to the ones found in *.mot file.


 

7- Finally, hit the Debug button. All the checkbox under the option Program Download Options are unchecked to avoid to copy datas before the debug. The problem is that the execution stops somewhere into the __start(void) function. It stops anywhere into this function and once the execution is interrupted, it cannot be continued from this point. When I restart CodeWarrior, I reset the board and launch the debugger again, the execution stops at another point in the __start(void) function and once again, the execution cannot be continued.

 

I am not sure which Entry Point must be use in EPPC Linker options. 


 

Note that I use a USB Tap connected to a dev board Lite5200B (with two flash bank at 0xFF000000 and 0xFE000000). Every files indicated above (init_ram.cfg, Lite5200B_flash_bl.lcf, mmap_fbl.mem, prefix_runflash.h) were taken "as is" from the SystemConfig folder, under my project.  I try to debug with the BootLow jumper, I modified the Small Data2 setting to 0 in EPPC Target option and I added the #pragma switch_tables off instruction in startup.c.


 

If anyone has a clue of what my mistake is, please let me know. It will be appreciated


 

Thank you

 



Message Edited by DavidFournier on 2009-01-09 05:10 PM

Message Edited by DavidFournier on 2009-01-09 05:11 PM

Message Edited by DavidFournier on 2009-01-09 06:48 PM

Message Edited by DavidFournier on 2009-01-09 06:49 PM
Labels (1)
0 Kudos
Reply
4 Replies

583 Views
admin
Specialist II

Hi,

   i use 5200B with graphic quickstart tool, and i think we cannot debug a stand alone application on flash, infact if you try to do it and you put assembly source view you will se that line executed still lay on external ram(not on flash, infact you can access flash only by flash programmer). I think you are executing startup code  with the define line of a stand alone application but these lines dont'math with a debug operation and so you have problems during debugging.

 

that's my idea, tell me what do you think about

0 Kudos
Reply

583 Views
CrasyCat
Specialist III
Hello
 
There seem to be something wrong in your application configuration.
I assume you have FLASH from 0x000000to 0xffd000 and  from 0xfe000000 to 0x00ffd000.
Am I right
 
According to the .map file you have attached the startup code will try to copy data from address 0xff000000  to  00000000, which will not work.
 
When you have several FLASH blocks in the .lcf file's MEMORY block, some additional configuration is needed to make sure the ROM Image is working correctly.
 
Please refer to chapter "ROM Image" in the attached Technical Note for information on how to configure your ROM image correctly.
 
CrasyCat
0 Kudos
Reply

583 Views
DavidFournier
Contributor I

Thanks for answering CrasyCat

Actually, I do have two flash memory on my board, but I only use one. Should i define both of them in the *.lcf file, or only the one that i want to use?

From what i understand using Uboot, my flash memories are : CS0 start at 0xFF000000 and CS1 starts at 0xFE000000.

=> bdinfo

memstart = 0x00000000
memsize = 0x10000000
flashstart = 0xFF000000
flashsize = 0x02000000

flashoffset = 0x00000000
sramstart = 0x00000000
sramsize = 0x00000000
bootflags = 0x00000001
intfreq = 396 MHz
busfreq = 99 MHz
ethaddr = FF:FF:FF:FF:FF:FF
IP addr = 0.0.0.0
baudrate = 115200 bps  
=> flinfo

Bank # 1: AMD Unknown Chip Type
Size: 16 MB in 128 Sectors
Sector Start Addresses:
FF000000 FF020000 FF040000 FF060000 FF080000
FF0A0000 FF0C0000 FF0E0000 FF100000 ...

Bank # 2: AMD Unknown Chip Type
Size: 16 MB in 128 Sectors
Sector Start Addresses:
FE000000 FE020000 FE040000 FE060000 FE080000
FE0A0000 FE0C0000 FE0E0000 FE100000 ...
 


I modified my *.lcf file to define these two banks (see attachement). I also removed boot_rom sections and copied the associated data it at the beginning of the cs0_rom and I redefined the address for the vector_rom at 0xff000000 (i don't understand why these two sections where defined at 0x0).  Also, why is the entry point at 0x00000100 (.entry_point BIND(0x00000100) : {}).

It seems that i was able to debug from the flash a few times, but it seems really intermittent (content of ram?).  I don't know what my mistake is.  Any idea is welcome !

Thank you

 

 

 



Message Edited by DavidFournier on 2009-01-12 07:32 PM

Message Edited by DavidFournier on 2009-01-12 07:33 PM
0 Kudos
Reply

583 Views
CrasyCat
Specialist III
Hello
 
What did you define as start address for your ROM Image address?
What did you specify as start address for RAMBuffer Address?
 
CrasyCat
0 Kudos
Reply