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.

    This topic has been closed for replies.
    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

    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

    mƎALLEmAnswer
    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