2025-10-12 4:10 PM
The board has passed a authentication test so I currently believe it is a me issue.
I have been trying to get a CAN bus going using the STM32 Blue Pill board with a TJA1050 CAN Transceiver, but for some reason even with basically copy pasted example code I don't even get activity on the lines. The transceiver modules I am using has the CAN bus terminating resistors built in resulting in a 60ohm resistance between the H and L lines. I've ended up putting together a basic test Tx and Rx bread board in hopes of figuring out whats going on with no clues. The Tx loop eventually goes dead for some reason which makes me think the HAL_addTx started locking up. Linked is a github repository with both projects. Also a video of the boards.
2025-10-15 4:33 PM
Loopback has worked on at least one board type before. As soon as go into debug mode it runs what seems like half a loop and dies. I got the HiLetGo boards and they do the same. Can I get someone else to test the project on a known genuine board too. I should be getting CANTx data with just the board nothing else but I don't get anything on now 4 board variants. I think I am going to order genuine chips and swap them in. Maybe bluepill diagnostics just made fakes better. I have tried multiple code projects, boards, connections, data analyzer/scopes. I think I am getting nothing but non genuine boards.
2025-10-15 5:27 PM - edited 2025-10-15 5:29 PM
Just added Loopback to the Tx Test on GitHub and they seem to be failing. The peripheral is manually set to loopback with mx. There only is one chip that visually seems distinctly authentic. On the HiLetGo board but still it didn’t pass anything. Also in programmer they all show up the same 0x410 and Version X which isn't marked on any chip.
2025-10-15 6:42 PM
I should be getting CANTx data with just the board nothing else
Not exactly sure what you mean here but you need at least a 2nd working node with the same baud rate connected to the node that is transmitting.
You more than likely have a hardware issue.
Is Bluepill Tx going to TJA1050 Tx and Rx to Rx?
Is pin#8 (S) pin grounded on the TJA1050?
2025-10-15 7:09 PM - edited 2025-10-15 7:10 PM
For the loopback to work and capture the sent message, you have to turn on the CAN RX0 Interrupt:
Your latest GitHub code works for me, on my Blue Pill after selecting the interrupt.  A message is sent and my breakpoint inside the HAL_CAN_RxFifo0MsgPendingCallback() is hit.
As @Karl Yamashita pointed out, I'd double check to make sure that the pins are attached correctly.
STM32 CAN: Loopback Mode + Filter Setup Guide 
Kindest regards
2025-10-15 8:58 PM
After turning on the interrupt they pass the loop back test. Were you able to run it in normal and get can data being transmitted? My pins are wired accordingly. PA11 to TJA Rx, PA12 to TJA Tx, GND to TJA GND, 5v to TJA VCC. I believe I should be able to run a scope or analyzer and see a change in flow even before a nack can occur, with nothing attached while probing PA11 and PA12.
2025-10-15 9:01 PM
I am using a module for the TJA1050 so I am not 100 percent but it should be done correctly. I believe I should be able to run a scope or analyzer and see a change in flow even before a nack can occur, with nothing attached while probing PA11 and PA12.
2025-10-16 5:27 AM
If I switch back to normal mode, changing nothing else, messages are being pushed onto the bus:
In normal mode, removing the TJA1050 and connecting PA11 and PA12 directly to the logic analyzer doesn't work for me, it immediately fails in the call to HAL_CAN_Start(&hcan).
If loopback is working for you, that would mean the Blue Pill is okay. Maybe an issue with the TJA1050? Do you have others of those you can swap out?
Kindest regards
2025-10-16 5:33 AM
Thanks, that clears up a misunderstanding I had about how the data tries to flow. I have not tried different TJA1050 modules since I don’t have them on hand but i just ordered some that have good reviews and they should be waiting for me after work.
2025-10-26 6:38 AM
I’ve determined it is not because of non genuine chips. Bought some from mouser and replaced it. Still has the same activity. I plan on setting up CAN on another microcontroller to see if I can determine where my issue is. I may provide a wiring diagram soon.