This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem in FLASH to RAM copied code and its execution

Hi, I am working on F28335 custom board. I have successfully copied my code from FLASH to RAM using document (spraau8). The program/application runs fine in a while(1) statement as a standalone application without JTAG Emulator connectivity.

  1. But, as soon as i added another funtion which is executed based on a if statement. My program stucks.
  2. I debug the program using JTAG emulator and it works fine, but as I removed the JTAG emulator again and want to work it as a standalone application the program again unable to execute.

Please, help in finding out any relation in connecting the JTAG emulator and program execution. Another aspect may be the initialization or update of local/global variables during program execution.

  • Hi Irfan,

    If you want your program to execute independently, then you'll have to run using the flash cmd file. Using Ram cmd will require the emulator connection. 

    Regards,

    Gautam

  • Thanks Gautam,

    But I am already using Flash CMD file but at boot time I copy my whole code to RAM and execute from there as per reference of spraau8 document by TI.

  • Hi Irfan,

    Yup, during boot time this solution allows designers to copy initialized compiler sections (.text, .cinit, .econst, .switch,

    etc.) from the Flash to RAM at runtime to allow maximum execution speed and NOT the whole code.

    In your code only some sections can be allowed to be transferred to RAM.

    eg. 1. Sections to RAM

    codestart : > BEGIN_FLASH, PAGE = 0 /* Used by file CodeStartBranch.asm */
    wddisable : > FLASH_AB, PAGE = 0 /* Used by file CodeStartBranch.asm */
    copysections : > FLASH_AB, PAGE = 0 /* Used by file SectionCopy.asm */

    eg. 2. The other initialized compiler sections are allocated to load to the Flash but run from the internal RAM.

    .text : LOAD = FLASH_AB, PAGE = 0 /* Load section to Flash */
    RUN = RAM_H0L0L1,PAGE = 0 /* Run section from RAM */
    LOAD_START(_text_loadstart),
    RUN_START(_text_runstart),
    SIZE(_text_size)

    Atleast one such kind of implementation is required. So please check the same document again.

    Regards,

    Gautam

  • Hi Gautam,

    Gautam Iyer said:
    .text : LOAD = FLASH_AB, PAGE = 0 /* Load section to Flash */
    RUN = RAM_H0L0L1,PAGE = 0 /* Run section from RAM */
    LOAD_START(_text_loadstart),
    RUN_START(_text_runstart),
    SIZE(_text_size)

    You are right, I am already doing exactly the right thing for (.text, .cinit, .econst etc) as you have mentioned. A piece of code is running fine, as soon as I called another function, compiled it along and burned in flash. It got stuck.

    P.S. I am using CCS version 3.3 and I am not being comfortable with the status of variables during debugging.

  • Hi Irfan,

    Is there any possibility to check the same implementation in CCS 5. Also can you please attach the implementation of your function, this would make the things clear.

    Regardsm

    Gautam