cancel
Showing results for 
Search instead for 
Did you mean: 

CANFD configuration with CAN 2.0 devices

__silardg
Associate III

I am using CANFD with an STM32H7 and a transceiver that is compatible with CANFD and CAN 2.0 (ISO1044BDR).

I can see that in the configuration the CANFD can be used as a CAN 2.0. 

What I want to know is what is the easiest way to integrate the flexibility between choosing of using CANFD or CAN 2.0 in my project. I'm planning on using a DIP switch to signal the MCU what I'm using. 
Or is there a way to keep the CANFD code and communicate with other CAN 2.0 devices - probably not as the packet is not the same and other parameters... 

The second question here is can I include both functionalities (CAN 2.0 and CANFD) and choose it at run time which one I want to use?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

I don't know... this is what you want to do.

The MCU needs to know which mode will take as config, in your case with a switch, it could be something else, an information coming from the GUI or whatever. Changing from a mode to another needs to re-init the module. But as I've already said I don't see the reason to change it at run time

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
SofLit
ST Employee

Not sure I understood what do you want to do. Do you want to mix CAN2.0 and CANFD frames on the same bus?  you can refer to the attached documents about mixed network topology between CAN2.0 and CANFD. 

"I can see that in the configuration the CANFD can be used as a CAN 2.0. "

Yes indeed.

I don't see a reason to switch at runtime between CANFD and CAN2.0 on the same bus.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

The device I'm developing should be able to communicate on a CANFD OR CAN 2.0. The same interface should be used (FDCAN1). This would be set with a DIP switch and the MCU on setup would choose what to use. 

I don't want to change the firmware depending on what kind of application (CANFD or CAN 2.0) I need, that is why I would like to set it up via a DIP switch. 

I understand that there is no hardware modification, only the firmware configuration. 

I also have FDCAN2 available, is it a better option to setup CANFD on one and CAN 2.0 on the other and just use a DPDT switch to select which I need? 

To make it fully clear. I want to use CANFD or CAN 2.0 on the bus. Not at the same time, but depending on the application I would choose one or the other. On the other side of the bus I would have a device that is compatible. 

Do you want to setup the CAN peripheral according to your switch position at the startup but doesn't change during the communication and still at that config until the next reset?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Yes, I don't plan changing it during run time. Set it up depending on the switch and use it until the next reset where the switch may change. 

Yes indeed you can do that.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
__silardg
Associate III

Okay, but is that the simplest and easiest way to do this? 

I don't know... this is what you want to do.

The MCU needs to know which mode will take as config, in your case with a switch, it could be something else, an information coming from the GUI or whatever. Changing from a mode to another needs to re-init the module. But as I've already said I don't see the reason to change it at run time

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.