cancel
Showing results for 
Search instead for 
Did you mean: 

Why does this go to error handler?

Mr4
Associate III

Hi! I have a code that is supposed to develop CAN-bus communication, but these two functions go straight to error handler. Any suggestions why that might be?

Mr4_0-1711961684256.png

for reference I'm using the nucle-l433rc-p board.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

Reproduced the issue.

R19 (100ohm) needs to be soldered too to connect MCO output from ST-Link to the HSE OSC_IN of your MCU.

SofLit_0-1712144975606.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

13 REPLIES 13
Passerby
Associate III

Change CubeMx Settings-->RCC-->HSE to 'Crystal/Ceramic Resonator'

SofLit
ST Employee

Hello,

You are in HSE bypass mode.

Are you sure SB64 is soldered?

SofLit_0-1711963737275.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Mr4
Associate III

pretty sure it is. Any other ideas what may cause the problem?

 

 

Failing Why? Because HSE clock not present, PLL not running/locking from the selected source.

Can you observe an 8 MHz clock signal at the pin/solder bridges?

SB64 isn't bridged in your picture, but SB68 / SB70 are, with a zero ohm. There's solder paste but it's not bridging the two islands. You might need to add more and wet it across the pads.

You'd need to bridge SB64, and clear the bridging on SB68/SB70, so that the 8 MHz from the ST-LINK is passed.

You also have ALL the source code, you can inspect what's actually causing the routines to return an error. Do some debugging.

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

Need to double check again SB64. Looks like not soldered.

20240402_170351.jpg

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Mr4
Associate III

I've soldered SB64. Now the code is stuck in between two libraries. Any ideas?

Mr4_0-1712141530509.png

Mr4_1-1712141627055.png

 

Not sure I understood what do you mean by:

 

the code is stuck in between two libraries. Any ideas?

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Mr4
Associate III

I used the "step into" function to see where the code breaks. I unfroze

if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) and stepped inside it. And that's where the code (in between the libraries) just loops around. I can click step into countless of times, and it keeps going back and forth these two. Did i make sense here?

 

 

That's a wait loop with a timeout - so it will keep going around.

Try putting breakpoint(s) at the place(s) it would reach after exiting that wait loop.

Please use this button to properly post source code - rather than screenshots:

AndrewNeil_0-1712144468317.png