2023-09-12 10:09 AM
I have a simple demo board with a STM32L451VET6, a SPI LCD and four switches. The board will send the first byte over SPI perfectly, then either during or right after sending the second byte - it appears the MCU shuts down - as the CS line drifts down to 0v and single stepping in the code it just stops stepping - no errors - no faults.
This is a minimal program with just two lines added to the auto-generated code.
Any Ideas ?
Solved! Go to Solution.
2023-09-13 01:53 PM
Resolved! BOOT0 was left unconnected. Set it as input and tied to GND and everything is workin ggreat!
Thanks!
2023-09-12 10:10 AM
two bytes sent .. then ... it dies
2023-09-12 10:47 AM - edited 2023-09-12 10:47 AM
Hello @Stoufer
I suggest you to change the CS pin. If the problem persist,try using another SPI interface.
Best regards.
II
2023-09-12 11:53 AM
Likely to be a hardware issue. Probe the NRST line, probably gets pulled low and holds the chip in reset. Look at power rails and ensure sufficient current capacity. Ensure power to chip is valid.
If you can show the schematic, please do.
2023-09-12 02:09 PM
> and single stepping in the code it just stops stepping - no errors - no faults.
The behavior when the target dies depends on the debugger. Which debugger do you use? (CubeIDE gdb, CubeIDE OpenOCD, Keil, IAR... ?)
2023-09-13 08:06 AM
I am using a ST-Link
2023-09-13 08:11 AM
Here is the schematic - and attached also.
I believe you are right about it being HW. I started a new project with just one GPIO pin toggling. It works when single stepping but if I let it run it runs for about a second and stops. I did find I had a couple 3.3V pins not connected and AGND was not connected to GND - fixed those thinking that was the trouble... but its still stopping. And I have tested on two boards - same bad behavior....
2023-09-13 08:43 AM
NRST is the problem! See trace below - yellow is GPIO bit toggling - it runs the same number of cycles every time I run it ( 51). The light Blue trace is NRST... now WHY is NRST going low ??? Is it something with my ST-Link ??
Here is the only code I added :
2023-09-13 08:58 AM
more clues... If I place a breakpoint on the first GPIO set statement above and run it ... It will run and break until I have see 24 sets of 2 toggles ( 48 )... then when I run it again - it locks up. No toggles and NRST goes low :
so it appears to be related to the number of instructions executed ? Almost like a WDT - but I dont have WDT setup unless there is something on by default... i have a 8Mhz crystal on board but have it configured for internal MSI RC @4000kHz.
Any suggestions ?
THANKS!!
2023-09-13 09:05 AM
Schematic looks fine.
> I did find I had a couple 3.3V pins not connected and AGND was not connected to GND - fixed those thinking that was the trouble
That was the trouble. Doesn't mean there aren't more issues. Check all connections to VDD and VSS. Show high resolution photos of the relevant solder joints.
Again, monitor 3.3V rail to see if it drops.