This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BEAGLEBN: DCAN setup issue

Part Number: BEAGLEBN

Hi,

we use Buildroot for the Linux running on our Beaglebone Black. So far we have used the Buildroot version 2014.11 and were able to use both CAN interfaces. Now we decided to upgrade to the lates Buildroot LTS version 2019.02. This current Buildroot version uses the TI Linux Version 4.14.40 (git://git.ti.com/processor-sdk/processor-sdk-linux.git   Repository version: 4796173fc58688055a99a1cef19a839174067220).

With this version we are not able to use one of the two CAN interfaces, because neither the can0 nor the can1 interface are available. These are the steps, that we have done so far to enable the CAN interfaces:

1. We added the following lines to am335x-boneblack.dts

&am33xx_pinmux {
	dcan0_pins_default: dcan0_pins_default {
        pinctrl-single,pins = <
			AM33XX_IOPAD(0x978, PIN_OUTPUT_PULLUP | MUX_MODE2)
			AM33XX_IOPAD(0x97C, PIN_INPUT_PULLUP | MUX_MODE2)
		>;
    };

	dcan1_pins_default: dcan1_pins_default {
		pinctrl-single,pins = <
			AM33XX_IOPAD(0x980, PIN_OUTPUT_PULLUP | MUX_MODE2)/*uart1_rxd.d_can1_tx*/
			AM33XX_IOPAD(0x984, PIN_INPUT_PULLUP | MUX_MODE2) /*uart1_txd.d_can1_rx*/
		>;
	};
};


&i2c2 {
	status = "disabled";
};

&uart1 {
	status = "disabled"; /* Pin conflict with dcan1 so we disable it if we use dcan1 */
};

&dcan0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&dcan0_pins_default>;
};

&dcan1 {
	status = "okay"; 
	pinctrl-names = "default";
	pinctrl-0 = <&dcan1_pins_default>;
};

1. We started the CAN drivers

modprobe can
modprobe can-dev
modprobe can-raw
modprobe c_can

This is the output of the commands and of lsmod:

# modprobe can
[   49.778858] can: controller area network core (rev 20170425 abi 9)
[   49.785835] NET: Registered protocol family 29
# modprobe can-dev
[   55.454286] CAN device driver interface
# modprobe can-raw
[   61.789893] can: raw protocol (rev 20170425)
# modprobe c_can
#
# lsmod
Module                  Size  Used by    Not tainted
c_can                  20480  0
can_raw                20480  0
can_dev                24576  1 c_can
can                    28672  1 can_raw
#

If we now use ifconfig -a to list all interfaces neither can0 nor can1 interface is available.

If we use Buildroot 2014.11 (TI Linux 3.12 Repository version: 7f280334068b7c875ade51f8f3921ab311f0c824) then both CAN interfaces work properly. This is how we modified the old am335x-boneblack.dts:

&am33xx_pinmux {
	dcan1_pins_s0: dcan1_pins_s0 {
		pinctrl-single,pins = <
			0x180 0x12  /* d_can1_tx, SLEWCTRL_FAST | INPUT_PULLUP | MODE2 */
			0x184 0x32  /* d_can1_rx, SLEWCTRL_FAST | RECV_ENABLE | INPUT_PULLUP | MODE2 */
		>;
	};
	
	dcan0_pins_s0: dcan0_pins_s0 {
        pinctrl-single,pins = <
            0x178 0x12  /* d_can0_tx, SLEWCTRL_FAST | INPUT_PULLUP | MODE2 */
            0x17C 0x32  /* d_can0_rx, SLEWCTRL_FAST | RECV_ENABLE | INPUT_PULLUP | MODE2 */
        >;
    };
};

&dcan1 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&dcan1_pins_s0>;
};


&dcan0 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&dcan0_pins_s0>;
};

So I have no idea what we are missing or what we are doing wrong in the latest Linux version? Do you have any idea what we missed or what we are doing wrond?

Thank you and best regards,

Uwe

 

  • Hi,

    Could you please attach (not cut and paste) the boot log? 

    TI does not support Buildroot so I am not familiar with how the TI SDK kernel and DTS files are sourced. I think you are trying to show me the differences but could you please attach the diff between the Buildroot version and the TI SDK version of the board dts? As I said I am not familiar with Buildroot so maybe the files have been referenced from the same repo, apologies if that added confusion. 

    Since and earlier version is working than that indicates that the hardware is working. 

    Best Regards,

    Schuyler

  • Hi,

    thank you for your reply. I attached the boot log. Buildroot uses the standard TI SDK kernel and uses the default dts files from the Kernel without ony modification. The only modification are the changes I did to enable the CAN interfaces.

    Best regards,

    Uwe

    U-Boot SPL 2018.07 (Oct 29 2019 - 11:05:07 +0100)
    Trying to boot from MMC1
    Loading Environment from FAT... *** Warning - bad CRC, using default environment
    
    Failed (-5)
    
    
    U-Boot 2018.07 (Oct 29 2019 - 11:05:07 +0100)
    
    CPU  : AM335X-GP rev 2.1
    Model: TI AM335x BeagleBone Black
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... *** Warning - bad CRC, using default environment
    
    Failed (-5)
    No USB device found
    <ethaddr> not set. Validating first E-fuse MAC
    Net:   eth0: ethernet@4a100000
    Hit any key to stop autoboot:  0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    376 bytes read in 1 ms (367.2 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc0 ...
    Running uenvcmd ...
    5561848 bytes read in 355 ms (14.9 MiB/s)
    36793 bytes read in 5 ms (7 MiB/s)
    bootargs=console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff4000, end 8fffffb8 ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.14.40 (user1@ubuntu) (gcc version 7.4.0 (Buildroot 2019.02.6)) #2 SMP Tue Oct 29 12:54:59 CET 2019
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] cma: Reserved 16 MiB at 0x9e800000
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM335X ES2.1 (sgx neon)
    [    0.000000] percpu: Embedded 17 pages/cpu @df93c000 s40872 r8192 d20568 u69632
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129412
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait
    [    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Memory: 479872K/522240K available (8192K kernel code, 817K rwdata, 2424K rodata, 1024K init, 7548K bss, 25984K reserved, 16384K cma                                            -reserved, 0K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xe0000000 - 0xff800000   ( 504 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xdfe00000   ( 510 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
    [    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
    [    0.000000]       .data : 0xc0d00000 - 0xc0dcc7f8   ( 818 kB)
    [    0.000000]        .bss : 0xc0dce000 - 0xc152d054   (7549 kB)
    [    0.000000] Running RCU self tests
    [    0.000000] Hierarchical RCU implementation.
    [    0.000000]  RCU event tracing is enabled.
    [    0.000000]  RCU lockdep checking is enabled.
    [    0.000000]  RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
    [    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [    0.000017] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [    0.000047] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [    0.000099] OMAP clocksource: timer1 at 24000000 Hz
    [    0.000640] timer_probe: no matching timers found
    [    0.001537] Console: colour dummy device 80x30
    [    0.001585] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
    [    0.001599] ... MAX_LOCKDEP_SUBCLASSES:  8
    [    0.001611] ... MAX_LOCK_DEPTH:          48
    [    0.001623] ... MAX_LOCKDEP_KEYS:        8191
    [    0.001636] ... CLASSHASH_SIZE:          4096
    [    0.001648] ... MAX_LOCKDEP_ENTRIES:     32768
    [    0.001660] ... MAX_LOCKDEP_CHAINS:      65536
    [    0.001672] ... CHAINHASH_SIZE:          32768
    [    0.001684]  memory used by lock dependency info: 4655 kB
    [    0.001696]  per task-struct memory footprint: 1536 bytes
    [    0.001730] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
    [    0.078628] pid_max: default: 32768 minimum: 301
    [    0.079031] Security Framework initialized
    [    0.079168] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.079189] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.082303] CPU: Testing write buffer coherency: ok
    [    0.083802] CPU0: thread -1, cpu 0, socket -1, mpidr 0
    [    0.085293] Setting up static identity map for 0x80100000 - 0x80100078
    [    0.085864] Hierarchical SRCU implementation.
    [    0.087492] smp: Bringing up secondary CPUs ...
    [    0.087516] smp: Brought up 1 node, 1 CPU
    [    0.087533] SMP: Total of 1 processors activated (996.14 BogoMIPS).
    [    0.087548] CPU: All CPU(s) started in SVC mode.
    [    0.091481] devtmpfs: initialized
    [    0.116400] random: get_random_u32 called from bucket_table_alloc+0xe4/0x23c with crng_init=0
    [    0.117377] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    0.118184] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [    0.118249] futex hash table entries: 256 (order: 2, 16384 bytes)
    [    0.120047] pinctrl core: initialized pinctrl subsystem
    [    0.124716] NET: Registered protocol family 16
    [    0.131746] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.230464] cpuidle: using governor menu
    [    0.243207] OMAP GPIO hardware version 0.1
    [    0.269642] No ATAGs?
    [    0.269658] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.269970] omap4_sram_init:Unable to allocate sram needed to handle errata I688
    [    0.269990] omap4_sram_init:Unable to get sram pool needed to handle errata I688
    [    0.307326] edma 49000000.edma: TI EDMA DMA engine driver
    [    0.312628] SCSI subsystem initialized
    [    0.314620] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring prob                                            e
    [    0.314852] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring prob                                            e
    [    0.315179] pps_core: LinuxPPS API ver. 1 registered
    [    0.315196] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.315264] PTP clock support registered
    [    0.319232] clocksource: Switched to clocksource timer1
    [    0.453454] VFS: Disk quotas dquot_6.6.0
    [    0.453647] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.479860] NET: Registered protocol family 2
    [    0.481637] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.481742] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
    [    0.482915] TCP: Hash tables configured (established 4096 bind 4096)
    [    0.483294] UDP hash table entries: 256 (order: 2, 20480 bytes)
    [    0.483479] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
    [    0.484220] NET: Registered protocol family 1
    [    0.486339] RPC: Registered named UNIX socket transport module.
    [    0.486386] RPC: Registered udp transport module.
    [    0.486401] RPC: Registered tcp transport module.
    [    0.486415] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.488985] hw perfevents: no interrupt-affinity property for /pmu, guessing.
    [    0.490247] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [    0.492956] audit: initializing netlink subsys (disabled)
    [    0.495606] audit: type=2000 audit(0.490:1): state=initialized audit_enabled=0 res=1
    [    0.495924] workingset: timestamp_bits=14 max_order=17 bucket_order=3
    [    0.498637] NFS: Registering the id_resolver key type
    [    0.499001] Key type id_resolver registered
    [    0.499038] Key type id_legacy registered
    [    0.499440] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
    [    0.505976] io scheduler noop registered
    [    0.506006] io scheduler deadline registered
    [    0.506134] io scheduler cfq registered (default)
    [    0.506152] io scheduler mq-deadline registered
    [    0.506167] io scheduler kyber registered
    [    0.508327] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [    0.514106] Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled
    [    0.520386] omap_uart 44e09000.serial: no wakeirq for uart0
    [    0.520772] 44e09000.serial: ttyO0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a OMAP UART0
    [    1.244711] console [ttyO0] enabled
    [    1.277893] brd: module loaded
    [    1.307001] loop: module loaded
    [    1.312982] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.322837] libphy: Fixed MDIO Bus: probed
    [    1.399286] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [    1.407318] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
    [    1.418103] libphy: 4a101000.mdio: probed
    [    1.422536] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
    [    1.433732] cpsw 4a100000.ethernet: Detected MACID = 54:4a:16:e5:64:53
    [    1.441101] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [    1.447752] cpsw 4a100000.ethernet: ALE Table size 1024
    [    1.453419] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [    1.464097] i2c /dev entries driver
    [    1.471972] omap_hsmmc 48060000.mmc: Got CD GPIO
    [    1.577178] mmc0: host does not support reading read-only switch, assuming write-enable
    [    1.587744] mmc0: new high speed SDHC card at address 59b4
    [    1.597018] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.606808] oprofile: using arm/armv7
    [    1.611485] Initializing XFRM netlink socket
    [    1.616379] NET: Registered protocol family 10
    [    1.624372] mmcblk0: mmc0:59b4 USDU1 14.9 GiB
    [    1.635809]  mmcblk0: p1 p2
    [    1.645026] Segment Routing with IPv6
    [    1.648994] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
    [    1.657258] NET: Registered protocol family 17
    [    1.662131] NET: Registered protocol family 15
    [    1.667115] Key type dns_resolver registered
    [    1.671840] omap_voltage_late_init: Voltage driver support not added
    [    1.678494] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
    [    1.687024] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
    [    1.696006] ThumbEE CPU extension supported.
    [    1.700607] Registering SWP/SWPB emulation handler
    [    1.705614] SmartReflex Class3 initialized
    [    1.761882] mmc1: new high speed MMC card at address 0001
    [    1.769245] mmcblk1: mmc1:0001 MMC04G 3.66 GiB
    [    1.775680] mmcblk1boot0: mmc1:0001 MMC04G partition 1 1.00 MiB
    [    1.784611] mmcblk1boot1: mmc1:0001 MMC04G partition 2 1.00 MiB
    [    1.792387] random: fast init done
    [    1.796312] mmcblk1rpmb: mmc1:0001 MMC04G partition 3 128 KiB
    [    1.830428] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [    1.837106] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [    1.847163] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
    [    1.854627] hctosys: unable to open rtc device (rtc0)
    [    1.860062] sr_init: No PMIC hook to init smartreflex
    [    1.865604] sr_init: platform driver register failed for SR
    [    1.937077] EXT4-fs (mmcblk0p2): recovery complete
    [    1.946046] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    1.954841] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [    1.964264] devtmpfs: mounted
    [    1.969519] Freeing unused kernel memory: 1024K
    Starting syslogd: OK
    Starting klogd: OK
    Starting mdev...
    [    4.522307] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
    [    5.135628] input: tps65217_pwrbutton as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0
    [    5.262373] omap_rng 48310000.rng: Random Number Generator ver. 20
    [    5.350666] omap_rtc 44e3e000.rtc: already running
    [    5.380583] omap_rtc 44e3e000.rtc: registered as rtc0
    [    5.661875] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    6.152413] usbcore: registered new interface driver usbfs
    [    6.158739] usbcore: registered new interface driver hub
    [    6.164700] usbcore: registered new device driver usb
    Initializing random number generator... [    6.853543] am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regu                                            lator
    [    7.293359] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
    [    7.345568] random: dd: uninitialized urandom read (512 bytes read)
    done.
    [    7.478834] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [    7.485338] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
    Starting rngd: OK
    [    7.683456] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    7.690926] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    7.698478] usb usb1: Product: MUSB HDRC host driver
    [    7.703779] usb usb1: Manufacturer: Linux 4.14.40 musb-hcd
    [    7.709561] usb usb1: SerialNumber: musb-hdrc.1
    [    7.739594] random: crng init done
    Starting network: [    7.791652] hub 1-0:1.0: USB hub found
    [    7.826546] hub 1-0:1.0: 1 port detected
    OK
    Starting sshd: OK
    
    Welcome to Buildroot
    buildroot login:
    

  • Hi,

    Apologies for the delay, this thread seemed to get lost somehow. Are you not able to see either CAN interface with the TI kernel you moved to?

    Best Regards,

    Schuyler

  • Hi,

    I'm not able to see either CAN interface with the given TI kernel. I'm not sure if my changes to the DTS file are correct to enable the CAN interfaces or if there are any other steps required. So it would be good if:

    • I would get a confirmation, that CAN support is broken on this kernel version
    • or that I get some information how to modify the DTS to enable CAN that is knowing to work
    • or to get some information, how to debug the problem

    An help would be good.

    Thank you and best regards,

    Uwe