Hi,
I have a main program and a bootloader. Originally I had the main program so that it started at address 0x00000000 and everything worked fine (running ucos ii). I then changed the linker file so that the vectors started at 0x00020000 instead of 0x00000000, but now if I try to download and run the main app it hangs when it needs to access interrupts (I can step through some code until the scheduler needs to be run).
What modifications do I need to make in order for this to work?
Thanks,
David
Linker file
(main app)
--retain="*(.intvecs)"
/*----------------------------------------------------------------------------*/
/* Memory Map */
MEMORY
{
VECTORS (X) : origin=0x00020000 length=0x00000020
FLASH0 (RX) : origin=0x00020020 length=0x0011FFE0
STACKS (RW) : origin=0x08000000 length=0x00003500
RAM (RW) : origin=0x08003500 length=0x0002cb00
}
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
.text : {} > FLASH0
.const : {} > FLASH0
.cinit : {} > FLASH0
.pinit : {} > FLASH0
FEE_TEXT_SECTION : {} > FLASH0
FEE_CONST_SECTION : {} > FLASH0
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
FEE_DATA_SECTION : {} > RAM
}
sys_intvecs.asm
(main app)
.sect ".intvecs"
.arm
;-------------------------------------------------------------------------------
; import reference for interrupt routines
.ref _c_int00
.ref OS_CPU_ARM_ExceptUndefInstrHndlr
.ref OS_CPU_ARM_ExceptSwiHndlr
.ref OS_CPU_ARM_ExceptPrefetchAbortHndlr
.ref OS_CPU_ARM_ExceptDataAbortHndlr
.ref OS_CPU_ARM_ExceptIrqHndlr
.ref phantomInterrupt
.def resetEntry
;-------------------------------------------------------------------------------
; interrupt vectors
resetEntry
b _c_int00
b OS_CPU_ARM_ExceptUndefInstrHndlr
b OS_CPU_ARM_ExceptSwiHndlr
b OS_CPU_ARM_ExceptPrefetchAbortHndlr
b OS_CPU_ARM_ExceptDataAbortHndlr
b phantomInterrupt
b OS_CPU_ARM_ExceptIrqHndlr
ldr pc,[pc,#-0x1b0]
;-------------------------------------------------------------------------------
Linker file (bootloader)
--retain="*(.intvecs)"
/*----------------------------------------------------------------------------*/
/* Memory Map */
MEMORY
{
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH_API (RX) : origin=0x00000020 length=0x000014E0
FLASH0 (RX) : origin=0x00001500 length=0x0001EB00
STACKS (RW) : origin=0x08000000 length=0x00003500
RAM (RW) : origin=0x08003500 length=0x0002cb00
}
/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
flashAPI :
{
--library= F021_API_CortexR4_BE.lib (.text)
} load = FLASH_API, run = RAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
.text : {} > FLASH0
.const : {} > FLASH0
.cinit : {} > FLASH0
.pinit : {} > FLASH0
FEE_TEXT_SECTION : {} > FLASH0
FEE_CONST_SECTION : {} > FLASH0
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
FEE_DATA_SECTION : {} > RAM
}
sys_intvecs.asm (bootloader)
.sect ".intvecs"
.arm
;-------------------------------------------------------------------------------
; import reference for interrupt routines
.ref _c_int00
.ref phantomInterrupt
.def resetEntry
;-------------------------------------------------------------------------------
; interrupt vectors
resetEntry
b _c_int00
undefEntry
b undefEntry
svcEntry
b svcEntry
prefetchEntry
b prefetchEntry
dataEntry
b dataEntry
b phantomInterrupt
ldr pc,[pc,#-0x1b0]
ldr pc,[pc,#-0x1b0]