2025-12-07
9:49 PM
- last edited on
2025-12-09
5:40 AM
by
Lina_DABASINSKA
Dear STM32 Support Team,
I am working on implementing CAN communication using the standard SAE J1939 protocol on an STM32-based platform and would like your guidance.
Could you please suggest:
Recommended STM32 example projects or application notes for J1939 over CAN.
Any official STM32Cube examples, middleware, or partner stacks for J1939.
Best practices for configuring the CAN peripheral (bitrate, filters, extended ID usage) specifically for J1939 on STM32.
Recommended approach for reading GPIO inputs (three switches) and mapping them to different J1939 messages or PGNs.
I am happy to provide details about my MCU part number, board, and current code if needed. Your support would be very helpful for moving this feature to completion.
STM board: STN32F207ZG
Thank you in advance for your assistance.
Best regards,
Suman Uppala
2025-12-08 12:00 AM - edited 2025-12-08 12:11 AM
Hello,
ST doesn't offer such kind of stacks but one of our partners Emotas offers J1939 stack for STM32. Please refer to this link. So please contact Emotas: https://www.emotas.de/en/contact
You may find an open source implementation (ST doesn't guarantee the implementation): like this one:
https://github.com/ttnickb/Open-SAE-J1939-STM32
See also this thread.
Hope that helps.
2025-12-08 2:39 AM
Hello ST Team,
I'm looking for guidance on integrating J1939 CAN communication. Could you please share examples showing the proper J1939 protocol frame format for sending data to other devices?
The provided link contains many files, but I'm unsure which ones are relevant for STM32 implementation.
Thank you!!
With Regards,
SUMAA UPPALA
2025-12-08 2:45 AM
Hello @sumanuppala,
I've already answered the question. No example provided for J1939 by ST. We don't support that. Only ST partners are offering such kind of stacks. So please contact our partner Emotas as suggested in my previous post.
I can support you with CAN protocol not for its stacks.
Thank you for your understanding.
2025-12-08 8:12 PM
Dear STM32 Community,
Could you please help me with sending CAN data from one node to another using STM32F207ZG?
In my application, I want to:
Use the on‑board switch of the STM32F207ZG board
Connect an external TTP224B touch sensor module as additional switches
When switch 1 is pressed, display/send a “LOW” level
When switch 2 is pressed, display/send a “MEDIUM” level
When switch 3 is pressed, display/send a “HIGH” level
If you have any example projects, code snippets, or configuration guidelines for STM32F207 CAN communication and reading TTP224B inputs, it would be very helpful.
Thank you in advance for your support.
Best regards,
Suman Uppala
2025-12-08 10:18 PM
There are basic CAN examples available for every MCU variant coming with a CAN peripheral.
I didn't work with F20x variants yet, but picking one family I frequently us at random (the F303), there are four examples: CAN_Loopback, CAN_Networking, CAN_DualFIFO, and CAN_FIFOExtension.
Go with a networking example, it is exactly the setup you have.
> If you have any example projects, code snippets, or configuration guidelines for STM32F207 CAN communication and reading TTP224B inputs, it would be very helpful.
The CAN example delivers the first.
For the sensor, there are hundreds of different sensors available for any kind. You can't expect a MCU pacakge to come with an example for everyone of them. You might need to adapt another peripheral example, and consult the sensor datasheet.
J1939 is quite specific protocol stack used in the automotive industry, especially trucking and agricultural machines.
The are no hardware-specifics beside of CAN, so you can take examples or protocol stacks from any platform you find useful.
2025-12-09 2:37 AM
Any links please I didn't get proper one.
2025-12-09 2:41 AM - edited 2025-12-09 2:43 AM
@sumanuppala wrote:
Any links please I didn't get proper one.
https://github.com/STMicroelectronics/STM32CubeF2/tree/master/Projects/STM322xG_EVAL/Examples/CAN
No CAN stack used.
+ Knowledge base articles:
Using CAN (bxCAN) in Normal mode with STM32 microcontrollers (Part 1)
Using CAN (bxCAN) in Normal mode with STM32 microcontrollers (Part 2)
2025-12-09 2:54 AM
You might also take a look at this demo, posted by @Gretchev not so long ago:
Simple Classic CAN + FreeRTOS Demo simulating OBD and a vehicle.
2025-12-09 3:00 AM
@sumanuppala wrote:guidelines for STM32F207 CAN communication and reading TTP224B inputs
As @Ozone said, you can't expect to find every single possible combination of comms protocols, sensors, etc.
You need to consider these things separately - take a modular approach: