cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_CAN_AddTxMessage() contains problems

Ukazu
Associate III

Hi

 

I am using CAN in STM32F303RDT6.

I am using HAL_CAN_AddTxMessage for CAN transmission.

This function will send the data and return HAL_OK if the sending mailbox is free.

However, although HAL_CAN_AddTxMessage returns HAL_OK, no message may actually be output on the CAN bus.

I am using CANoe to monitor a CAN bus.

 

My application has a queue that stores outgoing messages that I create. The application writes outgoing data to the queue at any time.

The data retrieved from the queue is input to HAL_CAN_AddTxMessage. When HAL_OK is returned, it is assumed that the data has been sent and the next queue data is retrieved.

 

However, even though HAL_OK is returned, there are times when it is not output to the CAN bus. This is a problem.

Please tell me any countermeasures.

 

Help Me.....

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ukazu
Associate III

Hi

 

The problem was resolved by setting bit 4 of the CAN_MCR register to 0.

I think that if you are using CAN, the initial value of bit4 should be "0".

View solution in original post

2 REPLIES 2
Ukazu
Associate III

Hi

 

The problem was resolved by setting bit 4 of the CAN_MCR register to 0.

I think that if you are using CAN, the initial value of bit4 should be "0".

Ash1
Associate II

Hi UKAZU

I need your help same I am trying to send two different CAN ID ,.

Can you help me ?

B.R

Ashish