• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

RRF install failure with Hardkernel Odroid C4 as the SBC

Scheduled Pinned Locked Moved Solved
Firmware installation
3
13
822
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    Nurgelrot
    last edited by 18 Jul 2021, 00:19

    Trying to get RRF 3.3 working on a Odroid C4. I've followed the instructions for turning on SPI and compiled and successfully run their little test program. /dev/spidev0.0 seems to be working. I have the bufsize set to 8192 for the spidev

    But when install RRF I get:
    [fatal] Could not connect to Duet (Error 16. Cannot put line into event mode.) when the actual firmware package kicks off.

    Is this something to do with the SPI bus or is this due to not correctly setting the transfer ready pin? Basically what might be throwing this error. I know I'm trying to so stuff way out side the normal support lanes here just need to know where to go looking...

    I'm doing the bulk of my testing with a BTT GTR board the STM port (just incase I really mess something up). But I get the same error when attaching a genuine Mini5.

    Attaching information that maybe helpful to people looking into this...

    root@odroid:~# ls -al /dev/i2c* /dev/spi* /dev/ttyS* /dev/gpio*
    crw-rw---- 1 root gpio    254, 0 Jul 17 23:37 /dev/gpiochip0
    crw-rw---- 1 root gpio    254, 1 Jul 17 23:37 /dev/gpiochip1
    crw-rw---- 1 root root    242, 0 Jul 17 23:37 /dev/gpiomem
    crw------- 1 root root     89, 0 Jul 17 23:37 /dev/i2c-0
    crw------- 1 root root     89, 1 Jul 17 23:37 /dev/i2c-1
    crw-rw---- 1 root gpio    153, 0 Jul 17 23:37 /dev/spidev0.0
    crw--w---- 1 root tty     239, 0 Jul 17 23:37 /dev/ttyS0
    crw-rw---- 1 root dialout 239, 1 Jul 17 23:37 /dev/ttyS1
    crw-rw---- 1 root dialout 239, 2 Jul 17 23:37 /dev/ttyS2
    crw-rw---- 1 root dialout 239, 3 Jul 17 23:37 /dev/ttyS3
    
    root@odroid:~# lsmod | grep spi
    spidev                 20480  0
    spi_meson_spicc        20480  0
    
    root@odroid:~# gpio readall
     +-----+-----+---------+------+---+--- C4 ---+---+------+---------+-----+-----+
     | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
     +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
     |     |     |    3.3V |      |   |  1 || 2  |   |      | 5V      |     |     |
     | 493 |   8 |   SDA.2 | ALT1 | 1 |  3 || 4  |   |      | 5V      |     |     |
     | 494 |   9 |   SCL.2 | ALT1 | 1 |  5 || 6  |   |      | 0V      |     |     |
     | 481 |   7 |  IO.481 |   IN | 1 |  7 || 8  | 1 | ALT1 | TxD1    | 15  | 488 |
     |     |     |      0V |      |   |  9 || 10 | 1 | ALT1 | RxD1    | 16  | 489 |
     | 479 |   0 |  IO.479 |   IN | 1 | 11 || 12 | 1 | IN   | IO.492  | 1   | 492 |
     | 480 |   2 |  IO.480 |   IN | 1 | 13 || 14 |   |      | 0V      |     |     |
     | 483 |   3 |  IO.483 | ALT2 | 1 | 15 || 16 | 1 | IN   | IO.476  | 4   | 476 |
     |     |     |    3.3V |      |   | 17 || 18 | 1 | IN   | IO.477  | 5   | 477 |
     | 484 |  12 |    MOSI | ALT4 | 0 | 19 || 20 |   |      | 0V      |     |     |
     | 485 |  13 |    MISO | ALT4 | 0 | 21 || 22 | 1 | IN   | IO.478  | 6   | 478 |
     | 487 |  14 |    SLCK | ALT4 | 0 | 23 || 24 | 1 | OUT  | SS      | 10  | 486 |
     |     |     |      0V |      |   | 25 || 26 | 0 | ALT2 | IO. 23  | 11  | 433 |
     | 474 |  30 |   SDA.3 | ALT2 | 1 | 27 || 28 | 1 | ALT2 | SCL.3   | 31  | 475 |
     | 490 |  21 |  IO.490 |   IN | 1 | 29 || 30 |   |      | 0V      |     |     |
     | 491 |  22 |  IO.491 |   IN | 1 | 31 || 32 | 1 | ALT2 | IO. 24  | 26  | 434 |
     | 482 |  23 |  IO.482 | ALT2 | 1 | 33 || 34 |   |      | 0V      |     |     |
     | 495 |  24 |  IO.495 |   IN | 0 | 35 || 36 | 1 | OUT  | IO. 22  | 27  | 432 |
     |     |  25 |   AIN.2 |      |   | 37 || 38 |   |      | 1V8     | 28  |     |
     |     |     |      0V |      |   | 39 || 40 |   |      | AIN.0   | 29  |     |
     +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
     | I/O | wPi |   Name  | Mode | V | Physical | V | Mode |  Name   | wPi | I/O |
     +-----+-----+---------+------+---+--- C4 ---+---+------+---------+-----+-----+
    
    root@odroid:~# cat /opt/dsf/conf/config.json
    {
      "PluginSupport": true,
      "RootPluginSupport": false,
      "PluginsFilename": "/opt/dsf/conf/plugins.txt",
      "LogLevel": "info",
      "SocketDirectory": "/var/run/dsf",
      "SocketFile": "dcs.sock",
      "Backlog": 4,
      "SocketPollInterval": 2000,
      "BaseDirectory": "/opt/dsf/sd",
      "PluginDirectory": "/opt/dsf/plugins",
      "NoTerminateOnReset": false,
      "HostUpdateInterval": 4000,
      "MaxMessageAge": 60,
      "SpiDevice": "/dev/spidev0.0",
      "SpiBufferSize": 8192,
      "SpiTransferMode": 0,
      "SpiFrequency": 8000000,
      "SpiConnectTimeout": 500,
      "SpiTransferTimeout": 500,
      "SpiConnectionTimeout": 4000,
      "MaxSpiRetries": 3,
      "SpiPollDelay": 25,
      "GpioChipDevice": "/dev/gpiochip0",
      "TransferReadyPin": 6,
      "BufferedPrintCodes": 32,
      "BufferedMacroCodes": 16,
      "MaxBufferSpacePerChannel": 1536,
      "MaxCodeBufferSize": 256,
      "MaxMessageLength": 4096,
    ... cutting off here as the rest isn't useful.
    
    

    Thanks

    undefined 1 Reply Last reply 18 Jul 2021, 00:39 Reply Quote 0
    • undefined
      Nurgelrot @Nurgelrot
      last edited by Nurgelrot 18 Jul 2021, 00:39

      @nurgelrot Talking to myself here.. running DuetControlServer -l trace tells me it's the GPIO transfer ready pin. But man I wish I understood how to pass it the right values. The "6" value above would only work if I'd compiled DCS linking to the WiringPI wrapper library. But '478' which is how the Odriod thinks of it doesn't work either so maybe this is a lost cause...

      1 Reply Last reply Reply Quote 0
      • undefined
        Nurgelrot
        last edited by 18 Jul 2021, 03:08

        I got it... I love it when a plan comes together... Found the correct GPIO pin:

        #68 located in device /dev/gpiochip1

        thanks for putting up with my noise everyone 🙂

        If you have one of these SBC's feel free to hit me up if you run into issues.

        undefined undefined 2 Replies Last reply 18 Jul 2021, 07:31 Reply Quote 2
        • undefined
          o_lampe @Nurgelrot
          last edited by o_lampe 18 Jul 2021, 07:31

          @nurgelrot
          A while ago I asked about Odroid support and was linked to a readme file where all supported MPUs were listed. Odroid N2 was not.
          Did that change over time? Or did you make your own DSC image?

          undefined 1 Reply Last reply 18 Jul 2021, 14:34 Reply Quote 0
          • undefined
            Nurgelrot @o_lampe
            last edited by Nurgelrot 18 Jul 2021, 14:34

            @o_lampe No I have it working now with both the Hardkernel Ubuntu release and the Armbian release for the C4. No extra compiling required. Just followed the guide on setting up an SBC for Duet and improvising as needed. Getting the buffersize for SPI is a little tricky as it wont pick it up from modprobe. you have to pass it as a boot time param in the bootargs of the kernel (spidev.bufsiz=8192)

            I'm really liking this board so far. Almost the same form factor as the pi3 just the HDMI port is moved and the power connector is different. Its 12v instead of 5 runs 15c cooler than the pi4 but still has the standard 5v outputs. Also has separate input for the tty console (in addition to UARTs on the 40pin) has option to hardwire to a PSU rather than the bulky barrel connector.

            No WiFi/BT though, but given my experiences with the WiFi in the Pi that might actually be a benefit... 4 USB3 ports so a wifi dongle is no big deal and works better than a built in one anyway. Has the option to run of an eMMC chip or an SD card so "disk" IO isn't an issue.

            Now I just have to run it for awhile and see if RRF play's nice with it.

            https://www.cnx-software.com/2020/04/24/raspberry-pi-4-vs-odroid-c4-features-comparison/

            1 Reply Last reply Reply Quote 0
            • undefined
              joeko @Nurgelrot
              last edited by 7 Nov 2021, 13:24

              @nurgelrot said in RRF install failure with Hardkernel Odroid C4 as the SBC:

              I got it... I love it when a plan comes together... Found the correct GPIO pin:

              #68 located in device /dev/gpiochip1

              thanks for putting up with my noise everyone 🙂

              If you have one of these SBC's feel free to hit me up if you run into issues.

              hallo,
              i am going to do the same with a duet3 mini and a odroid c4. how you did this ? did you modify the cable or create an new one ?
              you wrote that gpio pin #64 is right. why is this the right pin ? i cant find this pin on the odroid wiki.

              undefined 1 Reply Last reply 8 Nov 2021, 19:48 Reply Quote 0
              • undefined
                Nurgelrot @joeko
                last edited by Nurgelrot 11 Aug 2021, 19:49 8 Nov 2021, 19:48

                @joeko I find its easiest to use a linux distro that is still using the version 4.9 kernels. And you do not need any custom cable the one that comes with the Duet works fine.

                First install/configure your OS and then add the gpiod package. Then run gpioinfo and you will see how the Odroid is maping the standard Pi gpio pins. The SPI stuff should be fine by default but you need to find where PI pin 22 goes. pin 22 on the standard Pi gpio header maps on the Odroid C4 as below on ubuntu focal or debian bullsye based installs:

                root@# gpioinfo 
                gpiochip0 - 16 lines:
                        .
                        .
                        .
                
                gpiochip1 - 86 lines:
                        .
                        .
                        .
                
                        line  68:     "PIN_22"       unused   input  active-high 
                             .
                             .
                             .
                

                So install the duet software as normal and it will error out due to the config being wrong. Then edit
                /opt/dsf/conf/config.json
                and replace the lines for:

                "GpioChipDevice": "/dev/gpiochip1",
                  "TransferReadyPin": 68,
                

                Your's may be diffrent depending on what the output of gpioinfo was. then reinstall the duet software and it should make the connection the board and start up.

                You'll also have to adjust the SPI Buffer by adding

                options spidev bufsiz=8192
                

                to
                /etc/modprobe.d/spidev.conf

                Reboot the Odroid and all should work just like the Pi. If for some reason the Duet software is messed up from the failed install just reinstall.

                undefined 1 Reply Last reply 8 Nov 2021, 21:59 Reply Quote 0
                • undefined
                  joeko @Nurgelrot
                  last edited by 8 Nov 2021, 21:59

                  @nurgelrot said in RRF install failure with Hardkernel Odroid C4 as the SBC:

                  @joeko I find its easiest to use a linux distro that is still using the version 4.9 kernels. And you do not need any custom cable the one that comes with the Duet works fine.

                  First install/configure your OS and then add the gpiod package. Then run gpioinfo and you will see how the Odroid is maping the standard Pi gpio pins. The SPI stuff should be fine by default but you need to find where PI pin 22 goes. pin 22 on the standard Pi gpio header maps on the Odroid C4 as below on ubuntu focal or debian bullsye based installs:

                  root@# gpioinfo 
                  gpiochip0 - 16 lines:
                          .
                          .
                          .
                  
                  gpiochip1 - 86 lines:
                          .
                          .
                          .
                  
                          line  68:     "PIN_22"       unused   input  active-high 
                               .
                               .
                               .
                  

                  So install the duet software as normal and it will error out due to the config being wrong. Then edit
                  /opt/dsf/conf/config.json
                  and replace the lines for:

                  "GpioChipDevice": "/dev/gpiochip1",
                    "TransferReadyPin": 68,
                  

                  Your's may be diffrent depending on what the output of gpioinfo was. then reinstall the duet software and it should make the connection the board and start up.

                  You'll also have to adjust the SPI Buffer by adding

                  options spidev bufsiz=8192
                  

                  to
                  /etc/modprobe.d/spidev.conf

                  Reboot the Odroid and all should work just like the Pi. If for some reason the Duet software is messed up from the failed install just reinstall.

                  yes i got it 🙂
                  thx
                  but on odroid buster i cant find
                  /etc/modprobe.d/spidev.conf

                  i set "spidev bufsiz=8192" in the boot.ini (bootsarg)
                  is this o or should i create the spidev.conf ?

                  undefined 1 Reply Last reply 8 Nov 2021, 22:04 Reply Quote 0
                  • undefined
                    Nurgelrot @joeko
                    last edited by 8 Nov 2021, 22:04

                    @joeko Setting it as an argument to boot is fine too if that's working for you.

                    undefined 1 Reply Last reply 8 Nov 2021, 22:09 Reply Quote 0
                    • undefined
                      joeko @Nurgelrot
                      last edited by 8 Nov 2021, 22:09

                      @nurgelrot said in RRF install failure with Hardkernel Odroid C4 as the SBC:

                      @joeko Setting it as an argument to boot is fine too if that's working for you.

                      thank you 🙂
                      i like odroid sbc. running with emmc and with Exec On MCode setting i shut down the sbc with M7722

                      undefined 1 Reply Last reply 9 Nov 2021, 10:48 Reply Quote 0
                      • undefined
                        o_lampe @joeko
                        last edited by 9 Nov 2021, 10:48

                        @joeko said in RRF install failure with Hardkernel Odroid C4 as the SBC:

                        with Exec On MCode setting i shut down the sbc with M7722

                        Shut down isn't hard, but how do you restart it? I have an remote controlled mains adapter to switch the odroid powersupply off/on to restart...

                        undefined undefined 2 Replies Last reply 9 Nov 2021, 17:06 Reply Quote 0
                        • undefined
                          Nurgelrot @o_lampe
                          last edited by 9 Nov 2021, 17:06

                          @o_lampe Simple I never turn mine off 🙂 use the odroid and Node-RED to run all the relays to start the printers/cameras etc... So at least one SBC is always on- usually just leave them all on and power down the printers.

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            joeko @o_lampe
                            last edited by 9 Nov 2021, 19:15

                            @o_lampe said in RRF install failure with Hardkernel Odroid C4 as the SBC:

                            @joeko said in RRF install failure with Hardkernel Odroid C4 as the SBC:

                            with Exec On MCode setting i shut down the sbc with M7722

                            Shut down isn't hard, but how do you restart it? I have an remote controlled mains adapter to switch the odroid powersupply off/on to restart...

                            you can restart the sbc also on this way. create an new service and call him reboot. modify the lines from poweroff to reboot andfrom M7722 to M7723 and than you can reboot with M7723. also updates over the sbc should be possible

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Unless otherwise noted, all forum content is licensed under CC-BY-SA