poubellejunky poubellejunky

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

Discussion created by poubellejunky poubellejunky on Jan 9, 2009
Latest reply on Feb 23, 2009 by Guest


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