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.

Errors when trying to flash code. F28030

Other Parts Discussed in Thread: CONTROLSUITE, TMS320F28335

Hi, 

I have some code that I've been testing that I would like to program to flash.

When I do that I run into a problem when I'm trying to copy my ram functions.

In example 2803xFlash it tells me to use:

memcpy((uint16_t *)&RamfuncsRunStart,(uint16_t *)&RamfuncsLoadStart, (unsigned long)&RamfuncsLoadSize);

to copy data from flash to ram to avoid errors, yet when I do this in my code it complains about RamFuncsLoadSize being undefined, yet I thought this would be defined by including F2030.cmd.

Where can I get these definitions? (I do have the following at the top of my main.c:

extern Uint16 RamfuncsLoadStart;
extern Uint16 RamfuncsLoadSize;
extern Uint16 RamfuncsRunStart;

)

  • Hello Daniel!

    You are doing almost everything right. But pay attention:  the RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart symbols are created by the linker. If you wish to copy some functions to RAM you need to do following (for example):

    1 main.c:

    #pragma CODE_SECTION(some_isr1, "ramfuncs");

    #pragma CODE_SECTION(some_isr2, "ramfuncs");

    __interrupt void some_isr1(void);
    __interrupt void some_isr2(void);

    extern Uint16 RamfuncsLoadStart;
    extern Uint16 RamfuncsLoadSize;
    extern Uint16 RamfuncsRunStart;

    void main(void)
    {

    ...............................some initialization code

    memcpy((uint16_t *)&RamfuncsRunStart,(uint16_t *)&RamfuncsLoadStart, (unsigned long)&RamfuncsLoadSize);

    InitFlash();

    ................................some code

    }

    __interrupt void some_isr1(void)

    {

    ............................

    }

    __interrupt void some_isr2(void)

    {

    ..............................

    }

    2 command linker file (*.CMD):

    ..............................................

    SECTIONS
    {

    /* Allocate program areas: */
    .cinit : > FLASHA PAGE = 0
    .pinit : > FLASHA, PAGE = 0
    .text : > FLASHA PAGE = 0
    codestart : > BEGIN PAGE = 0
    ramfuncs : LOAD = FLASHD,
                        RUN = RAML0,
                        LOAD_START(_RamfuncsLoadStart),
                        LOAD_SIZE(_RamfuncsLoadSize),
                        RUN_START(_RamfuncsRunStart),
                        PAGE = 0

    ..................................................

    This is only example. You can find needed examples of .CMD files for your DSP in controlSUITE and you need to allocate memory resources according your requirements. Also I would recommend you these materials

    7607.TI_Running_from_Flash_spra958l.pdf

    8204.TI_Copying Compiler Sections From Flash to RAM.pdf

    Regards,

    Igor 

  • Hi,

    The above 2 docs Igor has attached will surely solve all your queries on this topic.

    Regards,

    Gautam

  • Thank you very much, as always, your help has been invaluable. 

  • Hi Daniel!

    Well, always you are welcome!

    Igor

  • I’m having the same issue (#20 identifier “RamfuncsLoadSize” is underfined). I’m trying to program a TMS320F28335 that is part of a Semikron SKAI2-LV device.  The program is supposed to be a simple LED-blink program using SYS/BIOS.  I loaded Lab4 from the TI-RTOS training (https://training.ti.com/ti-rtos-workshop-series) site, but the hardware device requires that I load this from FLASH due to its hardwire selection.  I modified the main.c code to the best of my abilities utilizing some non-BIOS code that I have from a motor controller that does load on the SKAI2-LV device (so I know the device functions).  I’ve put in the following code and put in FLASH as a Pre-defined Name for the Predefined Symbols of the project properties.

    #ifdef FLASH
    #pragma CODE_SECTION(Initflash,”ramfuncs”);
    #pragma CODE_SECTION(main,”ramfuncs”);
    #endif

    I’m going to attach my project code in the hope that someone can help steer me straight. I’ve read SPRA958L and downloaded the code, only to realize that it was set for DSP/BIOS v5.  As I’m trying to use SYS/BIOS, I’m a bit bummed and wishing that there was a similar SPRA958L with examples for SYS/BIOS for loading out of FLASH or RAM and with or without SYS/BIOS.

    Any help is appreciated to get this simple “hello world” type of program to run. If I can understand what I did wrong and where I missed something, I’d like to apply that to the other labs from this training and to eventually get SYS/BIOS functional with my PMSM motor controller code.

    -Timblink_tms320f28335_BIOS.zip

  • Hello,

    Please consider creating a new post with your question. This post had been closed a while ago and is no longer tracked. You can provide the necessary information regarding your issue in the new post and include a link to this post if you'd like.

    Thanks,
    Elizabeth