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.

RM46L852: Issue regarding jump from Bootloader to application

Part Number: RM46L852
Other Parts Discussed in Thread: HALCOGEN

We have a bootloader at 0x00 location. and application starting at oxc000. After successfully flashing the application, we are jumping to the application code from bootloader as given below :

((void (*)(void))0xc000)();

We are able to jump successfully to the application code as we can see the debug messages from application. but whenever we are starting RTI counter using rtiStartCounter(0) the system resets. FYI, We are not using rti in bootloader.

Below is the application linker file :

VECTORS (X) : origin=0x0000C000 length=0x00000020
RESERVED (R) : origin=0x0000C020 length=0x000000E0
FLASH0 (RX) : origin=0x0000C100 length=0x00033EFF

application sys_intvecs.asm :

.sect ".intvecs"
.arm

;-------------------------------------------------------------------------------
; import reference for interrupt routines

.ref _c_int00
.ref _dabort
.ref _irqDispatch
.ref phantomInterrupt
.def resetEntry

;-------------------------------------------------------------------------------
; interrupt vectors

resetEntry
b _c_int00
undefEntry
b undefEntry
svcEntry
b svcEntry
prefetchEntry
b prefetchEntry
b _dabort
b phantomInterrupt
b _irqDispatch
ldr pc,[pc,#-0x1b0]

Bootloader linker :

VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH_API (RX) : origin=0x00000020 length=0x000014E0
FLASH0 (RX) : origin=0x00001500 length=0x0000AAFF

bootloader sys_intvecs.asm :

.sect ".intvecs"
.arm

;-------------------------------------------------------------------------------
; import reference for interrupt routines

.ref _c_int00
.ref _dabort
.ref phantomInterrupt
.def resetEntry

;-------------------------------------------------------------------------------
; interrupt vectors

resetEntry
b _c_int00
undefEntry
b undefEntry
svcEntry
b svcEntry
prefetchEntry
b prefetchEntry
b _dabort
b phantomInterrupt
ldr pc,[pc,#-0x1b0]
ldr pc,[pc,#-0x1b0]

Please help.

  • We have updated the bootloader sys_intvecs.asm as follows :

    ;*****************************************************************************
    .sect ".intvecs"


    ;-------------------------------------------------------------------------------
    ; import reference for interrupt routines

    .ref _c_int00
    .ref _SVC

    ;-------------------------------------------------------------------------------
    ; interrupt vectors
    ; Please change the #0x???? for your specified image location defined in bl_config.h

    b _c_int00 ;0x00
    b #0xBFF8 ;0x04
    b #0xBFF8 ;0x08, Software interrupt
    b #0xBFF8 ;0x0C, Abort (prefetch)
    b #0xBFF8 ;0x10, Abort (data)
    reservedEntry
    b reservedEntry ;0x14
    ldr pc,[pc, #-0x1b0] ;0x18
    ldr pc,[pc, #-0x1b0] ;0x1C

    still we are stuck at the same issue. FYI we are not using any interrupt in bootloader. Please help
  • FYI
    we have safety functions enabled in our main application at startup. But as far as we can debug, code execution passes these tests but gets stuck at rtiStartCounter(0)
  • Hello Vijayendra,

    I am forwarding your post to one of our boot loader experts. They should be able to have a look at your setup to where the problem lies.
  • Thanks Chuck. Just to update you :
    our application resets after few instructions and the control goes to prefetchentry. at this point we can see CP15_DATA_FAULT_STATUS=0x0000409 .
    I believe this is due to ECC error.
    While flashing application through bootloader we have taken care of auto ecc generation using the following :
    Fapi_issueProgrammingCommand((uint32_t *)DestinationAddress, (uint8_t *)SourceAddress, (uint32_t)BytesToWrite, 0, 0, Fapi_AutoEccGeneration);
    Please advise.
  • as said earlier, the reset might not be due to rti interrupt, it might be due to ECC.
  • Hello Vijayendra,

    Please change the interrupt vector for IRQ in your application sys_intvecs.asm:

    Change: b _irqDispatch

    to: ldr pc, [pc, #-0x1b0]

    Any use the RTI ISR generated through teh HALCoGen.

    The LDR instruction load the memory at ‘PC - 0x1B0’, which is ‘0x18 + 0x08 - 0x1B0 = 0xFFFFFE70’. This is the address of IRQVECREG, which store the pending ISR address.