Skip to main content
Visitor II
October 7, 2024
Solved

Simulink code generation support for STM32F407G-Disc1 CAN Bus with LL driver

  • October 7, 2024
  • 3 replies
  • 1343 views

I have an STM32F407G discovery development kit. We are embedding the software into this kit entirely using Embedded Coder through Simulink. We needed to use CANBUS to transfer the data we read from the board to the computer (via MATLAB). However, when CANBUS is activated through CubeMX, only the HAL library can be selected as a library, and the LL library cannot be selected. When generating code suitable for the board with MATLAB, code generation can only be done if the LL library is selected. We request your support in solving this issue. We would appreciate it if you could help.

Best answer by mƎALLEm

Hello @can_taac and welcome to the community.

Not sure what you are looking for. 


@can_taac wrote:

However, when CANBUS is activated through CubeMX, only the HAL library can be selected as a library, and the LL library cannot be selected.


To my knowledge there is no CAN LL driver:

Please refer to Drivers\STM32F4xx_HAL_Driver\Src path: there is no LL driver for CAN in the form of stm32f4xx_ll_can.c


@can_taac wrote:

 code generation can only be done if the LL library is selected. 


How? there is no CAN LL driver as stated previously!

For Simulink requests, better to submit your request in Mathworks forum on this link:

https://www.mathworks.com/hardware-support/stm32.html

or 

https://www.mathworks.com/matlabcentral/answers/index

3 replies

STTwo-32
Technical Moderator
October 7, 2024

Hello @can_taac and welcome to the ST Community.

For this implementation, I suggest you contact Matlab community that is the responsible of the Matlab implementation on the STM32 MCUs.

Best Regards.

STTwo-32

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.
mƎALLEm
mƎALLEmBest answer
Technical Moderator
October 7, 2024

Hello @can_taac and welcome to the community.

Not sure what you are looking for. 


@can_taac wrote:

However, when CANBUS is activated through CubeMX, only the HAL library can be selected as a library, and the LL library cannot be selected.


To my knowledge there is no CAN LL driver:

Please refer to Drivers\STM32F4xx_HAL_Driver\Src path: there is no LL driver for CAN in the form of stm32f4xx_ll_can.c


@can_taac wrote:

 code generation can only be done if the LL library is selected. 


How? there is no CAN LL driver as stated previously!

For Simulink requests, better to submit your request in Mathworks forum on this link:

https://www.mathworks.com/hardware-support/stm32.html

or 

https://www.mathworks.com/matlabcentral/answers/index

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Andrew Neil
Super User
October 8, 2024
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.