Tool/software:
Good morning,
I've created an APP using TMS570LC4357 uC, once application is done I needed to create a bootloader, I've been able to jump from bootloader to app, but when doing so application ISR are not being called. In the other hand, if application runs on its own, without bootloader being present, interruptions work perfectly.
I have two linker scripts, one for bootloader and one for app, I think both of them are correctly declared, but this is my first time using a TI uC so I'm a bit lost about vector reset, if it needs to be changed somewhere else apart of linker script or if I'm missing some reason why interrupts aren't being called when bootloader plus application is running .
This is my bootloader linker script:
/*----------------------------------------------------------------------------*/ /* Linker Settings */ --retain="*(.intvecs)" /* USER CODE BEGIN (1) */ /* USER CODE END */ /*----------------------------------------------------------------------------*/ /* Memory Map */ MEMORY { VECTORS (X) : origin=0x00000000 length=0x00000020 fill = 0xffffffff FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0 vfill = 0xffffffff FLASH1 (RX) : origin=0x00200000 length=0x00200000 vfill = 0xffffffff /* Bank 7 (128kB, FEE) */ FLASH7 (R) : origin=0xF0200000 length=0x00020000 vfill = 0xffffffff STACKS (RW) : origin=0x08000000 length=0x00001500 RAM (RW) : origin=0x08002500 length=(0x0002EB00-0x2500) /* Bank 0 ECC */ // ECC_VEC (R) : origin=(0xf0400000 + (start(VECTORS) >> 3)) // length=(size(VECTORS) >> 3) // ECC={algorithm=algoL2R5F021, input_range=VECTORS} // ECC_FLA0 (R) : origin=(0xf0400000 + (start(FLASH0) >> 3)) // length=(size(FLASH0) >> 3) // ECC={algorithm=algoL2R5F021, input_range=FLASH0 } /* Bank 1 ECC */ // ECC_FLA1 (R) : origin=(0xf0400000 + (start(FLASH1) >> 3)) // length=(size(FLASH1) >> 3) // ECC={algorithm=algoL2R5F021, input_range=FLASH1 } /* Bank 7 ECC */ // ECC_FLA7 (R) : origin=0xF0100000 // length=(size(FLASH7) >> 3) // ECC={algorithm=algoL2R5F021, input_range=FLASH7 } } ECC { algoL2R5F021 : address_mask = 0xfffffff8 /* Address Bits 31:3 */ hamming_mask = R4 /* Use R4/R5 build in Mask */ parity_mask = 0x0c /* Set which ECC bits are Even and Odd parity */ mirroring = F021 /* RM57Lx and TMS570LCx are build in F021 */ } #endif /*----------------------------------------------------------------------------*/ /* Section Configuration */ SECTIONS { .intvecs : {} > VECTORS flashAPI: { .\Boot\Fapi_UserDefinedFunctions.obj (.text) .\Boot\bl_flash.obj (.text) --library = F021_API_CortexR4_BE_L2FMC.lib (.text) } load = FLASH0 |FLASH1, run = RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize) .text : {} > FLASH0 |FLASH1 .const : {} load=FLASH0 |FLASH1 .cinit : {} > FLASH0 | FLASH1 .pinit : {} > FLASH0 | FLASH1 .bss : {} > RAM /* Uninitialized global and static variables */ .data : {} > RAM /* Global and static non-const variables that are explicitly initialized. */ .sysmem : {} > RAM /* Memory pool (heap) for dynamic memory allocation */ FEE_TEXT_SECTION : {} > FLASH0 | FLASH1 FEE_CONST_SECTION : {} > FLASH0 | FLASH1 FEE_DATA_SECTION : {} > RAM #endif }
And this is my application linker script:
/*----------------------------------------------------------------------------*/ /* Linker Settings */ --retain="*(.intvecs)" /* USER CODE BEGIN (1) */ /* USER CODE END */ /*----------------------------------------------------------------------------*/ /* Memory Map */ MEMORY { VECTORS (X) : origin=0x00020020 length=0x00000020 //VECTORS (X) : origin=0x00000000 length=0x00000020// VECTORS (X) : origin=0x00020020 length=0x00000020 FLASH0 (RX) : origin=0x00020040 length=(0x001FFFE0-0x00020020) FLASH1 (RX) : origin=0x00200000 length=0x00200000 STACKS (RW) : origin=0x08000000 length=0x00003500 //STACKS (RW) : origin=0x08000000 length=0x00001500 RAM (RW) : origin=0x08040000 length=(0x00080000-0x00040000) } /*----------------------------------------------------------------------------*/ /* Section Configuration */ SECTIONS { .intvecs : {} > VECTORS /* discomment only for debug purposes */ .text : {} > FLASH0 | FLASH1 .const : {} > FLASH0 | FLASH1 .cinit : {} > FLASH0 | FLASH1 .pinit : {} > FLASH0 | FLASH1 .bss : {} > RAM .data : {} > RAM .sysmem : {} > RAM FEE_TEXT_SECTION : {} > FLASH0 | FLASH1 FEE_CONST_SECTION : {} > FLASH0 | FLASH1 FEE_DATA_SECTION : {} > RAM }
As you can see, application starts at 0x00020040, I have few doubts:
1) Bootloader vectors are defined at 0x00000000, once I jump to app are redefined at 0x00020040, using memory browser when debugging I can see that's correctly written into flash . Do I need to change vectors somewhere else a part of linker script?
2) I thought about interruptions not being enabled, but in my code, there is an initialization where interruptions are being enabled:
- sciEnableNotification(...)
- rtiEnableNotification(...)
- _enable_IRQ()
I don't know what I'm missing, but it seems to be related to me adding bootloader, any idea on what can be the reason for ISR not working?
Greetings,