This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interrupt Vectors Bootloader & Main Application

How can I relocate or manage the transition between the bootloaders interrupt vector map and the applications interrupt vector map which will be at different addresses in FLASH. On the M3/M4, you can remap this but presumably on the M0, you cant. Is there a method I could use on the NRF51822?

Edit: We are not using soft devices (we are using proprietary software and protocols).

Ive written the bootloader software running on the NRF51822 which accepts and programs an image sent from a C++ application, and then using some assembler, loads the main image @ 0x8000. The only issue is how to tackle the problem of a non-relocatable vector table (unless I am mistaken) of the Cortex M0.

NXP and ST's Cortex M0 dont have a VTOR (vector table offset register) but they do have a remap register to set the vector table in SRAM. The vector table could then jump to the correct bootloader vector table (@ 0) or main application vector table (@ 0x8000).

If you could investigate if the NRF51822 offers any features/registers to enable relocation of the vector table I would be grateful, thanks.

Parents
  • If you are using a SoftDevice this function may be helpful to you:

    /**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice
     * 
     * This function is only intended to be called when a bootloader is enabled.
     *
     * @param[in] address The base address of the interrupt vector table for forwarded interrupts.
     
     * @retval ::NRF_SUCCESS
     */
    SVCALL(SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, uint32_t, sd_softdevice_vector_table_base_set(uint32_t address));
    

    If not, I need to investigate some more. Please let me know.

Reply
  • If you are using a SoftDevice this function may be helpful to you:

    /**@brief Sets the base address of the interrupt vector table for interrupts forwarded from the SoftDevice
     * 
     * This function is only intended to be called when a bootloader is enabled.
     *
     * @param[in] address The base address of the interrupt vector table for forwarded interrupts.
     
     * @retval ::NRF_SUCCESS
     */
    SVCALL(SD_SOFTDEVICE_VECTOR_TABLE_BASE_SET, uint32_t, sd_softdevice_vector_table_base_set(uint32_t address));
    

    If not, I need to investigate some more. Please let me know.

Children
Related