Alright… So I had a good chunk of time to play with this again tonight and I still cannot get my intended message out, or receive a message.
I have removed all CAN interrupts, and buffers. I have also initialized the RCC, GPIO, CAN, CAN Filters using the STM Standard Peripheral Drivers.
So the drivers are getting very simple.
I can still send out a message, but the ID and data are incorrect. If I change baud rate then I get error frames until I change my receiver to the new baud rate then I see the exact same message again.
I have also played around with my CAN transceiver in case that has issues. I have another one on the way from amazon.
If there is anyone out there that want to try and test this for me please grab my code and try it. It should transmit a message once per second. It should also print the latest rx message on the USB serial.
source is located here:
go to:
firmware\main>
run this command while in DFU mode:
make clean all -s PLATFORM=photon COMPILE_LTO=n APP=can MODULAR=n PARTICLE_DEVELOP=1 program-dfu
uses D1 for CAN_RX
uese D2 for CAN_Tx
You need a CAN transceiver to get CAN_Hi and CAN_Low for the CAN Bus.
The CAN transmit message is currently hard coded. So if your seeing valid data you cannot change it via Can1.write;
This is the message I am getting:
ID=0x1FFFFEFF Extended RTR Data=0x0F
I am trying to send:
ID=0x1234 Extended NoRTR Data= 1, 2, 3, 4, 5, 6, 7, 8