2023-07-28 09:00 AM
Hello,
I am trying to build a bootloader project using STM32F030CCT6TR cortex -M0 controller.
I have copied the interrupt vector table from start of the Flash location(0x08000000) to to RAM in both Bootloader and Application Project.
I am getting the interrupts after jumping to the Application project but the HAL_Delay() function is not working.
It was working fine in Bootloader.
Does HAL_Delay Tick function has a separate isr vector routine in the flash and does it also need to be copied to the RAM to working Application Project.
Here is the code that I have used to copy isr vector from flash to RAM.
In the Main file:
/* USER CODE BEGIN PD */
#define VECTOR_TABLE_SIZE (31 + 1 + 7 +9)//31 positive vectors, 0 vector, and 7 negative vectors (and extra 9 i dont know why)
#define SYSCFG_CFGR1_MEM_MODE__MAIN_FLASH 0 // x0: Main Flash memory mapped at 0x0000 0000
#define SYSCFG_CFGR1_MEM_MODE__SYSTEM_FLASH 1 // 01: System Flash memory mapped at 0x0000 0000
#define SYSCFG_CFGR1_MEM_MODE__SRAM 3 // 11: Embedded SRAM mapped at 0x0000 0000
#define ETX_APP_FLASH_ADDR 0x08008000 //Application's Flash Address
/* USER CODE END PD */
/* USER CODE BEGIN PV */
volatile uint32_t __attribute__((section(".ram_vector,\"aw\",%nobits @"))) ram_vector[VECTOR_TABLE_SIZE];
extern volatile uint32_t g_pfnVectors[VECTOR_TABLE_SIZE];
/* USER CODE END PV */
2023-07-28 09:17 AM
The SysTick handler needs to increment the appropriate variable in order for HAL_Delay to work. Do you call HAL_InitTick anywhere? Usually it's called in HAL_RCC_ClockConfig.