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
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
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.
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