cancel
Showing results for 
Search instead for 
Did you mean: 

In STM32F030CCT6TR Cortex-M0 series microcontroller,when the pointer jumps from bootloader project to Application project ,no interrupts are being raised in application project even after the initialization and interrupt functions are enabled.

TShet.2
Associate III

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.

13 REPLIES 13

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).

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TShet.2
Associate III

Can you provide me with a example code to remap the interrupt vector to RAM for STM32F0 Cortex M0 controller.

STM32Cube_FW_F0_V1.10.0\Projects\STM32091C_EVAL\Applications\IAP\IAP_Binary_Template\Src\main.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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...
    */
....

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..