This repository contains the CANalyze firmware, which has been ported from the original implementation available at CANalyze to run on the STM32F072 microcontroller. You can use the Blue Pill board for testing by replacing the STM32F103 chip with an STM32F072. The reason for this replacement is that the STM32F103 does not allow simultaneous access to both USB and CAN peripherals.
Bring up CAN interface
$ sudo ip link set can0 up type can bitrate 500000
Sniff CAN messages
$ cansniffer -c can0
or dump all CAN messages
$ candump can0
Send a CAN message
$ cansend can0 666#01020304