pazi88 / STM32_CAN

CAN bus Library for Arduino STM32
GNU General Public License v3.0
67 stars 28 forks source link

Using enableSilentLoopBack() crashes F303 #31

Closed dxx-223 closed 5 months ago

dxx-223 commented 5 months ago

Silent loop-back is very useful for local debugging.

See attached files. You can tell it has crashed as the serial output stops. Sample serial output:

17:52:54.993 -> Serial logging started!
17:52:54.993 -> CAN setup: PA11/PA12 + XCVR
17:52:54.993 -> CAN setup: loopback + silent modes enabled
17:52:54.993 -> CAN setup: 500Kb rate
17:52:54.993 -> CAN setup: filter target 0x07E0, mask 0x07F0
17:52:54.993 -> Delaying before entering main loop...
17:52:58.003 -> CAN 

Changing can->write(CAN_outMsg_2) to can->write(CAN_outMsg_2, true) seems to mitigate the issue. Interrupt conflict? Ring buffer conflict / corruption?

Also, I can't seem to ever receive the transmitted messages via loop-back - any ideas there?

STM32F303K8T, STM32 MCU library v2.6.0, STM32_CAN v1.1.1, F303 fix in hal_conf_extra.h

STM32_CAN-test.zip

dxx-223 commented 5 months ago

OK so this turned out to be memory mismanagement on my part!