Dispatch Bay

STM32 CAN Receives Nothing Debug

Symptom

Bay 2's commands are on the bus, but the terminal stays blank. The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: U1, an STM32F4, drives CAN TX on PA12 and reads CAN RX on PA11 through U2, a CAN transceiver, onto the CANH and CANL bus with a 120 ohm terminator R1 and R2 at each end, shared with the other nodes and watched by TP1, a CAN analyzer; PA9 carries USART1 TX to J1, a serial console

Pass condition

USART1 prints one line per frame for bay 2, standard IDs 0x120 to 0x127: ID:0x<id> DLC:<n> DATA:<bytes>, in hex. Other nodes' frames print nothing.

Expected output for the public case: four frames on the bus, 0x110 for bay 1, 0x121 with CA FE for bay 2, 0x3F0 for another node and 0x124 with 01 02 03 for bay 2; the serial console logs only the two frames for bay 2, in the order they arrived

Notes

Bay 2's commands share the bus with other nodes' traffic, all through the run. Bus at 500 kbit/s: CAN1_BTR = 0x00050003

Related challenges

Loading the interactive arena.