2020-08-01 10:36 AM
I'm currently using a STM32F030CC and i need a Bootloader and Main App structure. The problem is that i can't find in system_stm32f0xx.c constant VECT_TAB_OFFSET to change. Also SCB->VTOR is missing. I'm currently using SMT32CUBEIDE v1.4.1. Any ideeas ?
Solved! Go to Solution.
2020-08-01 10:40 AM
Not as easily done on the Cortex-M0 as it is on the -M4 as the VTOR register doesn't exist.
https://community.st.com/s/question/0D50X00009XkXhTSAV/stm32f0-cortex-jump-to-application
2020-08-01 10:40 AM
Not as easily done on the Cortex-M0 as it is on the -M4 as the VTOR register doesn't exist.
https://community.st.com/s/question/0D50X00009XkXhTSAV/stm32f0-cortex-jump-to-application
2020-08-01 11:35 AM
And for the most robust and simple architecture combine the vector table relocation with this design:
2020-08-02 10:38 AM
Seems that i'm missing something since it doesn't work...
My bootloader is working ok (tested with a led on at start of main app, which is off in bootloader)
In my main app i added :
#if (defined ( __CC_ARM ))
__IO uint32_t VectorTable[48] __attribute__((at(0x20000000)));
#elif (defined (__ICCARM__))
#pragma location = 0x20000000
__no_init __IO uint32_t VectorTable[48];
#elif defined ( __GNUC__ )
__IO uint32_t VectorTable[48] __attribute__((section(".RAMVectorTable")));
#endif
and in my main function between SystemClock_Config(); and MX_GPIO_Init(); i added:
for(int i = 0; i < 48; i++)
{
VectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
}
/* Enable the SYSCFG peripheral clock*/
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* Remap SRAM at 0x00000000 */
__HAL_SYSCFG_REMAPMEMORY_SRAM();
Then in STM32F030CCTX_FLASH.ld i changed this lines:
/* Memories definition */
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K
FLASH (rx) : ORIGIN = 0x8008000, LENGTH = 110K
}
But my project isn't running, it stopped when i called HAL_UART_Receive_DMA(&huart1, dma_buff[0].data, sizeof(dma_buff[0].data));