Hi everyone !
I am posting here because I am working on a small robot written in Rust with some friends.
The last few weeks we have been struggling with an error that we can not figure out... We are using a blue pill with an stm32f103, 20K of ram and 64K of flash.
We have a communication protocol that is implemented as a state machine, with some C in the middle to avoid duplication (the same code is reused in C++ for another part of the robot).
Here is the symptom :
- If we comment this line everything work fines
- If we leave it has is, the µ-controller goes into hardfault when we hit this line
This line is "just" matching on the value of a byte and the state of a state machine.
Stepping through the debugger shows this the instruction before crashing
Then we into hardfault, with a strange value for sp (0x1ffe3d50).
I have strictly no idea what could be the problem with this, if someone could help investigate this issue I would be really thankfull.
Thanks for you consideration and have a nice day !