LS1021A Rev2: CAN communication not working using TWR-IND-IO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LS1021A Rev2: CAN communication not working using TWR-IND-IO

Jump to solution
5,898 Views
shrikant_bobade
Contributor III

Hi,

I am using LS1021A Rev.2: Board along with TWR-ELEV & TWR-IND-IO to check CAN communication.

I have connected two LS1 targets to check CAN communication over CAN n/w. CANH1, GND, CANL1 connected to other similar setup.

setup details:

kernel v4.1.8 from http://git.freescale.com/git/cgit.cgi/ppc/sdk/linux.git/log/?h=sdk-v2.0.x

user-land: CAN canutils v4.0.6 libsocketcan v0.0.9

The TWR-IND-IO module: J13 & J14: jumper settings done w.r.to http://cache.nxp.com/files/microcontrollers/doc/user_guide/TWR-IND-IO_QSG.pdf?fpsp=1&WT_TYPE=Quick%2...

to make can0 interface up:

:~# ip link set can0 up type can bitrate 125000

flexcan 2a70000.can can0: writing ctrl=0x4a312005

IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

CAN dtb nodes:

can@2a70000 {

  compatible = "fsl,ls1021ar2-flexcan";

  reg = <0x00000000 0x00000003 0x0000007e 0x000000d9>;

  interrupts = <0x00000000 0x00000010 0x0000000a>;

  clocks = <0x0000000a 0x00000003 0x70657200 0x00000003>;

  clock-names = "ipg", "per";

  little-endian;

  status = "okay";

  };

  can@2a80000 {

  compatible = "fsl,ls1021ar2-flexcan";

  reg = <0x00000000 0x00000003 0x0000007f 0x000000d9>;

  interrupts = <0x00000000 0x00000010 0x0000000a>;

  clocks = <0x0000000a 0x00000003 0x70657200 0x00000003>;

  clock-names = "ipg", "per";

  little-endian;

  status = "okay";

  };

using canutils, I am trying to check the CAN communication: but didn't got the CAN communication working.

e.g.candump can0 & cansend -e can0 1 2 3 4 5 6 7  8 --loop=2

Please advice do I need to do any extra change to make the CAN communication working?

Any pointers will be a great help.

Thanks

Shrikant

Labels (1)
Tags (1)
1 Solution
4,100 Views
shrikant_bobade
Contributor III

Thanks for the continuous help & support, with NXP team shared additional hardware configuration and software update, we got CAN Communication working using TWR-IND-IO on LS1021A Rev.2.

Thanks

Shrikant

View solution in original post

0 Kudos
26 Replies
3,958 Views
Pavel
NXP Employee
NXP Employee

Sorry for delay.

The R10 and R11 resistors should be added on the TWR-IND-IO board is CAN1 of the LS1021a is used. The LS1021a CAN1 is connected to CAN0 on the TWR-IND-IO board. If the R10 R11 is populated, the CAN0 is connected to CAN transceiver.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,960 Views
shrikant_bobade
Contributor III

Hi Pavel,

Yes, R10 and R11 resistors available on TWR-IND-IO, so does it mean: we need to check Target One:CAN1 to Target Two: CAN1 ?

w.r.to connection details: CAN1->CAN0->CAN transceiver.

I will check the status over two targets and update further.. meanwhile..

TWR-IND-IO.jpg

This is the snap-shot of the jumper settings made during providing "External LoopBack test (Single Board): Not Working" logs during my previous comment : https://community.nxp.com/message/820201?commentID=820201&et=watches.email.thread#comment-813537

Please advice the J1 jumper setting pointers w.r.to the shared document.

Do I am missing anything ? Any further pointers will be a great help.

Thanks for the response. Have a nice day !

Thanks

Shrikant

0 Kudos
3,960 Views
Pavel
NXP Employee
NXP Employee

The TWR-IND-IO J1 is needed for add 120 OHm terminate resistor on the CAN bus. If there is no 120 OHm resistor on the other side of your CAN bus, use the J1 for adding 120 OHm resistor.

The TWR-IND-IO CAN1 is connected to CAN transceiver.

If R10 and R11 are populated, CAN1 is connected to J1 B41 and J1 B42.

The TWR-LS1021A CAN1 is connected to B41 and B42.

See schematic of the TWR-LS1021A and the TWR-IND-IO boards.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,960 Views
shrikant_bobade
Contributor III

Hi Pavel,

The R10 & R11 are available on TWR-IND-IO attached snapshot, populated means, do you want me to explicitly solder these two ? as there is no jumper associated with it.

image : R10 & R11 at top middle.

IMG_20160817_204520203.jpg

Please provide setup details step-by-step to get CAN working on TWR-IND-IO, like you provided the document in first response, It is difficult to understand the details from last couple of responses.

My TWR-IND-IO module revision is: SCH-27304 REV B, 700-27304 REV B.

Thanks

Shrikant

0 Kudos
3,960 Views
Pavel
NXP Employee
NXP Employee

There is no application note for using the TWR-LS1021a CAN and TWR-IND-IO. The TWR-IND-IO was developed early of the TWR-LS1021a. There are no jumpers for connection the LS1021a CAN1 to the TWR-IND-IO CAN0. There is this connection if R10 and R11 are populated. Solder these resistors on the TWR-IND-IO board.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,960 Views
shrikant_bobade
Contributor III

Hi Pavel,

Soldered the resistors  R10 & R11, verified connectivity using multimeter but still CAN communication not working.

As the TWR-IND-IO was developed early of TWR-LS1021A rev2.0 & no application note available for this combination.

So does it mean this combination is not yet tested ?

Thanks

Shrikant

0 Kudos
3,960 Views
shrikant_bobade
Contributor III

H Pavel,

Any further pointers ?

It will be a great help,

Thanks

Shrikant

0 Kudos
3,960 Views
shrikant_bobade
Contributor III

Hi Pavel,

Can you please help with CAN connection settings for External Loopback (Single Board)

w.r.to

CAN_connectors_snapshot.PNG

from http://cache.freescale.com/files/32bit/doc/ref_manual/TWR-LS1021ARM.pdf page 47: table 3-4.

It will be a great help.

Thanks

Shrikant

0 Kudos
3,960 Views
Pavel
NXP Employee
NXP Employee

Look at attached file. Use this file for FlexCAN testing on your board.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

4,101 Views
shrikant_bobade
Contributor III

Thanks for the continuous help & support, with NXP team shared additional hardware configuration and software update, we got CAN Communication working using TWR-IND-IO on LS1021A Rev.2.

Thanks

Shrikant

0 Kudos
3,960 Views
shrikant_bobade
Contributor III

Hi Pavel,

Thanks for sharing the attachment of FlexCAN Document. Observed this document is snapshot of https://freescale.sdlproducts.com/LiveContent/content/en-US/QorIQ_SDK/GUID-65FF1FD4-6263-43E8-9D3D-9...

which we already have w.r.to comment https://community.nxp.com/message/826467#comment-805367 

Also couple of inquiries added regarding this document in same thread previously.

i. Device Tree Bindings: w.r.to last section of comment https://community.nxp.com/message/826467#comment-805589 

ii. J1 Jumper :  w.r.to last section of comment https://community.nxp.com/message/826467#comment-813537 

Any further pointers ? 

It will be a great help.

Thanks

Shrikant

0 Kudos
3,960 Views
shrikant_bobade
Contributor III

H Pavel,

 

Any further pointers ?

It will be a great help,

 

Thanks

Shrikant

0 Kudos
3,960 Views
karina_valencia
NXP Apps Support
NXP Apps Support

Pavel Chubakov

please continue with the follow up.

3,960 Views
shrikant_bobade
Contributor III

H Pavel,

Any further pointers ?

It will be a great help,

Thanks

Shrikant

0 Kudos
3,960 Views
cedricatmentor
Contributor III

Hello

PavelChubakov​, karinavalencia

We haven't heard back from you on this case after we supplied the requested logs - can you help?

3,960 Views
Pavel
NXP Employee
NXP Employee

Sorry for delay.

Send message dump for Verification in Linux and Internal LoopBack test (SoC Level loopback):

https://freescale.sdlproducts.com/LiveContent/content/en-US/QorIQ_SDK/GUID-65FF1FD4-6263-43E8-9D3D-9...


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,960 Views
shrikant_bobade
Contributor III

Hi Pavel,

Thanks for the response, no problem !

Below are the CAN message dump logs for Internal & External Loopback.

Internal LoopBack test (SoC Level loopback): Working Fine

u-boot-log:

U-Boot 2016.01+ls1+ga9b437f (Jun 22 2016 - 17:43:10 +0530)

CPU:  Freescale LayerScape LS1021E, Version: 2.0, (0x87081120)

Clock Configuration:

      CPU0(ARMV7):1000 MHz,

      Bus:300  MHz, DDR:800  MHz (1600 MT/s data rate),

Reset Configuration Word (RCW):

      00000000: 0608000a 00000000 00000000 00000000

      00000010: 70000000 00007900 e0025a00 21046000

      00000020: 00000000 00000000 00000000 20000000

      00000030: 00080000 881b7340 00000000 00000000

I2C:  ready

Model: LS1021A TWR Board

Board: LS1021ATWR

CPLD:  V2.0

PCBA:  V1.0

VBank: 0

DRAM:  1 GiB

Using SERDES1 Protocol: 112 (0x70)

Firmware 'Microcode version 0.0.1 for LS1021a r1.0' for 1021 V1.0

QE: uploading microcode 'Microcode for LS1021a r1.0' version 0.0.1

Flash: 128 MiB

MMC:  FSL_SDHC: 0

EEPROM: NXID v16777216

PCIe1: Root Complex no link, regs @ 0x3400000

PCIe2: Root Complex no link, regs @ 0x3500000

In:    serial

Out:  serial

Err:  serial

SEC0: RNG instantiated

SATA link 0 timeout.

AHCI 0001.0300 1 slots 1 ports ? Gbps 0x1 impl SATA mode

flags: 64bit ncq pm clo only pmp fbss pio slum part ccc

Found 0 device(s).

SCSI:  Net:  eTSEC2 is in sgmii mode.

eTSEC1, eTSEC2 [PRIME], eTSEC3

Hit any key to stop autoboot:  0

root@ls1021atwr:~# uname -a

Linux ls1021atwr 4.1.8-rt8+ls1+gbd51baf #1 SMP Wed Jun 29 22:43:35 IST 2016 armv7l armv7l armv7l GNU/Linux

root@ls1021atwr:~# zcat /proc/config.gz | grep -i CAN

CONFIG_CAN=y

CONFIG_CAN_RAW=y

CONFIG_CAN_DEV=y

CONFIG_CAN_CALC_BITTIMING=y

CONFIG_CAN_FLEXCAN=y

CONFIG_CAN_DEBUG_DEVICES=y

root@ls1021atwr:~# ip link set can0 up type can bitrate 125000 loopback on

[  347.820997] flexcan 2a70000.can can0: writing ctrl=0x4a313005

[  347.826915] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

root@ls1021atwr:~# candump can0 &

[1] 834

interface = can0, family = 29, type = 3, proto = 1

root@ls1021atwr:~#  cansend -e can0 01 02 03 04 05 06 07 08 --loop=2                                                                                                                       

interface = can0, family = 29, type = 3, proto = 1

<0x00000001> [8] 01 02 03 04 05 06 07 00

<0x00000001> [8] 01 02 03 04 05 06 07 00

root@ls1021atwr:~# dmesg | grep -i flexcan

[    1.426634] flexcan 2a70000.can: Looking up xceiver-supply from device tree

[    1.426646] flexcan 2a70000.can: Looking up xceiver-supply property in node /soc/can@2a70000 failed

[    1.433908] flexcan 2a70000.can: device registered (reg_base=c089a000, irq=48)

[    1.441160] flexcan 2a80000.can: Looking up xceiver-supply from device tree

[    1.441171] flexcan 2a80000.can: Looking up xceiver-supply property in node /soc/can@2a80000 failed

[    1.448301] flexcan 2a80000.can: device registered (reg_base=c089c000, irq=49)

[  347.820997] flexcan 2a70000.can can0: writing ctrl=0x4a313005

[  347.826756] flexcan 2a70000.can can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x4a313005

[  347.826767] flexcan 2a70000.can can0: flexcan_chip_start: writing mcr=0x79a20209

[  347.826777] flexcan 2a70000.can can0: flexcan_chip_start: writing ctrl=0x4a31bc55

[  347.826811] flexcan 2a70000.can can0: flexcan_chip_start: reading mcr=0x60a20209 ctrl=0x4a31bc55

root@ls1021atwr:~# cat /proc/interrupts | grep can

48:          2          0      GIC 158 Level    can0

root@ls1021atwr:~# ifconfig

can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 

          UP RUNNING NOARP  MTU:16  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:10

          RX bytes:0 (0.0 B)  TX bytes:16 (16.0 B)

          Interrupt:48

External LoopBack test (Single Board): Not Working

Current setup details & consolidate updates from previous comments:

Connected can0 & can1 with pre. req.: J13, J14, J15 all jumpers shot & CANH GND CANL of  can0:can1 connected with straight cable, connectivity verified with multimeter.

1. using rcw_1000_misc.bin : D6 Blue LED glowing on TWR-IND-IO module

2. D1,D2,D6,D7: yellow LEDs glowing on TWR-ELEV module

3. using u-boot env: setenv hwconfig “can”

4. u-boot and kernel same from above internal loopback test logs

root@ls1021atwr:~# ip link set can0 up type can bitrate 125000

[   30.641193] flexcan 2a70000.can can0: writing ctrl=0x4a312005

[   30.647114] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready

root@ls1021atwr:~# ip link set can1 up type can bitrate 125000

[   35.123147] flexcan 2a80000.can can1: writing ctrl=0x4a312005

[   35.129069] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready

root@ls1021atwr:~# candump can1 &

[1] 856

interface = can1, family = 29, type = 3, proto = 1

root@ls1021atwr:~# cansend -e can0 01 02 03 04 05 06 07 08 --loop=2

interface = can0, family = 29, type = 3, proto = 1

root@ls1021atwr:~# cat /proc/interrupts | grep can

48:          0          0       GIC 158 Level     can0

49:          0          0       GIC 159 Level     can1

root@ls1021atwr:~# dmesg | grep -i flexcan

[    1.425605] flexcan 2a70000.can: Looking up xceiver-supply from device tree

[    1.425617] flexcan 2a70000.can: Looking up xceiver-supply property in node /soc/can@2a70000 failed

[    1.432879] flexcan 2a70000.can: device registered (reg_base=c089a000, irq=48)

[    1.440135] flexcan 2a80000.can: Looking up xceiver-supply from device tree

[    1.440147] flexcan 2a80000.can: Looking up xceiver-supply property in node /soc/can@2a80000 failed

[    1.447294] flexcan 2a80000.can: device registered (reg_base=c089c000, irq=49)

[   30.641193] flexcan 2a70000.can can0: writing ctrl=0x4a312005

[   30.646955] flexcan 2a70000.can can0: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x4a312005

[   30.646966] flexcan 2a70000.can can0: flexcan_chip_start: writing mcr=0x79a20209

[   30.646976] flexcan 2a70000.can can0: flexcan_chip_start: writing ctrl=0x4a31ac55

[   30.647011] flexcan 2a70000.can can0: flexcan_chip_start: reading mcr=0x60a20209 ctrl=0x4a31ac55

[   35.123147] flexcan 2a80000.can can1: writing ctrl=0x4a312005

[   35.128908] flexcan 2a80000.can can1: flexcan_set_bittiming: mcr=0x5980000f ctrl=0x4a312005

[   35.128919] flexcan 2a80000.can can1: flexcan_chip_start: writing mcr=0x79a20209

[   35.128928] flexcan 2a80000.can can1: flexcan_chip_start: writing ctrl=0x4a31ac55

[   35.128963] flexcan 2a80000.can can1: flexcan_chip_start: reading mcr=0x60a20209 ctrl=0x4a31ac55

root@ls1021atwr:~# ifconfig

can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 

          UP RUNNING NOARP  MTU:16  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:10

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:48

can1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 

          UP RUNNING NOARP  MTU:16  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:10

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

          Interrupt:49

root@ls1021atwr:~# cat /proc/net/dev | grep can

  can0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

  can1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

I have gone through the shared document, I am not getting the J1 jumper from Section Board Connections: On the LS1021A board, mount Jumper 1 as shown in figure below to ensure that HI speed mode is working  ..

1. on Main LS1021A(rev-2.0) board there is J1 jumper with tag: "Remote", when I shot it, my target is not booting up  & not getting anything on serial console.

2. while observed on TWR-IND-IO module the jumper count starts from J2, (near & on back side of J10 I can see a label as J1, but not a jumper)

Can you please provide more details on the J1 jumper? Do I am missing anything ?

Also we have posted query SDK-v2.0: FlexCAN not working on LS1021A IND-IO module  the meta-data is same. adding it here to provide more details.

Any further pointers to get "External CAN communication working" will be a great help !

Have a nice day!

Thanks

Shrikant

0 Kudos
3,960 Views
Pavel
NXP Employee
NXP Employee

Use the following link for these files:

http://git.freescale.com/git/cgit.cgi/layerscape/ls1021a/rcw.git/


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

3,960 Views
shrikant_bobade
Contributor III

Hi,

Using the above link checked the ls1021a/rcw.git - Freescale LS1021A rcw source repository.  rcw_1000_misc.rcw ls1021a/rcw.git - Freescale LS1021A rcw source repository.  Observed similar result CAN communication not working.

It seems these sources are bit older, I am using SDK2.0 with TWR-LS1021A rev2.0 board.

I was already using the sdk/rcw.git - Freescale PowerPC Reset Config Word (RCW) Tree

Observed with the use of rcw_100_misc.rcw  at bank 0 gives some intermittent results like: non detection of mmc & corrupting the bank1 u-boot, not sure on the frequency.

Is CAN communication tested using TWR-IND-IO on both banks Bank0 & Bank1?

currently these are observations from my Bank0 & Bank1.

1. Bank0 with ls1021a/rcw.git - Freescale LS1021A rcw source repository.

no CAN communication & no CAN packets movement at can0 & can1 interface.

2. Bank1 with sdk/rcw.git - Freescale PowerPC Reset Config Word (RCW) Tree

no CAN communication but I can see the can0 interrupt count increment to 2 &  16 bytes data at RX of can0 "RX bytes:16 (16.0 B)  TX bytes:0 (0.0 B)".

consolidate setup details:

u-boot:sdk/u-boot.git - Freescale PowerPC u-boot Tree

kernel: http://git.freescale.com/git/cgit.cgi/ppc/sdk/linux.git/log/?h=sdk-v2.0.x

target: TWR-LS1021A rev2.0 with TWR-ELEV & TWR-IND-IO can0 & can1 connected with straight cable. with J13,J14,J15 all jumpers shot/connected.

sdk: v2.0

Please advice the correct rcw sources to move further with the CAN communication, now I am kind of blocked on it.

Any pointers or references will be a great help.

Thanks

Shrikant

0 Kudos
3,960 Views
shrikant_bobade
Contributor III

Hi.

In addition to last comment observed even the can0 & can1 interfaces are connected and have similar jumper settings, configured with same bitrate:125000.

while sending CAN packets using cansend on can0 interface I am getting bus-off error.

[] flexcan 2a70000.can can0: New error state: 1

[] flexcan 2a70000.can can0: New error state: 3

[] flexcan 2a70000.can can0: bus-off

but similar steps executed on can1 interface there is no interrupt count,Rx byte or bus-off error observed,

Any pointers or references will be a great help.

Thanks

Shrikant

0 Kudos