2017-03-16 03:04 AM
Ithink this could be a silly question, but I would like to clarify with any doubt type.
I'm working with HAL_CAN for the stm32L4. I'm developing a fw in a sw layer where I can configure CAN controller, filter banks, reset, send and receive, etc.. I'm configuring can data and remote frames format and I would like to know
if error frames and overhead frames must be also generated from user code or if it's a job for the STM32 under layers level (low level drivers)?
It's said, if my node has recived and error frame or if it has detected an error, the answer error frames from my node are they generated automatically, or must I do some code a part in order to generate an error frame?
How must my code deal with can error frames?
are these error frames keeping under HAL_CAN drivers? Does this layer some treatment of error/overload frames?
Thanks in advance.
#hal_can #stm32l4 #can #error-frames #overload #error-interrupts2017-03-21 03:00 AM
Error frames are generated by the hardware. Once an error has been detected then, if your error interrupts are enabled the callback will be executed:
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan)
{
if( hcan->Instance == CAN1 )
{
osSemaphoreRelease(can_tx_semHandle);
// Or do whatever you need, report, led, terminal.....
}
}�?�?�?�?�?�?�?�?
2017-03-22 08:41 AM
Thank you Richard, this was the same way I was thinking to follow. But I also need I was understanding it correctly.
Regards.
2017-03-23 02:55 AM
Hi, Richard;
two doubts regarding the propper way of doing it, I don't know if you or someone could suggest something useful about the following questions, I hope it can be:
ust I enable them, once again after transmit/receive_It interruptions being detected?
So, would be there, another moment in which I also must disable this error interruption flags?Thanks in advance.