cancel
Showing results for 
Search instead for 
Did you mean: 

How work HAL with CAN?

ESilv
Associate

I'm learning about CAN with stm32, currently I'm using a STM32F3 discovery, the Cube MX, freeRTOS and VS Code. I created a project for CAN, calculated the S1 and S2 from 8MHz processor, enabled automatic wake-up, Receive FIFO and Transmit FIFO. Then I generated the code using freeRTOS as _weak and I set it up all pre-defineds fields, but when I go work in my task the function can.h doesn't enable function as HAL_CAN_GetRxMessage(), HAL_CAN_AddTxMessage() and HAL_CAN_GetTxTimestamp().

So how solve this problem?

3 REPLIES 3

>>So how solve this problem?

Perhaps break it into simpler pieces you can manage better?

The CAN functions will depend on defines in stm32f3xx_hal_conf.h and adding the underlying library source files to your project.

Get the CAN examples from the EVAL series boards ported over and test those.

>> Cube MX, freeRTOS and VS Code

Triple Crown of fun there, I don't think there are many experts on the forum covering all those.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I think about use the stm32f3xx...h but, I believe that the cube generated function.c with these library include. If I do later any new modification and generate new codes, my work wiil be erased. I want understand which things I'm doing wrong or if this is a bug of Cube Mx.

About VS Code is just a IDE more, for me, trustworthy than the eclipse for C and C++ code.

Put the code you're working on in a sandbox, and run CubeMX into a different directory/project from which you can merge to the sandbox.

CubeMX is used in limited fashion by those who participating here. The HAL examples tend to at least have some testing done on them. The ST examples tend to focus on board and hardware combination that exist in the ST universe, so will have CAN only for the EVAL boards where the transceiver hardware is present.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..