2016-06-09 01:58 AM
Hello there,
I am using STM32F4. I am trying to configure can peripheral the way that when messages are received, they pass through 2 filters. If filter 0 matches they go to FIFO0, if filter 1 matches they should be stored in FIFO1. Is this possible? A for now I have a problem with can busy flag- Im am trying to turn rx interrupts to work for FIFO0 and FIFO1, like this:HAL_CAN_Receive_IT(canHandle, 0);
HAL_CAN_Receive_IT(canHandle, 1);
The problem is that after the 1st line of code is executed, the can status is set to HAL_CAN_STATE_BUSY_RX so the second one doesnt work.
What is the proper way of making this idea work? 2 different filters, 2 different FIFO's, 1 can peripheral. I would really appreciate all help.
2017-01-19 10:06 AM
Dear @Users,
I would inform you that the reported issue about
HAL_CAN_Receive_IT() function
missed to get FIFO Number parameter is already fixed in the last release of STM32CubeF4.Thank you for bringing this issue to our attention and all your feedback are welcome.
Regards
Imen
2017-01-19 01:00 PM
DAHMEN.IMEN
Do you mean what I written in the post above about just setting the FIFO flag or is the FMI issue fixed as well?2017-01-20 06:47 AM
Hello @
Przenioslo.Lukasz
,Sorry for this quite late answered about your reported FMI isssue.This is highlighted internally andI will come back to youas soon as I have update on this.
We are sorry for the inconvenience and thank you for your comprehension.
Regards
Imen
2017-03-08 09:23 AM
Hi Lukasz Przenioslo,
After
deep check, we
do not observe the FMI issue reported and
the following line in CAN_Receive_IT() works fine:
hcan->pRxMsg->FMI = (uint8_t)0xFFU & (hcan->Instance->sFIFOMailBox[FIFONumber].RDTR >> 8U);
It correctly extract the FMI (Filter Match Index) applicable to the message received, from the RDTR register.
So, i
n both cases of FIFO0 and FIFO1 usage, t
he FMI obtained is not always 0, it depends on the programmed filters.
For that, I suggest you check the values of CAN_RDT0R and CAN_RDT1R in debug mode when you are expecting value different of 0.
P
lease refer to your Reference Manual, in the CAN chapter, 'Filter Match Index' paragraph for more clarification on how FMI (in RDTR register) is computed by Hardware:
The index value of the filter number does not take into account the activation state of the filter banks. In addition, two independent numbering schemes are used, one for each FIFO.
Imen
2017-03-13 01:58 AM
I seem to have stumbled upon the same issue: In HAL_CAN_RxCpltCallback I cannot see what fifo caused the receive.
I can get this working by adapting CAN_Receive_IT such that it copies the FIFONumber into the hcan-pRxMsg->FIFONumber before it calls HAL_CAN_RxCpltCallback.
I updated Cube last friday (and boy do I regret having done that, but that's for another thread)
CubeMX version: 4.20.0
Library version: L4_V1.7.0
For now I stick to adapting the 'library' myself..
2017-10-02 05:58 AM
@jonker.hans
I do have the same problem. How can I found out if I have to read from pRxMsg, or pRxMsg1 from the HAL_CAN_RxCpltCallback.
@STM dev. Any ideas? I think there is something missing in the architecture.
many thanks.
cheers
mathias