STM32 Hang unewpectedly (NVIC suspected)
- June 24, 2020
- 4 replies
- 1288 views
Hello,
I've designed a board based on an STM32F091CBU.
I needed CAN bus support, one SPI and one I2C and a timer interrupt.
When I tested my program, it hanged during the initialization of the IMU (an LSM6DSM) due to HAL_delays I ordinary set between SPI messages (paranoïd habit I must admit).
I've read on this forum that HAL_delay could hang due to a bad NVIC priority parameter. So after some tries, I decided to get rid of HAL_delays and the program was finally able to finish initialisation of the IMU. Then I activate an Interuption on a GPIO to know when data is available.
The program was supposed to send CAN frames every second through a CAN-PHY component so I've linked a CAN shield from seedstudio to it to monitor what is happening there. Dead silence.
After some checks with breakpoints, I discovered that my program never go inside the infinite loop. I've checked every peripherial interrupt handler with breakpoints and no-one seem to be called. And I suppose that my NVIC priorities could be responsible for that.
I would be very happy if someone could check my NVIC priorities and tell me if I did wrong.
Thank you.