cancel
Showing results for 
Search instead for 
Did you mean: 

Why CAN Bus (J1939) of STM32F405RGT is not working at vehicle's J1939 speed(250kbps) ?

vishwakarma
Associate II

i am making a J1939 data logger with STM32F405RGT. The vehicle's J1939 is transmitting data on 250kbps, but when i set250kbps in mcu it doesnot show any data on uart terminal , but when i set 500kbps in mcu then it shows some data on UART terminal.

I am using STM32CubeIDE and generated code using CubeMX. The Same firmware that has CAN configured at 250kbps receives data from a CAN Simulator.

6 REPLIES 6

Are you sure J1939 is compatible with CAN?

JW

It basically is - J1939 is based on CAN.

> ... but when i set250kbps in mcu it doesnot show any data on uart terminal ,

What is that supposed to mean ?

CAN and UART/RS232 are definitely not compatible.

I am using UART Only for debugging purpose....

I have configured CAN Receive Interrupt and in Interrupt Handler i am transmitting that data back to UART so that I can see it.

> The vehicle's J1939 is transmitting data on 250kbps, but when i set250kbps in mcu it doesnot show any data on uart terminal , but when i set 500kbps in mcu then it shows some data on UART terminal.

Any relation between CAN baudrate and UART baudrate seems contrived, and is only caused by your firmware.

Did you check the CAN lines with a scope ?

You should at least have a CAN adapter for your PC, in listen-only mode.

i have another board than has STM32F446RE ..same firmware work perfectly with the vehicle. getting proper RPM, coolant temperature , cruise control status at 250kbps

You don't try to run the very same firmware/binary on two substantially different MCUs, do you ?