cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L433RBT6 with CudeIDE, the program jump to somewhere else if enable interrupt or stuck at HAL_init()

JFung.1
Associate II

I am using the STM32L433RBT6 for some uart communication project.

My pcb only have STM32L433RBT6, LDO, LED, UART related circuit.

I am also using the Nucleo-L433RC-P (STM32L433RCT6 )for the development.

The Nucleo-L433RC is working fine for the LED4 and uart.

However, STM32L433RBT6 did not work on my pcb.

Therefore, I have create a simple LED switching program to test both hardware.

Only enable some GPIO and the Timebase Source set as TIM1 or TIM6 (Both tested and result are the same)

CODE:

int main(void)

{

 /* USER CODE BEGIN 1 */

 __disable_irq();

 /* USER CODE END 1 */

 /* MCU Configuration--------------------------------------------------------*/

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */

 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();

 /* USER CODE BEGIN 2 */

 __enable_irq();

 while (1)

 {

  HAL_GPIO_TogglePin(LED_AC_GPIO_Port,LED_AC_Pin);    // For STM32L433RBT6 prototype board

  HAL_GPIO_TogglePin(LED_RS485_GPIO_Port,LED_RS485_Pin); // For STM32L433RBT6 prototype board

  HAL_GPIO_TogglePin(LD4_GPIO_Port,LD4_Pin);       // For Nucleo-L433 board

  HAL_Delay(500);

 }

 /* USER CODE END 2 */

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

 while (1)

 {

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

 }

 /* USER CODE END 3 */

}

The STM32L433RBT6 board is not working.

If without __disable_irq(), it wouldn't pass through the HAL_Init()

If with __disable_irq() and without __enable_irq(), it could go to HAL_Delay() and loop forever

If with __disable_irq() and with __enable_irq(), it will become "Break at address "0x1fff2dba" with no debug information available, or outside of program code."

Nucleo-L433RC-P is working fine of above code and the LED4 could blinking properly.

With and without __disable_irq() both are fine.

What's wrong could make this situation?

1 ACCEPTED SOLUTION

Accepted Solutions

Make sure BOOT0 is pulled low in your design, otherwise it will boot unreliably.

Make sure SystemInit() sets the Vector Table address into SCB->VTOR

For Flash the base should be 0x08000000

If splitting a loader and app, make sure the app builds at the address expected, and that the vector table gets set to whatever that address is.

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

View solution in original post

5 REPLIES 5
Bob S
Principal

0x2fff2dba [EDIT: 0x1fff2dba] is in the ST bootloader. What do you have connected to the BOOT0?

Make sure BOOT0 is pulled low in your design, otherwise it will boot unreliably.

Make sure SystemInit() sets the Vector Table address into SCB->VTOR

For Flash the base should be 0x08000000

If splitting a loader and app, make sure the app builds at the address expected, and that the vector table gets set to whatever that address is.

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

N/C that why it could not boot up correctly.....

Now I change the nSWBOOT to uncheck and problem solved😅 .

Since the PCB already made and BOOT0 is N/C, I have change the nSWBOOT to uncheck.

Also I have enable the macro of SCB->VTOR with zero offset for the test program.

Later I have change to bootloader and App program, they are working properly.

For this BOOT0 N/C issue, my expectation is either it jump to somewhere or boot successfully.

However the reality is it will bootup but some unexpected interrupt will make the PC jump to somewhere else and it is not stable

Thanks for your support 👍

Thanks for your support 👍