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.

Concerto F021 API C28x core cannot program Sector K.

CCS v5.3.0.00090, TI Compiler v6.1.2, F021 API v1.52.0

I have a Concerto F28M35H52C1 project utilizing the F021 Flash API on the C28x core. While trying to program the flash, my device always stops working when trying to program the flash in Sector K at address 0x00106000.

The call to Fapi_issueProgrammingCommand(0x0106000, 0x1260000, 8, 0, 0, Fapi_AutoEccGeneration) is the last line I can get to single stepping in the debugger. Afterward, if I pause the execution, then the PC is always at 0x3FEF73 (for which there are no symbols), which contains the value 0x6F00, and the disassembly is SB 0, UNC and always branches to itself. I'm not sure how to determine what is going wrong. At this point in my application, sectors N, M, and L have all been erased and programmed, and sector K has been erased. I have very similar code that runs on the M3 core that works every time.

How can I determine what is causing this problem so I can correct it and complete my application?

  • EGold said:
    0x3FEF73

    This address is a BOOTROM. Your device has been restarted. Do you disable WDog and interrupts with __disable_interrupts() call?

    How do you link your program? Do you use FLASH to store your program? Do you run FlashAPI from RAM (copied from flash during init)? Do you run your "flasher" routine from RAM too? Do you call any FLASH-placed functions from "flasher" routines?

  • I agree that it is in BOOTROM. The watchdog is disabled, and interrupts are disabled by "DINT; PieCtrlRegs.PIECTRL.bit.ENPIE = 0".

    My program is stored in flash, and this is part of my software update routine. The F021 API is copied to RAM before any of its functions are executed. The routine writing to flash is also copied to RAM before being called. Execution is never returned to flash, and all called functions are in RAM. I have included my linker cmd file below as well. All of the functions executing at this point are in the "ramfuncs" group, and any referenced data is in the "fp_data" section.

    Additionally, when I inspect the other registers at this point, I find that CTOMIPCBOOTSTS == 0x00200001. This confirms that the c28 has been restarted and is stuck in boot, but also the FLUNCERR bit is set. This would seem to imply that my device is in a while(1) loop according to Table 6-21 row 3 in the TRM. Do you know how I can determine what caused the fault so I can either prevent it from happening?

    MEMORY
    {
    PAGE 0:    /* Program Memory */

        FLASH       : origin = 0x00100000, length = 0x1FFF0
        FLASH_STORE : origin = 0x00120000, length = 0x1FFF0
        BEGIN       : origin = 0x0013FFF0, length = 0x2
        
    PAGE 1 :   /* Data Memory */
       
        M01SARAM    : origin = 0x0,      length = 0x800     /* on-chip RAM block M0, M1 */
        PIEVECT     : origin = 0xD00,    length = 0x100
        L03SARAM    : origin = 0x8000,   length = 0x4000    /* on-chip RAM block L0-L3 */
        S07SHRAM    : origin = 0x13000,  length = 0x1000
        CTOMMSGRAM  : origin = 0x3F800,  length = 0x400
        MTOCMSGRAM  : origin = 0x3FC00,  length = 0x400
    }

    SECTIONS
    {
        /* Allocate program areas: */
        .text       : > FLASH   PAGE = 0
        .cinit      : > FLASH   PAGE = 0
        .pinit      : > FLASH   PAGE = 0
        .binit      : > FLASH   PAGE = 0
        GROUP
        {
        ramfuncs
        { -l F021_API_C28x_FPU32.lib}
        }             LOAD = FLASH        PAGE = 0,
                      RUN  = L03SARAM   PAGE = 1,
                      LOAD_START(_RamfuncsLoadStart),
                      LOAD_SIZE(_RamfuncsLoadSize),
                      LOAD_END(_RamfuncsLoadEnd),
                      RUN_START(_RamfuncsRunStart)
        fp_data     : type = NOLOAD,
                      RUN > L03SARAM | S07SHRAM PAGE = 1

        /* Initalized sections go in Flash */
        .econst     : > FLASH   PAGE = 0
        .switch     : > FLASH   PAGE = 0
        .args       : > FLASH   PAGE = 0

        /* Allocate uninitalized data sections: */
        .stack      : > M01SARAM | L03SARAM PAGE = 1
        .ebss       : > M01SARAM | L03SARAM PAGE = 1
        .esysmem    : > L03SARAM | M01SARAM PAGE = 1
        .cio        : > L03SARAM | M01SARAM PAGE = 1
    }
  • Could you please post a MAP-file. You have only 24k words for text/econsts till you'll occupy Sector K. Did you try to erase Sectors L, M or N prior Sector K? Do you have arithmetic operations (division or multiply as "/" or "*") in your "flash" routines, e.g. a functions that receives new data from outter world?

  •  

    I experienced the same thing, too.
    It seems to be necessary "rts2800_fpu32.lib" for F021.

    When I put "rts2800_fpu32.lib" to the RAM, it worked well.