cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to test FDCAN2 on STM32MP257F-EV1

VChittem
Associate

Hi Team,

 

I am able to test "can0" module, from OpenSTLinux running on STM32MP257F-EV1 board, using the attached code "STM32MP2_Can0Test.c" compiled to binary (using AARM64 cross compiler from OpenSTLinux SDK) and PEAK PCAN Usb connected to FDCAN1 DB9 port of EV1 board, and results are as expected (found can0 to be working fine for Tx and Rx), see attached screenshot STM32MP2_Can0Test_Result.png.

 

I changed can0 to can1 in STM32MP2_Can0Test.c and saved it as STM32MP2_Can1Test.c and tested for can1. However, I wasn't able to Tx/Rx using EV1 on can1 channel (FDCAN2). steps followed are exactly same as that of can0 test.

 

Please let me know if I am missing anything.

 

Below is the ssh terminal steps followed and the result for can0 test.

C:\Users\venka>ssh root@192.168.7.1

The authenticity of host '192.168.7.1 (192.168.7.1)' can't be established.

RSA key fingerprint is SHA256:q3nsWskxawn3YSFrCOGu5GHq28FltL353TXSnbgDP0s.

This key is not known by any other names.

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes

Warning: Permanently added '192.168.7.1' (RSA) to the list of known hosts.

root@stm32mp25-eval-e3-e3-52:~# dir

STM32MP2_Can0TestResult STM32MP2_Can1TestResult

root@stm32mp25-eval-e3-e3-52:~# ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

  inet 127.0.0.1/8 scope host lo

    valid_lft forever preferred_lft forever

  inet6 ::1/128 scope host noprefixroute

    valid_lft forever preferred_lft forever

2: end1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000

  link/ether 10:e7:7a:e3:e3:53 brd ff:ff:ff:ff:ff:ff

3: end0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000

  link/ether 10:e7:7a:e3:e3:52 brd ff:ff:ff:ff:ff:ff

4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 10

  link/can

5: can1: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10

  link/can

6: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000

  link/ether b2:99:1c:58:fd:71 brd ff:ff:ff:ff:ff:ff

  inet 192.168.7.1/24 brd 192.168.7.255 scope global usb0

    valid_lft forever preferred_lft forever

  inet6 fe80::b099:1cff:fe58:fd71/64 scope link proto kernel_ll

    valid_lft forever preferred_lft forever

root@stm32mp25-eval-e3-e3-52:~#

root@stm32mp25-eval-e3-e3-52:~# ip link set can0 down

root@stm32mp25-eval-e3-e3-52:~# ip link set can0 type can bitrate 500000 loopback off

root@stm32mp25-eval-e3-e3-52:~# ip link set can0 up

root@stm32mp25-eval-e3-e3-52:~# ip -details link show can0

4: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10

  link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0

  can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0

     bitrate 500000 sample-point 0.875

     tq 10 prop-seg 87 phase-seg1 87 phase-seg2 25 sjw 12 brp 1

     m_can: tseg1 2..256 tseg2 2..128 sjw 1..128 brp 1..512 brp_inc 1

     m_can: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..32 dbrp_inc 1

     clock 100000000 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro_ipv4_max_size 65536 parentbus platform parentdev 402d0000.can

root@stm32mp25-eval-e3-e3-52:~# ./Can3Test

Socket bound to can0 (index 4)

Sent 8-byte frame with ID=0x123

Received frame: ID=0x111 DLC=8 data=10 32 54 76 98 00 11 22

root@stm32mp25-eval-e3-e3-52:~#

0 REPLIES 0