Why does this go to error handler?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-01 2:07 AM - last edited on ‎2024-04-01 7:44 AM by mƎALLEm
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?
for reference I'm using the nucle-l433rc-p board.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-03 4:52 AM - edited ‎2024-04-03 5:23 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-01 2:23 AM
Change CubeMx Settings-->RCC-->HSE to 'Crystal/Ceramic Resonator'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-01 2:29 AM
Hello,
You are in HSE bypass mode.
Are you sure SB64 is soldered?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-02 8:06 AM
pretty sure it is. Any other ideas what may cause the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-02 8:20 AM - edited ‎2024-04-02 9:53 AM
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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-02 8:52 AM
Need to double check again SB64. Looks like not soldered.
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-03 3:53 AM
I've soldered SB64. Now the code is stuck in between two libraries. Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-03 4:02 AM
Not sure I understood what do you mean by:
the code is stuck in between two libraries. Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-03 4:27 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-04-03 4:41 AM
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:
A complex system designed from scratch never works and cannot be patched up to make it work.
