SPI Master causing Hardfault #59227
Replies: 5 comments 8 replies
-
@FRASTM, @gautierg-st Does this ring any bell ? |
Beta Was this translation helpful? Give feedback.
-
As additional information, I have checked the same code on Nucleo WB55RB. I just run it with no additional testing but it seems to work fine. |
Beta Was this translation helpful? Give feedback.
-
Seeing that it seems to work fine on another board, have you checked the errata sheet for STM32L412? |
Beta Was this translation helpful? Give feedback.
-
Just a tiny comment, you shouldn't have to give any tx buffers in spi_master_read_values() and any rx buffers in spi_master_write_values(). Just pass NULL in spi_transceive_cb relevantly. |
Beta Was this translation helpful? Give feedback.
-
Any new thoughts? Maybe it should be transformed into an issue? I could not find the reason for the fault. I suspect that stack was somehow corrupted (that would explain why errors differ depending on what data corrupted the stack), but I cannot find the source of the corruption. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, community,
I am writing a multi-board system that will communicate using SPI. To simplify the problem let's assume I have two boards (master and slave) running Zephyr.
I am facing a significant problem of hard fault on the master's side (during the debugging the slave is disconnected to separate the master).
The communication scheme looks like that:
(Cmd from master [write/read/...]) -> (1ms for the slave to prepare/execute) -> (Actual transaction )
Hard faults are happening on the actual transaction and stop happening if between Command and Transfer is at least 4ms.
I need to understand what is causing the fault and why changing timeout prevents hard faults (my code does not do anything in the meantime)
Sometimes logs show hard fault messages but not always and different values and types of hard faults are mentioned depending on nothing.
Could anyone find any potential flaws in my code or point me a way to debug those faults I will be thankful.
examples:
Board is Nucleo STM32L412RB
Here is my code (simplified as much as I could):
Beta Was this translation helpful? Give feedback.
All reactions