2024-02-21 01:13 AM - edited 2024-02-21 01: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.
2024-02-22 01: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.
2024-02-21 01:18 AM - edited 2024-02-21 01:20 AM
Hello,
You need to provide more details:
Thank you.
2024-02-21 01:29 AM - edited 2024-02-21 01: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
2024-02-21 01:40 AM - edited 2024-02-21 01: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?
2024-02-21 01:49 AM - edited 2024-02-21 01: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?
2024-02-21 01:59 AM - edited 2024-02-21 02: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?
2024-02-21 02: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.
2024-02-21 02:21 AM
Hmm well..
And if you connect RS pin of the transceiver directly to the GND not over a 4.7K resistor?
2024-02-21 02:34 AM - edited 2024-02-21 02: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.
2024-02-21 02:37 AM - edited 2024-02-21 02: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.