2024-12-12 10:00 AM - edited 2024-12-12 10:00 AM
Hi,
I am trying to use a STM32G491KEU6 with FDCAN, but the communication is failing at line:
if (HAL_FDCAN_AddMessageToTxFifoQ(&hfdcan1, &TxHeader, TxData) != HAL_OK) { ...
I found out that this is a problem that receiver is not sending a ACK bit - cannot it be a software issue? I am using two STM32G491KEU6 with the same code mentioned bellow, while I am also using a TCAN3403DRBRQ1 transceiver on both boards.
The boards seems ok, I can even see a transmittion on the line with oscilloscope, but there is probably no ACK.
Thank you for any help
Solved! Go to Solution.
2024-12-15 01:35 PM
Ahh, I found the issue... CAN LOW differential had short circuit to GND - bad soldering. Thank you for your time.
2024-12-12 10:20 AM
Hello,
For CAN/FDCAN subject especially when using Normal mode you need to provide more details especially the HW part. So please share schematics.
Also, I recommend to use HSE with an external crystal instead of HSI.
As per your code:
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
2024-12-12 10:23 AM
2024-12-12 11:48 AM - edited 2024-12-13 12:41 AM
Hello,
Could you please share your ioc file?
Chenge FrameFormat to FDCAN_FRAME_CLASSIC;
Could you also please state on Y1? could you please share its datasheet?
2024-12-12 12:28 PM
Yeah, no prob.
Y1 should not be the issue - I am using a classic CAN with the same Y1 and STM32F446RET6 and it works as it should.
Datasheet: https://cz.mouser.com/datasheet/2/122/ecx_53b-3074848.pdf
2024-12-13 12:46 AM - edited 2024-12-13 12:48 AM
Ok,
But contrary to what I suggested earlier, here you are still using HSI:
And CAN mode :
-> Try to switch to Classic mode.
And also, are you sure the two nodes have the same config especially the bitrate?
2024-12-13 10:08 AM
Yeah,
I am using the same code on both devices so there should be a problem.
Anyway, I fixed what you recommended, but still the issue remains.
2024-12-15 06:11 AM
Hi
If You are using the TCAN3404-Q1 (from the schematics) You need to set the STB pin to low (internal pullup!)
If You are using the TCAN3403-Q1 (from the first post) then You have to put Pin 5 (Vio) to 3.3V
Martin
2024-12-15 09:58 AM
As I mentioned, I already did that on my PCBs with a wire - it did not help.
2024-12-15 01:35 PM
Ahh, I found the issue... CAN LOW differential had short circuit to GND - bad soldering. Thank you for your time.