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.

TMS320F280023: SCI flash Kernel : BLANK_ERROR

Part Number: TMS320F280023


Hi All,

I am trying to flash tms320f280023 Microcontroller using the SCI flash kernel which is placed in Sector 0 of Flash memory. It was working fine for the first time and i was able to flash my application program using the flash kernel. But after the first succesful flashing, next time onwards it throws a 'BLANK_ERROR' . Important observation is, if i debug the flash_kernel program using Code composer studio, It is working fine .

Can anyone help me to solve this?

Thanks

  • Sudheesh, 

    Have you made any modifications to the kernel? And do have something mapped to Sector 1? It looks like the error is coming from the start of Sector 1. 

    Thanks

    Anu

  • Hi,

     I have edited kernel program to fit it to first sector (SECTOR0).

    Here i am sharing my linker file. It was working fine for the first time, next time onwards it showing this error.

    //
    // Keep the _bankSelect symbol
    //
    //-u bankSelect

    MEMORY
    {
    BEGIN : origin = 0x080000, length = 0x000002
    BOOT_RSVD : origin = 0x00000002, length = 0x00000126
    RAMM0 : origin = 0x00000128, length = 0x000002D8
    RAMM1 : origin = 0x00000400, length = 0x000003F8 /* on-chip RAM block M1 */
    // RAMM1_RSVD : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

    /* RAMLS4 : origin = 0x0000A000, length = 0x00000800
    RAMLS5 : origin = 0x0000A800, length = 0x00000800
    RAMLS6 : origin = 0x0000B000, length = 0x00000800
    RAMLS7 : origin = 0x0000B800, length = 0x00000800*/

    //
    // Allocate space for the liveDFU function in bank 0
    //

    /* Combining all the LS RAMs */
    RAMLS4567 : origin = 0x0000A000, length = 0x00002000
    RAMGS0 : origin = 0x0000C000, length = 0x000007F8
    // RAMGS0_RSVD : origin = 0x0000C7F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */


    // FLASHBANK1 : origin = 0x00080000, length = 0x0000FFF0
    // FLASH_BANK1_RSVD : origin = 0x0008FFF0, length = 0x00000010 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    BOOTROM : origin = 0x003F0000, length = 0x00008000
    BOOTROM_EXT : origin = 0x003F8000, length = 0x00007FC0
    RESET : origin = 0x003FFFC0, length = 0x00000002
    /* Flash sectors */
    /* BANK 0 */
    FLASH_BANK0_SEC0 : origin = 0x080002, length = 0x000FE6 /* on-chip Flash */
    //BANK0_SEC1 : origin = 0x81000, length = 0x000017

    FLASH_LDFU_SECTION : origin = 0x080FE9, length = 0x00017 /* on-chip Flash */


    }


    SECTIONS
    {
    codestart : > BEGIN, ALIGN(8)
    .text : >> FLASH_BANK0_SEC0, ALIGN(8)
    .cinit : > FLASH_BANK0_SEC0, ALIGN(8)
    .switch : > FLASH_BANK0_SEC0, ALIGN(8)
    .reset : > RESET, TYPE = DSECT /* not used, */

    .stack : > RAMM1

    .init_array : > FLASH_BANK0_SEC0, ALIGN(8)
    .bss : > RAMLS4567
    .bss:output : > RAMLS4567
    .bss:cio : > RAMLS4567
    .const : > FLASH_BANK0_SEC0, ALIGN(8)
    .data : > RAMLS4567
    .sysmem : > RAMLS4567

    //ramgs0 : > RAMGS0

    GROUP
    {
    .TI.ramfunc
    } LOAD = FLASH_BANK0_SEC0,
    RUN = RAMLS4567,
    LOAD_START(RamfuncsLoadStart),
    LOAD_SIZE(RamfuncsLoadSize),
    LOAD_END(RamfuncsLoadEnd),
    RUN_START(RamfuncsRunStart),
    RUN_SIZE(RamfuncsRunSize),
    RUN_END(RamfuncsRunEnd),
    ALIGN(8)

    LDFU_BANK0 : > FLASH_LDFU_SECTION, ALIGN(8)
    }
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */

  • What sectors are your application mapped to? Did you make any modifications to where Sector 1 starts?

    Thanks

    Anu

  • Hi,

    My application starts from sector 1 to sector 5.

    BEGIN address of my application is 81000 .

    Here i am sharing my application linker file

    MEMORY
    {
    BEGIN : origin = 0x081000, length = 0x000002
    BOOT_RSVD : origin = 0x00000002, length = 0x00000126
    RAMM01 : origin = 0x00000128, length = 0x000006D0

    RAMGS0 : origin = 0x0000C000, length = 0x000007F8
    RAMLS7 : origin = 0x0000B800, length = 0x00000800

    BOOTROM : origin = 0x003F0000, length = 0x00008000
    BOOTROM_EXT : origin = 0x003F8000, length = 0x00007FC0
    RESET : origin = 0x003FFFC0, length = 0x00000002
    /* Flash sectors */
    /* BANK 0 */
    FLASH_BANK0_SEC0 : origin = 0x080002, length = 0x000FFE /* on-chip Flash */
    FLASH_BANK0_SEC1 : origin = 0x081002, length = 0x000FFE /* on-chip Flash */
    FLASH_BANK0_SEC2 : origin = 0x082000, length = 0x001000 /* on-chip Flash */
    FLASH_BANK0_SEC3 : origin = 0x083000, length = 0x001000 /* on-chip Flash */
    FLASH_BANK0_SEC4 : origin = 0x084000, length = 0x001000 /* on-chip Flash */
    FLASH_BANK0_SEC5 : origin = 0x085000, length = 0x001000 /* on-chip Flash */
    FLASH_PARAM_SEC : origin = 0x087000, length = 0x001000 /*Reserved for FLash Parameters */
    }

    SECTIONS
    {
    codestart : > BEGIN, ALIGN(8)
    .text : >> FLASH_BANK0_SEC2 | FLASH_BANK0_SEC3 | FLASH_BANK0_SEC4 | FLASH_BANK0_SEC5, ALIGN(8)
    .cinit : > FLASH_BANK0_SEC1, ALIGN(8)
    .switch : > FLASH_BANK0_SEC1, ALIGN(8)
    .reset : > RESET, TYPE = DSECT /* not used, */

    .stack : > RAMM01

    .init_array : > FLASH_BANK0_SEC1, ALIGN(8)
    .bss : > RAMGS0
    .bss:output : > RAMGS0
    // .bss:cio : > RAMGS0
    .const : > FLASH_BANK0_SEC1, ALIGN(8)
    .data : > RAMGS0
    .flashParamRam : > RAMLS7
    .sysmem : > RAMGS0

    /* Allocate IQ math areas: */
    IQmath : > RAMGS0
    IQmathTables : > RAMGS0

    FlashParamSector : > FLASH_PARAM_SEC type = NOINIT

    .TI.ramfunc : LOAD = FLASH_BANK0_SEC1,
    RUN = RAMGS0,
    LOAD_START(RamfuncsLoadStart),
    LOAD_SIZE(RamfuncsLoadSize),
    LOAD_END(RamfuncsLoadEnd),
    RUN_START(RamfuncsRunStart),
    RUN_SIZE(RamfuncsRunSize),
    RUN_END(RamfuncsRunEnd),
    ALIGN(8)
    }
    /*
    //===========================================================================
    // End of file.
    //===========================================================================
    */

    Why it is always working fine during debug ?

    Thanks 

    - Sudheesh

  • Hi ,

    I also found the actual error. The error return value is 0x201 (ie Dec 513 : Fapi_Error_FlashRegsNotWritable ). How can i solve this ?

    -Thanks

  • Are you initializing the Flash API? This should be done in the main file of the kernel. 

    Thanks

    Anu

  • Hi,

    I have placed  Fapi_initializeAPI() in main file itself. What i am not understanding is why this is working fine when i am doing debugging ?

    Thanks

    -Sudheesh

  • Sudheesh, 

    I will get back to you by next Wednesday. 

    Thanks

    Anu

  • Are there any optimizations set on the project when you compile it to run standalone?

  • Hi ,

    No, Optimization level is OFF.

    Thanks

  • Is the Flash API being copied to RAM at runtime? Since this is a single bank device you will need to run the Flash API out of RAM when performing operations on Flash. 

    Thanks

    Anu