cancel
Showing results for 
Search instead for 
Did you mean: 

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.

NSing.5
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
NSing.5
Senior

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

View solution in original post

2 REPLIES 2
NSing.5
Senior

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
Senior

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