2023-03-15 12:21 AM
The Interrupt vector table for both the Bootloader and the Application Project are shared at 0x800000 register location,but when code pointer jumps to Application project the interrupt vector still remains at 0x800000 and the application project has no access to it. Can you please explain how to move interrupt vector location at the start of Application Project Location.
2023-03-16 09:19 AM
The STM32F030 is a Cortex-M0 *not* an M0+, so it doesn't have a SCB->VTOR register.
The vectors will need to be copied into the front of RAM (0x20000000), and then the RAM mapped/shadowed at ZERO (0x00000000).
2023-03-16 11:24 PM
Can you provide me with a example code to remap the interrupt vector to RAM for STM32F0 Cortex M0 controller.
2023-03-17 07:35 AM
STM32Cube_FW_F0_V1.10.0\Projects\STM32091C_EVAL\Applications\IAP\IAP_Binary_Template\Src\main.c
2023-03-17 07:40 AM
On the receiving/application side
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define APPLICATION_ADDRESS (uint32_t)0x08004000
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
#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
/* Private functions ---------------------------------------------------------*/
/**
* @brief Main program
* @param None
* @retval None
*/
int main(void)
{
uint32_t i = 0;
/* STM32F0xx HAL library initialization:
- Configure the Flash prefetch
- Systick timer is configured by default as source of time base, but user
can eventually implement his proper time base source (a general purpose
timer for example or other time source), keeping in mind that Time base
duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
handled in milliseconds basis.
- Low Level Initialization
*/
HAL_Init();
/* Configure the system clock to 48 MHz */
SystemClock_Config();
/* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/
/* Copy the vector table from the Flash (mapped at the base of the application
load address 0x08004000) to the base address of the SRAM at 0x20000000. */
for(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();
/* Add your own code here...
*/
....