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.

CCS/TMS320F28020: Error encountered when configure boot from flash

Part Number: TMS320F28020
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

I want to boot from flash so I followed this file. The project is just an example from C2000Ware.

3414.7737.Flash Accesses Settings for C2000 in CCS5.doc

After the configuration I meet these errors. How do I debug this?

Description Resource Path Location Type
#148 F2802x_GlobalVariableDefs.c /Example_2802xCpuTimer line 211 C/C++ Problem
gmake: *** [F2802x_GlobalVariableDefs.obj] Error 1 Example_2802xCpuTimer C/C++ Problem
gmake: Target 'all' not remade because of errors. Example_2802xCpuTimer C/C++ Problem

  • Hello

    Have you looked at the flash example in C2000Ware? ~\device_support\f2802x\examples\drivers\flash_f2802x
    I would start there.

    Best regards
    Chris
  • Thank you for your reply!
    I was working on hardware these days. Now I am back to code side.
    Yes I started form ~\device_support\f2802x\examples\structs\flash_f2802x
    I do see the program is not lost after power off.
    But when I insert more codes into this example, I got something wrong, the program gets stuck(can't reach idle loop).
    Two functions get stuck in main()
    InitAdc();
    AdcOffsetSelfCal();

    I notice some comments in the example

    //
    // Copy time critical code and Flash setup code to RAM
    // This includes the following ISR functions: EPwm1_timer_isr(),
    // EPwm2_timer_isr(), EPwm3_timer_isr and and InitFlash();
    // The RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart
    // symbols are created by the linker.
    //

    So I suspect memcpy() function only copies parts of the program from flash to RAM.
    I need to know more about how memcpy() works. Where should I get started?
  • This talks about copying from flash to RAM.
    processors.wiki.ti.com/.../Placing_functions_in_RAM

    In the memory linker file you're see the section "ramfuncs" that functions get assigned which are loaded to flash and then copied to RAM when the memcpy statement is run.

    You use a pragma to add a function to ramfuncs.
    Ex: #pragma CODE_SECTION(EPwm1_timer_isr, "ramfuncs");

    Best regards
    Chris
  • Thank you for you reply!
    I understand your answer but probably I didn't make my question clear.

    My goal is that my code will not be lost after DSP board power off. I hope it can auto start after power on.

    I have tried many examples in ~\device_support\f2802x\examples\structs\, all of them don't meet my goal except the flash_f2802x. I can't see the difference between flash_f2802x and others.

    My question is:
    What has been done to flash_f2802x to make it different to others?
    Similar question: What should be done to make other examples run like flash_f2802x.
  • Ok, I understand.

    You'll need to do the following:
    - Your project should define the predefined value: _FLASH
    - Your project should be setup to use a flash linker command file (one that puts the appropriate sections into the FLASH memory regions)
    - Your project should contain a memcpy so that the appropriate functions are run from RAM.

    Best regards
    Chris
  • Ok. I will dig into that.
    Thank you Chris!