2025-01-22 11:01 PM
Using the STM32F030RC, the program that originally ran at 0x800000 was moved to 0x8020000. After the move, SysTick_Handler() is no longer executed, causing HAL_Delay() to fail. Has anyone encountered this issue before?
Solved! Go to Solution.
2025-01-24 03:59 AM
Quick-and dirty solution:
change RAM base in linker script from 0x20000000 to 0x200000c0, change size to the original size -192.
2025-01-22 11:13 PM
It's not an issue - it's normal behavior. There are many threads on this topic under the "F0 bootloader" keywords. You need to relocate vector table to RAM, which requires some modifications to linker script and adding 3 lines of code to your program or to the bootloader. Just find and read these threads.
2025-01-23 11:51 PM
I added that copy ISR table to SRAM and solve HAL_Delay() issue。
But new issue comes that some varible content is corrupted, below is my code
main(){
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
MX_I2C2_Init();
MX_TIM3_Init();
MX_TIM6_Init();
MX_TIM14_Init();
MX_TIM16_Init();
MX_USART1_UART_Init();
MX_TIM17_Init();
/* USER CODE BEGIN 2 */
/* 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. */
uint32_t *ISR_address;
ISR_address = ISR_DATA_AREA;
for(i = 0; i < 48; i++)
{
*(ISR_address+(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();
// NVIC_EnableIRQ(SysTick_IRQn);
// __enable_irq();
O_USART2_DIR = 0; //when USART2 initial, prepare for Rx
printf("Application Target %d:%d Started!!!\r\n", APP_Version[0],APP_Version[1]);
...
}
the APP_Version[]'s value is corrupted.
2025-01-24 03:59 AM
Quick-and dirty solution:
change RAM base in linker script from 0x20000000 to 0x200000c0, change size to the original size -192.
2025-01-26 10:20 PM
Thanks a lot!!!