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/TMS320F280049C: Loading the program to flash fails when the code includes a line to set an entry in PieVectTable

Part Number: TMS320F280049C

Tool/software: Code Composer Studio

I'm not really sure how to describe this problem but here's what happens.  If I include the lines in one of my objects:

EALLOW;
PieVectTable.TIMER0_INT = &MainISR;
EDIS;

where MainISR is defined as:

__interrupt static void MainISR(void);

Then I get an error while programming the flash (console output posted below).  If I remove just the write to PieVectTable above then the programming to flash works just fine.  My main() doesn't even call or include the object (or any objects or headers for that matter). There isn't a difference in the .map files between the two versions (as expected since nothing is actually included).  Is there a more verbose output from the flash tool?

Here's the entirety of my main.cpp:

void main() {

}

Console output when programming:

C28xx_CPU1: GEL Output:
Memory Map Initialization Complete
C28xx_CPU1: GEL Output: ... DCSM Initialization Start ...
C28xx_CPU1: GEL Output: ... DCSM Initialization Done ...
C28xx_CPU1: GEL Output: ... DCSM Initialization Start ...
C28xx_CPU1: GEL Output: ... DCSM Initialization Done ...
C28xx_CPU1: Writing Flash @ Address 0x00081050 of Length 0x00000023 (page 0)
C28xx_CPU1: GEL Output: ... DCSM Initialization Start ...
C28xx_CPU1: GEL Output: ... DCSM Initialization Done ...
C28xx_CPU1: PLL configuration status = 1. PLL configured successfully.
C28xx_CPU1: Erasing Flash Bank 0, Sector 0
C28xx_CPU1: Erasing Flash Bank 0, Sector 1
C28xx_CPU1: Erasing Flash Bank 0, Sector 2
C28xx_CPU1: Erasing Flash Bank 0, Sector 3
C28xx_CPU1: Erasing Flash Bank 0, Sector 4
C28xx_CPU1: Erasing Flash Bank 0, Sector 5
C28xx_CPU1: Erasing Flash Bank 0, Sector 6
C28xx_CPU1: Erasing Flash Bank 0, Sector 7
C28xx_CPU1: Erasing Flash Bank 0, Sector 8
C28xx_CPU1: Erasing Flash Bank 0, Sector 9
C28xx_CPU1: Erasing Flash Bank 0, Sector 10
C28xx_CPU1: Erasing Flash Bank 0, Sector 11
C28xx_CPU1: Erasing Flash Bank 0, Sector 12
C28xx_CPU1: Erasing Flash Bank 0, Sector 13
C28xx_CPU1: Erasing Flash Bank 0, Sector 14
C28xx_CPU1: Erasing Flash Bank 0, Sector 15
C28xx_CPU1: Erasing Flash Bank 1, Sector 0
C28xx_CPU1: Erasing Flash Bank 1, Sector 1
C28xx_CPU1: Erasing Flash Bank 1, Sector 2
C28xx_CPU1: Erasing Flash Bank 1, Sector 3
C28xx_CPU1: Erasing Flash Bank 1, Sector 4
C28xx_CPU1: Erasing Flash Bank 1, Sector 5
C28xx_CPU1: Erasing Flash Bank 1, Sector 6
C28xx_CPU1: Erasing Flash Bank 1, Sector 7
C28xx_CPU1: Erasing Flash Bank 1, Sector 8
C28xx_CPU1: Erasing Flash Bank 1, Sector 9
C28xx_CPU1: Erasing Flash Bank 1, Sector 10
C28xx_CPU1: Erasing Flash Bank 1, Sector 11
C28xx_CPU1: Erasing Flash Bank 1, Sector 12
C28xx_CPU1: Erasing Flash Bank 1, Sector 13
C28xx_CPU1: Erasing Flash Bank 1, Sector 14
C28xx_CPU1: Erasing Flash Bank 1, Sector 15
C28xx_CPU1: Data has been buffered at the end of the current data block for 64-bit aligned writes.
C28xx_CPU1: --Verifying Flash @ Address 0x00081050 of Length 0x00000020
C28xx_CPU1: Writing Flash @ Address 0x00081074 of Length 0x00000004 (page 0)
C28xx_CPU1: --Verifying Flash @ Address 0x00081074 of Length 0x00000004
C28xx_CPU1: Writing Flash @ Address 0x00080000 of Length 0x00000002 (page 0)
C28xx_CPU1: Data has been buffered at the end of the current data block for 64-bit aligned writes.
C28xx_CPU1: Writing Flash @ Address 0x00081000 of Length 0x00000050 (page 0)
C28xx_CPU1: --Verifying Flash @ Address 0x00081000 of Length 0x00000050
C28xx_CPU1: Writing Flash @ Address 0x00084000 of Length 0x000005b2 (page 0)
C28xx_CPU1: Data has been buffered at the end of the current data block for 64-bit aligned writes.
C28xx_CPU1: --Verifying Flash @ Address 0x00084000 of Length 0x000005B0
C28xx_CPU1: Writing Flash @ Address 0x000845b4 of Length 0x00000004 (page 0)
C28xx_CPU1: --Verifying Flash @ Address 0x000845B4 of Length 0x00000004
C28xx_CPU1: Writing Flash @ Address 0x00081078 of Length 0x00000f88 (page 0)
C28xx_CPU1: Error during Flash programming (Flash algorithm returned error code). Operation cancelled.
C28xx_CPU1: File Loader: Memory write failed: Unknown error
C28xx_CPU1: GEL: File: D:\Roam\firmware\projects\shu.0.x\CPU1_FLASH\shu.0.x.out: Load failed.
C28xx_CPU1: Writing buffered data @ Address 0x00080000 of Length 0x00000004
C28xx_CPU1: Error during Flash programming (Flash algorithm returned error code). Operation cancelled.
C28xx_CPU1: Please make sure the memory location you are programming have not already been programmed.
C28xx_CPU1: Writing buffered data @ Address 0x00081070 of Length 0x00000004
C28xx_CPU1: Error during Flash programming (Flash algorithm returned error code). Operation cancelled.
C28xx_CPU1: Please make sure the memory location you are programming have not already been programmed.
C28xx_CPU1: Writing buffered data @ Address 0x000845B0 of Length 0x00000004
C28xx_CPU1: Error during Flash programming (Flash algorithm returned error code). Operation cancelled.
C28xx_CPU1: Please make sure the memory location you are programming have not already been programmed.

  • Whoa this was a rough one to figure out but it was a bad #pragma call.  I pulled my object from an older project with

    #pragma CODE_SECTION("ramfunc")

    and the newer .cmd files these days use ".TI.ramfunc" and for reasons beyond me the linker didn't flag the unknown #pragma label and the issue manifested as a programming error.  Very hard to track down with those error outputs.  Why did the .cmd files change the "ramfunc" label?

  • Hi Kevin,

    Good to hear that you figured out your issue. Not certain what brought about the change to the labels at this time, but will report back if I come across some information.

    Best,
    Kevin
  • If anyone has an idea as to why misspelling the #pragma label in an object that's not even included in main would cause the flash tool to fail, I'd love to hear it.  Seems like it's a bug but I can't know unless there's more documentation on what the flash tool is doing and what it's using to push down the .hex file.