Skip to main content
NSing.5
Associate III
October 23, 2021
Solved

STM32F730 CAN LOOPBACK - not receiving

  • October 23, 2021
  • 2 replies
  • 1352 views

i'm using STM32F730 and trying to use CAN in LOOPBACK mode.

i'm using HAL_CAN for programming and STM32MXcube for configuration purpose.

The transmission is successful (TXOK0=1 and RQCP0=1) but i'm unable to observe any activity in receiver FIFO.

 

i have attached my code.

i have not configured any filters till now, as i'dont want to use them. is it necessary to configure them for receiver purpose.

 

plz guide me where i'm wrong. is there any problem with my bit timing. i have used 120ohm resistor at transreciever end.

 

if i switch to normal mode it results in TXOK0=0 and TERR0=1 and acknowledgement error code (03).

 

plz guide me, i'm stuck here with no breakthrough.

 

This topic has been closed for replies.
Best answer by NSing.5

Thanks all,

it was the filter initialization, which i have missed in my code. Basically , it was the FIFO assignment which was required and i have achieved using

  "canfilterconfig.FilterFIFOAssignment= CAN_RX_FIFO0;"

Thanks to the following online links, which proved useful

https://www.youtube.com/watch?v=NS3eeZPUDns

and

https://www.google.com/search?q=CAN+loop+back+mode&oq=CAN+loop+back+mode&aqs=chrome..69i57j0i13j0i13i30j0i5i13i30j0i8i13i30l2j0i8i10i13i30j0i390l2.5789j1j4&sourceid=chrome&ie=UTF-8#kpvalbx=_eux0YevxN9vorQG3kI2ICQ23

2 replies

NSing.5
NSing.5AuthorBest answer
Associate III
October 24, 2021

Thanks all,

it was the filter initialization, which i have missed in my code. Basically , it was the FIFO assignment which was required and i have achieved using

  "canfilterconfig.FilterFIFOAssignment= CAN_RX_FIFO0;"

Thanks to the following online links, which proved useful

https://www.youtube.com/watch?v=NS3eeZPUDns

and

https://www.google.com/search?q=CAN+loop+back+mode&oq=CAN+loop+back+mode&aqs=chrome..69i57j0i13j0i13i30j0i5i13i30j0i8i13i30l2j0i8i10i13i30j0i390l2.5789j1j4&sourceid=chrome&ie=UTF-8#kpvalbx=_eux0YevxN9vorQG3kI2ICQ23

NSing.5
NSing.5Author
Associate III
October 24, 2021

Now i've only one doubt that in normal mode, i'm getting TCOK0=0 and acknowledgement error, after transmission. why TCOK0=0? is it is because of acknowledgement error or transmission failed due to some reasons. i have attached my code for reference