Some of CAN packet have trouble.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 1:13 AM - edited ‎2024-02-21 1:20 AM
Hello.
I am developing CAN communication protocols using STM32F429.
However there is a problem in sending CAN frame data.
Here is a picture which I captured in CAN TX using logic analyzer, and as you can see, the series of data is losted after first data.
I tested this with publishing 100Hz, this problem occurred once a minute.
In normal case, it should be like this.
And also I add my code for helping to understanding.
__disable_irq();
motorCANTxMailBox = HAL_CAN_GetTxMailboxesFreeLevel(&hcan1);
HAL_CAN_AddTxMessage(&MTRL_CAN, &motorCANTxHeader, &motorCANTxData[0], &motorCANTxMailBox);
__enable_irq();
I disabled the non-automatic retransimission and enabled automatic bus-off feature.
But I wonder why the retransimission did not occur.
Solved! Go to Solution.
- Labels:
-
CAN
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-22 1:18 AM
I found a trouble in my system.
I had added one more CAN Slave which received the data frames from the STMF4 board, and this was the reason why the CAN BUS didn't work.
After I eliminated this board, the system worked well.
Thank you so much for looking into my problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 1:18 AM - edited ‎2024-02-21 1:20 AM
Hello,
You need to provide more details:
- Your HW: which board? Your own HW or ST board?
- If possible schematics
- Bus configuration, used transceivers.. termination resistors etc ..
- What is the system clock source you're using: HSE or HSI?
- Are you seeing some acknowledgement for the send messages?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 1:29 AM - edited ‎2024-02-21 1:35 AM
Thank you for your fast answer.
This is my own board.
Firstly, here is the schematic about CAN
The clock source is HSE and it provide 45Mhz to APB.
I set up the configuration like below.
Add :
I disabled the non-automatic retransmission and enabled automatic bus-off feature.
But I wonder why the retransmission did not occur.
and attach another packet loss below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 1:40 AM - edited ‎2024-02-21 1:41 AM
What is connected in the other side of the bus? does it have the same bitrate config 100kb/s?
What is the purpose of R23/C21 and R24/C22? it was the recommendation in DS transceiver?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 1:49 AM - edited ‎2024-02-21 1:50 AM
1What is connected in the other side of the bus? does it have the same bitrate config 100kb/s?
- Another ST custom board is connected in the other side. and also have 100kb/s.
2 What is the purpose of R23/C21 and R24/C22? it was the recommendation in DS transceiver?
- I mimicked a breakout board in Internet.
here is an example.
I just captured it in CAN TX, would it affect the signal TX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 1:59 AM - edited ‎2024-02-21 2:05 AM
Hello,
I don't recommend any HW schematics except the one provided by the transceiver's manufacturer.
So if this is not the case, if possible to disconnect these components from the bus.
Is JP1 is fitted?
Do you see any activity on CAN_H and CAN_L?
Could you please provide the CAN config of the other board? is it the same custom board? same FW? same system clock?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 2:18 AM
OK, I'll try your solution to eliminate those things.
I can see CAN_H and CAN_L activated.
Here is a moment when the error occur. I could not analyze this because my gadget don't have the feature in CAN H and L.
Mostly, the packet was well sending. Not every time, sometimes it happens.
Another device is STM32G0 which is also a custom board. it dose not same FW compared to above board.
So, it use CAN FD. below is the information about this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 2:21 AM
Hmm well..
And if you connect RS pin of the transceiver directly to the GND not over a 4.7K resistor?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 2:34 AM - edited ‎2024-02-21 2:39 AM
OK. I will try it and post the result later.
However, is it those situation affect the CAN_TX? The problem take place in the CAN_TX which is located between ST MCU and the transceiver.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 2:37 AM - edited ‎2024-02-21 2:40 AM
Please check my points before.
Also share your two projects: STM32F429 and STM32G0 (at least the ioc files) so I can look at them later.
