I have an application, without OS, which works well alone. So I think I have set necessary interrupt enable. But after being integrated with bootloader provided by third party, normal functions work well but interrupt became not work. I have relocated VTOR in cstart.s as following:
/****************************************************************************/
/* Settings */
/****************************************************************************/
#define ROM_START (0x00076000) /* ROM start address (align = 32) */
#define ROM_END (0x0007EFFF) /* ROM end address (align = 32) */
#define STACK_SIZE (0x1000) /* Stack size in byte */
/****************************************************************************/
/* System stack */
/****************************************************************************/
PUBLIC __stack_top
SECTION .stack:DATA:REORDER:ROOT(8)
DATA
__stack_btm:
DS8 STACK_SIZE
__stack_top:
/****************************************************************************/
/* C startup */
/****************************************************************************/
PUBLIC __iar_program_start,__program_start
EXTWEAK __iar_init_core
EXTWEAK __iar_init_vfp
EXTWEAK __iar_data_init3
SECTION .text:CODE:REORDER(2)
THUMB
/*----------------------------------*/
/* Entry */
/*----------------------------------*/
__iar_program_start:
__program_start:
cpsid i
ldr r0 , =__stack_top
mov r13, r0
ldr r0 , =ROM_START
ldr r1 , =0xE000ED08 /* VTOR */
str r0, [r1, #0]
FUNCALL __program_start, __iar_init_core
bl __iar_init_core
....
The linker.icf is as following:
define memory mem with size = 4G;
define region IROM_region = mem:[from 0x00076410 to 0x0007efff]; // Code Flash
define region EROM_region = mem:[from 0x10000000 to 0x1000ffff]; // Data Flash
define region ERAM_region = mem:[from 0x14000000 to 0x14000fff]; // Flex RAM
define region IRAM_region = mem:[from 0x1fff8000 to 0x1fffffff] // SRAM_L
| mem:[from 0x20000000 to 0x20006fff]; // SRAM_U
initialize by copy { rw };
do not initialize { section .noinit, section .stack };
place at address mem:0x00076000 { ro section .intvec, ro section .trmval };
place at address mem:0x00076400 { ro section .flscfg };
place in IROM_region { ro };
place in EROM_region { ro section .dflash };
place in IRAM_region { first block CSTACK { section .stack }, rw };
place in ERAM_region { rw section .flxram };
I doubt the new vector is not recognized or there is setting in bootloader that effect interrupt enable, is anyone can give me some hints?