2018-02-01 12:39 PM
Hello!
The HAL CAN driver for the STM32F4 got reworked lately (december 2017). I try to port my code from the old to the new drivers (compatibility break). There is a brief driver description in the update history but it would be also very helpful to get some example code to speed up porting ;-). I did look up the Cube STM32F4 sample codes but it seems all the CAN samples got deleted (not yet developed?).... Also the HAL description is still version 5 and the new API is not yet worked in. Correct, or did I miss anything?
Cheers, Stefan
Solved! Go to Solution.
2018-07-05 10:20 AM
Hello guys,
will be update this CAN driver also on the STM32F1 firmware package?
Best regards,
Levs
2018-08-29 11:39 AM
Not sure about the STM32F1 but I have heard that STM32F0 is due the 17th week of 2019.
2018-09-12 06:34 AM
Hi !
One additional topic...
Filter configuration also changed a bit, what is the replacement for the "FilterNumber" ? And how can I change the interrupt priority. Could that be still done by HAL_NVIC_SetPriority(CAN2_RX0_IRQn...)?
Regards,
Dirk
2018-10-10 09:00 AM
Hello Szymon.
I'm struggling to find a very simple and up to date can example, just to see some activity on the Tx pin.
You are talking about a customers presentation just above, but what do you mean by "Please find it attached"? - I can't see any attachments anywhere.
Regards Allan
2019-04-10 01:28 PM
Hi Szymon!
I try the example on an stm32f103c8t6 and its working fine, but I cant change the filter config to "_IDLIST", Its simply not work anymore in any combination of the mask and id… May be I missed something...
Regards.
J.
2019-07-01 03:21 AM
Hi szja681.5541402147734006E12,
I began recently with Microcontroller and STM32 and I stumbled over the same issue.
If you are using a standard-ID ( CAN_TxHeaderTypeDef TxHeader; TxHeader.IDE = CAN_ID_STD;)
and Filterscale 32Bit (sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT;)
you have to shift FilterIDHigh and FilterMaskIdHigh by 5 Bits to the left.
E.g.
sFilterConfig.FilterIdHigh = 0x0123<<5;
sFilterConfig.FilterMaskIdHigh = 0x0123<<5;
This is IMO due to the register in the Tx Mailbox.
Here is picture from the STM32F103 Reference Manual .
As you can see the Std-Id is from [31:21].
If you don't shift the Filter ID the comparison will fail.
Because the STD-ID is left justified in the comparing Mailbox.
Here is a pic from the register Organisation.
Mapping is your Mailbox register.I hope this will help someone.
Pictures are taken from the reference manual and are not my property.
Greetings
Rene
2020-04-19 01:52 AM
Not sure if anyone is still looking for examples of the new HAL CAN driver like I was just this week. The in my opinion most useful yet simple example can be found here: