Other Parts Discussed in Thread: MSPM0G3507, , UNIFLASH, SYSCONFIG
Tool/software:
Hi,
I have modified secondary_bsl_can_LP_MSPM0G3507_nortos_ticlang demo for MSPM0G3107. It is working fine. But, from the secondary bootloader how can I change PC to the starting address of the application code which is not 0x00000000.
I have tried with the below snippet by feeding it the start address of the application, which is mentioned in https://www.ti.com/lit/pdf/slaae88. But, it is not working.
/*! Jumps to application using its reset vector address */
#define TI_MSPBoot_APPMGR_JUMPTOAPP() {((void (*)()) (*(uint32_t *)(APP_AREA_START_ADDR + 4)))
();}
I have also tried the below API which is mentioned in boot_application_LP_MSPM0G3507_nortos_ticlang demo. But, it is not working.
static void start_app(uint32_t *vector_table)
{
/* The following code resets the SP to the value specified in the
* provided vector table, and then the Reset Handler is invoked.
*
* Per ARM Cortex specification:
*
* ARM Cortex VTOR
*
*
* Offset Vector
*
* 0x00000000 ++++++++++++++++++++++++++
* | Initial SP value |
* 0x00000004 ++++++++++++++++++++++++++
* | Reset |
* 0x00000008 ++++++++++++++++++++++++++
* | NMI |
* ++++++++++++++++++++++++++
* | . |
* | . |
* | . |
*
* */
/* Reset the SP with the value stored at vector_table[0] */
__asm volatile(
"LDR R3,[%[vectab],#0x0] \n"
"MOV SP, R3 \n" ::[vectab] "r"(vector_table));
/* Set the Reset Vector to the new vector table (Will be reset to 0x000) */
SCB->VTOR = (uint32_t) vector_table;
/* Jump to the Reset Handler address at vector_table[1] */
((void (*)(void))(*(vector_table + 1)))();
}
Thank you





