Page 1 of 1

FDCAN on STM32G431

Posted: Tue Jun 29, 2021 11:07 pm
by Apache
Hello,

I've been developping an application on nucleo f303k3 which implements bxCAN. I ported the code to nucleo g431 but I'm not able to get a CAN signal out of the chip (other peripherals work fine). It looks like an init or a config problem, because when I try to send a CAN frame I always get a MSG_OK, event when the board is not plugged to a tranceiver. I checked the clocks and they seem ok, (using pll clk1 as input of the peripheral). I checked the pins alternate mode, seems ok too. I noticed that the CANTxFrame struct is different in the FDCAN implementation but it should be retro-compatible from what I've seen. And now I don't know where to look

I'm not sure of what information would be needed to get help, if you want more info please tell me.

ps: I am using the latest commit of the stable 20.3 on the github mirror

Re: FDCAN on STM32G431

Posted: Wed Jun 30, 2021 4:11 am
by Giovanni
Hi,

The FDCAN is unfinished, there are patches to be added to it but I haven't had time to do that.

You may try to do that yourself, look at the end of this discussion: viewtopic.php?f=3&t=5122&start=80

Giovanni

Re: FDCAN on STM32G431

Posted: Wed Jun 30, 2021 8:15 am
by Apache
In this thread you said that FDCAN driver should be working with CAN 2.0 frames. That's what I'm trying to do but I can't get it working. I tried the patch made by mck1117, it fixes some things in the init but it's behaving in the same way. Maybe that's my config that doesn't work?

I used this

Code: Select all

CANConfig const canConfig = {
    .DBTP = 0x100C20,
    .CCCR = 0,
    .TEST = 0,
};

Re: FDCAN on STM32G431

Posted: Wed Jun 30, 2021 8:33 am
by Giovanni
Hi,

The driver has not been created by me, it is unfinished and untested so I cannot answer questions about it, try to post in the discussion thread I linked, people that are using it could answer there.

Giovanni

Re: FDCAN on STM32G431

Posted: Wed Jun 30, 2021 8:39 am
by Apache
Ok, thank you!