Skip to main content
Associate II
September 12, 2023
Solved

MCU shutting down during SPI communicaiton

  • September 12, 2023
  • 6 replies
  • 6588 views

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 ?

Stoufer_0-1694538436110.png

 

This topic has been closed for replies.
Best answer by Stoufer

Resolved!  BOOT0 was left unconnected. Set it as input and tied to GND and everything is workin ggreat!

Thanks!

6 replies

StouferAuthor
Associate II
September 12, 2023

Stoufer_0-1694538619195.png

two bytes sent .. then ... it dies

 

Issamos
Lead III
September 12, 2023

Hello @Stoufer 

I suggest you to  change the CS pin. If the problem persist,try using another SPI interface.

Best regards.

II

 

TDK
September 12, 2023

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
StouferAuthor
Associate II
September 13, 2023

Stoufer_0-1694617665871.png

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....

Pavel A.
Super User
September 12, 2023

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... ?)

StouferAuthor
Associate II
September 13, 2023

I am using a ST-Link

TDK
September 13, 2023

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
StouferAuthorBest answer
Associate II
September 13, 2023

Resolved!  BOOT0 was left unconnected. Set it as input and tied to GND and everything is workin ggreat!

Thanks!