2023-12-23 03:14 AM
HI there, I have rewitten this simple piece of code from scratch multiple times with no success. I am just attempting to turn on a set of LEDs. First in the While Loop. Second in the interupt handler for TIM2. The chip is a STM32F411CCU in a homespun board.
Stack is
0x0
<Signal Handler Called>() at 0xfffffff9
0x7db68e2
<Signal Handler Called>() at 0xfffffff9
HAL_TIM_Base_Start_IT() Line 479
Main() Line 93
Any assistance I can get would be greatly appreciated.
Full files are attached.
Solved! Go to Solution.
2023-12-24 12:52 PM
> If I debug it (F6), it will die at HAL_TIM_Base_Start_IT
What does die mean?
Sounds like it may be swamped with interrupts. Hit pause, see where execution is at. Lower timer interrupt speed, etc.
2023-12-23 04:03 AM
Hi,
>STM32F411CCU in a homespun board
Is this your first test with this board? (ever working before?)
+ How you connect: st-link ? working?
+You have other boards with STM , maybe nucleo board ?
2023-12-23 04:38 AM
Provide schematic for what you actually built
Make sure BOOT0 is pulled low.
That VCAP pins have correct capacitors and measure 1.25 V there.
That Analogue supply pins are connected.
2023-12-23 04:54 AM
HI TEsla, Ascha,
Here is the relevant part of the Schematic. It is basically the STM32 chip, an FT201 on i2c, and a couple of test sensors on i2c. I dont have any i2c elements enabled at the moment as I am trying to narrow the problem down.
I am using an STLink/V2 to connect.
I have had it working on a number of occasions. But it has been very unreliable.
It successfully programmes it. If I debug it (F6), it will die at HAL_TIM_Base_Start_IT. If I Step into that function (F5), it will complete succesfully, but then dies on the next instruction HAL_GPIO_TogglePin. I cant work it out.
I am wondering if it has enough power...
2023-12-23 06:50 AM - edited 2023-12-23 06:52 AM
Here are the three most common sources of error on your PCB.
1. bad decoupling
2. poorly soldered connections
3. power supply with high noise or unstable under load
And, I think NRST pin should have a capacitor to GND. Usualy 100nF.
2023-12-23 07:30 AM
Since you've said it's a homespun PCB, I recommend testing the PCB. YOu can test it with a multimeter or make a PCB tester like this.
2023-12-23 01:21 PM
> if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
Try to increase number of flash wait states. FLASH_LATENCY_0 -> FLASH_LATENCY_8
2023-12-24 12:52 PM
> If I debug it (F6), it will die at HAL_TIM_Base_Start_IT
What does die mean?
Sounds like it may be swamped with interrupts. Hit pause, see where execution is at. Lower timer interrupt speed, etc.