Skip to main content
Associate II
September 5, 2024
Solved

Code jumping unexpectedly to 0xfffffffe

  • September 5, 2024
  • 1 reply
  • 1224 views

Hi, 

After successful coding, I suddenly stumbled on this error. I'm simply running this code:

 

 

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_DMA_Init();
 MX_I2C1_Init();
 MX_USART2_UART_Init();

 

 

 And at the point of  MX_USART2_UART_Init(); it crashes and goes to 0xfffffffe. Any guesses why? It seems like as soon as it tries to do something with the GPIO, it instantly crashes. First it seemed like my linker file offset was wrong, and after changing it worked again, but the next day it was just stuck again. Any guesses?

Edit: It's time related. A 10ms delay makes it crash instantly after the delay

Best answer by RBT-ES

Okay I was being ***. You need to change your start address in both your linker file, and in your sysmem file. Otherwise your vector table is located at the wrong place and results in hard fault.

1 reply

waclawek.jan
Super User
September 5, 2024

Which STM32?

What hardware, is it a "known good" board like Nucleo or Disco?

JW

RBT-ESAuthor
Associate II
September 5, 2024

Totally forgot to add this info. It's a STM32L452RE. It's resoldered on a nucleo l476rg board because we switched processors. I have two boards doing exactly the same. It should be my code that's faulty, because I also have a bootloader and that's running just fine.

RBT-ESAuthorBest answer
Associate II
September 5, 2024

Okay I was being ***. You need to change your start address in both your linker file, and in your sysmem file. Otherwise your vector table is located at the wrong place and results in hard fault.