Skip to main content
EZöll.1
Associate
January 21, 2020
Question

I believe I have found an error in the HAL. Where and how can I report it?

  • January 21, 2020
  • 7 replies
  • 1359 views

I am getting a CAN message with the function `HAL_CAN_GetRxMessage`.

The struct `CAN_RxHeaderTypeDef` has a field called `RTR`.

The doc string says: "This parameter can be a value of @ref CAN_remote_transmission_request".

`CAN_remote_transmission_request` consists of two macros:

   #define CAN_RTR_DATA               (0x00000000U) /*!< Data frame  */

   #define CAN_RTR_REMOTE             (0x00000002U) /*!< Remote frame */

The received CAN message, however, has a RTR value of 1 because it is shifted by `CAN_RI0R_RTR_Pos` to result in a boolean value.

When sending the message with `HAL_CAN_AddTxMessage` it is checked with `assert_param(IS_CAN_RTR(pHeader->RTR));` that RTR is indeed either `CAN_RTR_DATA` or `CAN_RTR_REMOTE` and not 1.

This topic has been closed for replies.

7 replies

Ozone
Principal
January 21, 2020

> Where and how can I report it?

Here, as you did.

I'm not aware that ST opened up a channel to their bug tracking tool for users.

Not even fully convinced they have one ... ;)

Olivier GALLIEN
ST Technical Moderator
January 21, 2020

​Hi @Erik Zöllner​ 

Thanks for your post.

There's 3 ways to report a bug to ST :

BR,

Olivier

In order 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.
Bob S
Super User
January 21, 2020

That probably should be https://my.st.com/OLS (with a period between "my" and "st").

Olivier GALLIEN
ST Technical Moderator
January 21, 2020

​Yes right. Thanks to highlight the typo.

Olivier

In order 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.
Mike_ST
ST Technical Moderator
January 22, 2020

Hello,

What MCU family ?

When you say:

>> The received CAN message, however, has a RTR value of 1 because it is shifted by `CAN_RI0R_RTR_Pos` to result in a boolean value.

Where do you see that ?

I can only see that in the legacy HAL files for F0/F3.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
EZöll.1
EZöll.1Author
Associate
January 22, 2020

@Mike_ST​ 

We are using the STM32 F765VG.

We have generated the code with Cube MX 5.4.0.

We are not aware that there would be a newer HAL. How could we get that?

In file Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_can.c in function `HAL_CAN_GetRxMessage` line 1559 is

pHeader->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR) >> CAN_RI0R_RTR_Pos;

Mike_ST
ST Technical Moderator
January 23, 2020

>> We are not aware that there would be a newer HAL. How could we get that?

No, there is no newer HAL, I just mean that in the HAL there is a Legacy directory where older version are stored.

It seems that it has been patched on F0/F3 family:

F0 legacy folder: pRxMsg->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[FIFONumber].RIR) >> CAN_RI0R_RTR_Pos;

F0:  pHeader->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR);

Same on F3:

F3:  pHeader->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR);

F3 legacy folder: pRxMsg->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[FIFONumber].RIR) >> CAN_RI0R_RTR_Pos;

And there is no shift in other family. So without being a CAN expert, I think there is something wrong too.

Ticket entered.

Thank you.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.