cancel
Showing results for 
Search instead for 
Did you mean: 

On STM3220G eval CAN network example fails in HAL_CAN_Transmit()

sapana_khemkar
Associate II
Posted on December 15, 2017 at 02:52

Hi

I have two STM3220G evl boards. I want to have CAN communication between these two boards.

I am running standard CAN network example provided in STM32Cube_FW_F2_V1.6.0.

Jumper settings are as below

JP3 - 2 and 3 (CAN1)

JP10 - 2 and 3 (CAN1)

JP9 - connected to enable load register

CAN cable used is

https://esd.eu/sites/default/files/manuals/CAN-Cable_Datasheet_en_0.pdf

Below are my observations

1. Some times demo works as expected

2. Most of the times HAL_CAN_Transmit() fails and return timeout error. When I check CAN message using logic analyzer I observed that it is showing NAK. Why CAN controller sending NAK? Is there any extra configuration required?

3. Some times HAL_CAN_Transmit() is successful but no receive interrupt on another board.

Has anyone observed same behavior?

Is there any bug in HAL library or issue with my setup? I read on community that F4 HAL had same issue in V1.6 but it has been fixed in V1.7.

Appreciate views and comments.

Thanks in advance.

Sapana

#stm32cube_fw_f2_v1.6.0 #stm3220-g-eval
4 REPLIES 4
AvaTar
Lead
Posted on December 15, 2017 at 08:14

Have you checked the CAN signal with a scope ?

> 1. Some times demo works as expected

This sounds like no proper bus termination.

Have you checked the CAN error counters of both nodes ?

PS: Where is the 'Quote' symbol in the editor gone ????

At least I have all-important emoticons ...

Imen.D
ST Employee
Posted on December 27, 2017 at 14:59

Hello,

We would inform you that there is a plan to rework HAN CAN driver 

in our future releases.

Thank you for your contribution.

Kind Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on December 28, 2017 at 05:34

Thanks Imen for your response.

Can you please help to fix current issue?

When are you planning next release?

Sapana

T J
Lead
Posted on December 28, 2017 at 21:54

make sure you have different message IDs coming from different boards.

do you have a dongle ?

I purchased a CanDo unit, set it to transmit every 10mS, and worked on the receiver first.

then I worked on the transmitter.

from memory, NAK is implying that you have bus contention ( a message ID issue)