I'm trying a couple of hours now to bringup my CAN communication and I think I need help..
I basically copied the ChibiOS_2.6.3/testhal/STM32F1xx/CAN project and I'm trying to get it working. Fact is that I'm not getting any data out of the tx/rx pin.
Hardware Setup:
- Board: Olimex Stm32-H103 (ChibiOS_2.6.3/boards/OLIMEX_STM32_H103/board.h)
- CAN Driver: MCP 2551
- CAN Dongle: cheap USB-CAN Dongle
What worked: CAN in loopback mode (CAN_BTR_LBKM)
Working behavioral: blinking led, for the receive part - everything's fine
Symptoms:
Nothing on the TX path, nothing on the RX side either.
What I'v tried:
- playing around with CANConfig cancfg ... various constellations
- checking the mcp2551 datasheet for 3.3V compatibility ... is compatible
- checking the receive path of the CAN-Dongle -> MCP2551 -> STM32F103 via an oscilloscope ... looked good
- palSetPadMode(...) explicite setting before canStart(...) ... did nothing
- Checking canTransmit(...) returnCode results see below ... don't know how it should look like
debug msg in the tx/canTransmit path returned the following
Code: Select all
bringing up CAN, now at state: 1
sending CAN msg returned rc: 0, can state: 3, tx_empty_before: 1
sending CAN msg returned rc: 0, can state: 3, tx_empty_before: 1
sending CAN msg returned rc: 0, can state: 3, tx_empty_before: 1
sending CAN msg returned rc: -1, can state: 3, tx_empty_before: 0
sending CAN msg returned rc: -1, can state: 3, tx_empty_before: 0
sending CAN msg returned rc: -1, can state: 3, tx_empty_before: 0
sending CAN msg returned rc: -1, can state: 3, tx_empty_before: 0
sending CAN msg returned rc: -1, can state: 3, tx_empty_before: 0
I hope this is not overwhelming... please help..
Best, Nick