8 Replies Latest reply on Jun 20, 2020 8:04 PM by robert1

    Enabling DCAN0 (Disabling I2C2)

    robert1

      I'm trying to get DCAN0 to work on the Beaglebone Black (the element14 industrial version). Not surprisingly configure-pin doesn't work out of the box since I2C2 is used for Capes.

       

      root@beaglebone:~# config-pin p9.19 can Pin is not modifyable: P9_19 i2c2_scl

       

      I've no use for the capes (only our custom board). Web searches indicate that it should be possible to disable i2c2 and allow DCAN0 to be enabled. I've not figure out what needs to be done though.

       

      On board version:

      root@beaglebone:~# uname -a

      Linux beaglebone 4.1.15-ti-rt-r43 #1 SMP PREEMPT RT Thu Jan 21 20:13:58 UTC 2016 armv7l GNU/Linux

       

      My latest attempt was to follow these instructions to little avail https://www.bacpeters.com/2020/01/25/configuring-the-beaglebone-black-gpio-pins-permanently/

      I've also tried disabling the I2C2 following the instructions here http://www.embedded-things.com/bbb/enable-canbus-on-the-beaglebone-black/

      And by simply commenting out the I2C2 section in am335x-boneblack or marking it as disabled rather than okay.

       

      All attempts appear to be ignored though as config-pin always returns the same error message.

       

      Any ideas or pointer to places with working information?

        • Re: Enabling DCAN0 (Disabling I2C2)
          aswinvenu

          Hi Robert,

           

            Beaglebone Green comes with the latest debian image and most of the method documented online wont work there.

          Please follow this instructions: https://ralimtek.com/can_bbg/

           

          Let me know if this worked.

           

          Regards,

          Aswin

            • Re: Enabling DCAN0 (Disabling I2C2)
              robert1

              Thanks, I'm working through it to see if I can follow it to enable DCAN0. Two immediate notes:

              1. It's about enabling DCAN1 (I've had no problem with enabling DCAN1, config-pin worked well for that). DCAN0 is the problem since it shares pins with I2C2 (which I don't need but which is automatically enabled)
              2. It's for the green, not the black. Hopefully they've no difference in this area.

               

              Robert

              • Re: Enabling DCAN0 (Disabling I2C2)
                robert1

                Maybe I'm missing something but isn't the cape manager deprecated?

                 

                I don't see how this would disable I2C2 but would I substitute BB-CAN0 in place of BB-CAN1 to get access to DCAN0? Would that disable I2C2 and the cape detection as required?

                 

                Robert

                  • Re: Enabling DCAN0 (Disabling I2C2)
                    mp2100

                    I think the answer to your question is yes about CAN0, but I don't have a live CAN bus to test it with.  I followed Jan Cumps instructions.

                    Test CAN BUS on BeagleBone

                    Which reference Thomas Wedemeyer instructions:

                    https://www.thomas-wedemeyer.de/beaglebone-canbus-python.html

                    Which also use CAN1, rather than the CAN0 you want.  But when I substitute can0 in all the command lines, all indications on my BBB are that CAN0 is enabled.

                     

                    Substituting the can0 requirements, I did this (following Thomas Wedemeyer's page)

                    config-pin p9.19 can
                    config-pin p9.20 can
                    

                    and then

                     

                     sudo ip link set can0 up type can bitrate 125000
                     sudo ifconfig can0 up

                     

                     

                    and now I get this response from my BBB

                    ~$ ifconfig can0
                    can0: flags=193<UP,RUNNING,NOARP>  mtu 16
                            unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
                            RX packets 0  bytes 0 (0.0 B)
                            RX errors 0  dropped 0  overruns 0  frame 0
                            TX packets 0  bytes 0 (0.0 B)
                            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
                            device interrupt 42
                    

                     

                    Note that it says " <UP, RUNNING,NOARP> "  it might be working.

                      • Re: Enabling DCAN0 (Disabling I2C2)
                        robert1

                        Sorry for the delay I was getting a Cisco console cable do I could get the boot debug information. Even with modifying uEnv.txt I still get

                         

                        root@beaglebone:~# config-pin p9.19 can

                        Pin is not modifyable: P9_19 i2c2_scl

                         

                        So it appears I2C2 was not disabled by that addition

                         

                        Robert

                          • Re: Enabling DCAN0 (Disabling I2C2)
                            robert1

                            So with regards to I2C2 I'm getting the following boot messages

                             

                            [2.969830] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe

                             

                             

                            [5.163934] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz

                             

                             

                            Followed by cape manger messages

                            [5.171244]  remoteproc0: powering up wkup_m3
                            [5.175646]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 219735
                            [5.177228] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,EIA0,4618BBBK0D0F'
                            [5.177248] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
                            [5.198715]  remoteproc0: remote processor wkup_m3 is now up
                            [5.198757] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
                            [5.233448] bone_capemgr bone_capemgr: slot #0: No cape found
                            [5.293494] bone_capemgr bone_capemgr: slot #1: No cape found
                            [5.353461] bone_capemgr bone_capemgr: slot #2: No cape found
                            [5.413460] bone_capemgr bone_capemgr: slot #3: No cape found
                            [5.419422] bone_capemgr bone_capemgr: initialized OK.

                             

                            And ending with

                            [   30.369800] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz

                            [   30.372495] bone_capemgr bone_capemgr: slot #4: dtbo 'cape-universaln-00A0.dtbo' loaded; overlay id #0

                             

                            For CAN I get

                             

                            before kernel start

                            debug: [console=ttyO0,115200n8 capemgr.enable_partno=BB-CAN0,BB-CAN1 root=UUID=53ae60fe-d040-40fd-96fd-afc59c5146a0 ro rootfstype=ext4 rootwait coherent_pool=1M

                             

                            Then

                            [0.000000] Kernel command line: console=ttyO0,115200n8 capemgr.enable_partno=BB-CAN0,BB-CAN1 root=UUID=53ae60fe-d040-40fd-96fd-afc59c5146a0 ro rootfstype=ext4 rootwait coherent_pool=1M cape_universal=enable

                             

                             

                            [   18.087268] CAN device driver interface

                            [   18.135773] c_can_platform 481cc000.can: c_can_platform device registered (regs=fa1cc000, irq=166)

                            [   18.315289] c_can_platform 481d0000.can: c_can_platform device registered (regs=fa1d0000, irq=167)

                             

                            It looks like the interrupts are being registered for both CAN devices. But it's not possible to configure the pins for both.

                             

                            Robert