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.

TMS320F280039C: .switch and .const abnormal behavior

Part Number: TMS320F280039C

Hi Champ,

I am asking for my customer.

They have a switch statement in the main loop, and the .cmd file is configured as below.

SECTIONS
{
   .cinit           : > FLASH_BANK0_SEC1, ALIGN(4)
   .text            : >>FLASH_BANK0_SEC2 | FLASH_BANK0_SEC3 | FLASH_BANK0_SEC4 | FLASH_BANK0_SEC5 | FLASH_BANK0_SEC6 | FLASH_BANK0_SEC7 | FLASH_BANK0_SEC8 | FLASH_BANK0_SEC9 | FLASH_BANK0_SEC10 | FLASH_BANK0_SEC11 | FLASH_BANK0_SEC12 | FLASH_BANK0_SEC13 | FLASH_BANK0_SEC14 | FLASH_BANK0_SEC15, ALIGN(4)
   codestart        : > BEGIN, ALIGN(4)

   .stack           : > RAMM0_1
   .switch          : > FLASH_BANK0_SEC1, ALIGN(4)

   .init_array      : > FLASH_BANK0_SEC1,       ALIGN(4)
   .bss             : > RAMGS0_1_2_3
   .bss:output      : > RAMGS0_1_2_3
   .bss:cio         : > RAMGS0_1_2_3
   .data            : > RAMGS0_1_2_3
   .sysmem          : > RAMGS0_1_2_3
   .const           : > FLASH_BANK0_SEC4       ALIGN(4)
   
   ....
}

It is weird that customer found out the ISR isn't running if .switch (unified_memory checkbox is checked) and .const aren't allocated at FLASH_BANK0_SEC0.

1. If the .switch is allocated at FLASH_BANK0_SEC0, and .const is allocated at another flash sector (i.e. FLASH_BANK0_SEC1, FLASH_BANK0_SEC4) -> ISR is not doing function properly (not running ISR).

2. If the .switch is allocated at any other flash sector (i.e. FLASH_BANK1_SEC1, FLASH_BANK0_SEC4), no matter which sector the .const is allocated -> ISR is doing function properly (running ISR).

Since I am taking examples with having ISR to duplicate customer's situation, I am not able to see the issue from side.

What customer found this issue merely change the memory allocation for .switch and .const in their own project, the main and ISR code are fixed, and the project is built successfully w/o error.

(1). I don't think we have such restriction for the memory allocation for .switch with unified_memory and .const, correct ?

(2). Based on my customer's situation, any thought what might be the potential cause ?

Thanks and regards,

Johnny