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.

RTOS/TMS320F28069F: Moving things from RAM to flash causes exceptions

Part Number: TMS320F28069F


Tool/software: TI-RTOS

Summary: I am changing my .cmd file to have all my compiled code moved from running from RAM to running from flash. using #pragma CODE_SECTIONS, I keep certain functions in RAM. When I do this, I get an ISR exception when the most basic routine is executed. 

Long Story; I am trying to execute USB reads from a RAM routine. In doing so, I want the bulk of my Main.c file to execute out of flash (that is the compiled code to live in internal flash), and then have only the USB functionality running out of RAM. When I move all the functions from fat_usbmsc.c to the RAM locations, a portion of the ff.c to the ramfuncs, and what I believe is the one necessary function from the usblib.lib to the ramfuncs area, I get an ISR.

Question: Stepping through the code is not providing any concrete conclusion that more usblib.lib functions need to be run from RAM, nor can i get a clear picture of what the ISR is getting hit. How do I even go about debugging this? Can I figure out which portion of the usblib.lib I can pull out of internal flash so I can execute USB functionality as desired? I only need to read from the USB drive, not write

  • Hi Parag,

    To debug ISRs it is helpful to look at the PIE registers, particularly PIECTRL and PIEACK.

    This is the most important information though: You should not use CCS to load code or data to both RAM and flash. CCS does not support loading to both. You will need to load everything to flash and then perform a memcpy to RAM of the portions you want in RAM. To do this, put the code you want in RAm in .TI.ramfunc and perform a memcpy at the start of your program.

    This may resolve your issue.

    sal