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.

TMS320F28388D: Device_init() issue debugging code in FLASH

Part Number: TMS320F28388D
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Hi,

I'm using a MCU063B version of the Control Card for the F28388D. I'm also using C2000Ware 5.00.00.00, SysConfig and FreeRTOS in my project.

I was always executing my code in RAM with no problems, now trying to execute it in FLASH, the same code gives me an error at the very beginning initialization:

 Device_init() -> 

              SysCtl_setClock(DEVICE_SETCLOCK_CFG) ->

                               //
                               // Delay of at least 120 OSCCLK cycles required post PLL bypass
                               //
                               SysCtl_delay(23U);

The error gets me to _system_post_cinit():

Looking at Disassembly:

Why do I get this and how can I fix it?

Thanks,

Fabio 

  • Hi Fabio,

    SysCtl_delay is ramfunc. Meaning, it is loaded to Flash, but run from RAM.

    You need to copy the contents from Flash to RAM before CPU can execute any such ramfuncs. 

    If you are using Device_init, it is done as part of     memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    Can you confirm if this is done in your application?

    Regards,

    Veena

  • Hi Veena,

    many thanks, I had a wrong symbol in Predefined Symbols in my Flash build configuration: FLASH instead of _FLASH. Thus, that part of code was not executed.

    Thanks and best regards,

    Fabio