9 Replies Latest reply on Apr 16, 2020 5:01 PM by pmansvelder

    MaaxBoard Debian Image - Tips, Add-Ins, and Fixes

    joshb86

      Hello All,

       

      Now that we have the official Debian image for the MaaxBoard we have been tearing away at building the system for our needs. In the process we are coming across some changes and modifications that I'll log in this thread to hopefully save others some time. We are also feeding these details directly to our Avnet engineering team to hopefully help refine future image releases.

       

      I'll try to keep this as organized as possible so I'll update this initial post with quick links to future posts to help save everyone some time on reading through posts that aren't related to what they are searching for:

       

       

      Image V1.1.1.r10

       

      Identified Issues

       

      Add-Ins

       

      Tips

        • Re: MaaxBoard Debian Image - Tips and Fixes
          joshb86

          Expand Primary Partition

           

          If you're flashing the image to say a 16gb SD card, you'll notice that there isn't a first boot script yet like you see with the Rpi that will auto expand the primary partition so you can utilize all of the remaining free space of your SD. This guide will help you reclaim the free space to actually make the system usable for growth.

           

          Requirements

          • Secondary linux system (VirtualBox VM is always a good quick option)
          • SD card slot, or SD to USB adapter for host machine

           

          Once the requirements are in place, this guide will walk you through expanding the partition: https://elinux.org/RPi_Resize_Flash_Partitions#Manually_resizing_the_SD_card_on_Linux

           

          NOTE: If you currently have critical data on the card, back it up first.

            • Re: MaaxBoard Debian Image - Tips, Add-Ins, and Fixes
              kenkirch

              Great blog on Hackster.io to do this.

              Here is a shorten version of the blog.

              start Terminal

              df -h                               this will show the SD card at only 6.4g

              fdisk /dev/mmcblk0

              p                                   to show partitions, take note of the start number for the second partition ####### /dev/mmcblk0p2 it should be something like 544768

              d

              2

              n

              p

              2

              ########

              Press Enter for default last sector

              N

              w

              resize2fs /dev/mmcblk0p2

              df -h

            • Re: MaaxBoard Debian Image - Tips and Fixes
              joshb86

              Resolve APT Release File Errors

               

              The second you use apt-get to install a package you may notice a release file error such as the following...

               

              E: Release file for file:///var/lib/local-apt-repository/./Release is not valid yet (invalid for another 223d 12h 43min 26s). Updates for this repository will not be applied.

               

              The issue is actually a simple one... date/time

               

              Fix

              • Run: timedatectl set-ntp yes
              • Run: timedatectl set-timezone America/Chicago (timedatectl list-timezones will list all timezone options)
              • Run: apt-get update
              • Re: MaaxBoard Debian Image - Tips and Fixes
                joshb86

                FTDI & Usbserial Drivers for USB Serial Support

                 

                The shipped image doesn't include any USB Serial support at all. I rebuilt the kernel headers then went ahead and built a driver for FTDI support and the basic usbserial driver for linux. I've attached the drivers to this post along with quick steps on importing it so everyone doesn't have to go through the fun of building the kernel headers and drivers like I did... However I'll make a follow up post detailing the steps you need to take if you want to build new support into the current kernel.

                 

                1. SSH to your maaxboard
                2. mkdir /lib/modules/4.14.78/kernel/drivers/usb/serial
                3. chmod 775 /lib/modules/4.14.78/kernel/drivers/usb/serial
                4. Copy the attached ftdi_sio.ko and usbserial.ko files to your maaxboard (I use SCP scp files root@maaxboard-ip:/root)
                5. If you've copied the files to /root, now run cp ftdi_sio.ko usbserial.ko /lib/modules/4.14.78/kernel/drivers/usb/serial
                6. depmod
                7. Plug your device in...
                8. run dmesg and you should now see that the device was detected and attached to /dev/ttyUSB*

                 

                NOTE: usbserial.ko is required by ftdi_sio.ko

                 

                [10945.237618] ftdi_sio 3-1:1.0: FTDI USB Serial Device converter detected
                [10945.244411] usb 3-1: Detected FT232RL
                [10945.248652] usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB0

                • Re: MaaxBoard Debian Image - Tips, Add-Ins, and Fixes
                  joshb86

                  Fix corrupted libqmi-glib5 package

                  When utilizing apt you might notice an error such as:

                   

                  ldconfig: /usr/lib/aarch64-linux-gnu/libqmi-glib.so.5.4.0 is not an ELF file - it has the wrong magic bytes at the start.

                   

                  This seemed to be apparent in several instances of the shipped image. The fix is to simply reinstall the parent package libqmi-glib5:

                   

                  1. apt-get reinstall libqmi-glib5
                  • Re: MaaxBoard Debian Image - Tips, Add-Ins, and Fixes
                    joshb86

                    libIL.so.1 is not a symbolic link

                     

                    You'll notice this error from ldconfig while using apt. The solution is to install the missing parent package libdevil1c2:

                     

                    1. apt-get install libdevil1c2
                    • Re: MaaxBoard Debian Image - Tips, Add-Ins, and Fixes
                      joshb86

                      libOpenVG.so is not a symbolic link

                       

                      Another ldconfig warning you'll see when using apt is related to libOpenVG.so. This is is a bit more strange and maybe someone from embest/avnet can respond on this. The error is:

                       

                      ldconfig: /usr/lib/aarch64-linux-gnu/libOpenVG.so is not a symbolic link

                       

                      It's complaining that the lib is not a symbolic link, but if we look further we can see that the accompanied file libOpenVG.3d.so is actually the same exact file as libOpenVG.so:

                       

                      root@maaxboard:~# md5sum /usr/lib/aarch64-linux-gnu/libOpenVG*
                      6739d5a1b6fed46fd0e6b68f3457952e /usr/lib/aarch64-linux-gnu/libOpenVG.3d.so
                      6739d5a1b6fed46fd0e6b68f3457952e /usr/lib/aarch64-linux-gnu/libOpenVG.so

                       

                      I'm not sure why this is the case, or if my method is OK/correct, but you can suppress this error by renaming the file. I chose not to remove it just in case something creeps up as a need or alternate fix:

                       

                      1. mv /usr/lib/aarch64-linux-gnu/libOpenVG.so /usr/lib/aarch64-linux-gnu/libOpenVG.so.OLD
                      • Re: MaaxBoard Debian Image - Tips, Add-Ins, and Fixes
                        joshb86

                        Compiling modules/drivers for kernel 4.14.78

                         

                        Previously I shared serial related drivers that I compiled for my needs. You may come across support that's missing for your needs, so I thought I'd share how you can compile just what you need which will also lead you on the path of even building your own custom kernel if you choose.

                         

                        EDIT: I'm somehow just now seeing this... the embest dropbox has a few more details than the resource page: https://www.dropbox.com/sh/ft2o8olt88vm9mi/AAA6RN54yQq6J41JgTphgCDda/01Doc/UM?dl=0&preview=MaaXBoard-Linux-Development_Guide-V1.0-EN.pdf&subfolder_nav_tracking=1

                         

                        ^^Use that if you're compiling from a host machine.

                         

                         

                        Requirements

                        • Copy of the v1.1.1r10 source.
                        • packages for compiling

                         

                        Steps

                        1. It's actually easiest to build directly from the maaxboard unless you're proficient in correctly cross compiling from another host. If you choose to build from the maaxboard, go ahead and load the base shipped image to a dedicated SD so you're not working from within your current setup
                        2. Once the maaxboard is up, ssh as root with the default pass avnet
                        3. Fix timedate issues first mentioned HERE
                        4. Run apt-update
                        5. Install wget & unrar: apt-get install wget unrar
                        6. Install tools for building: apt-get install build-essential libncurses5-dev gcc libssl-dev bc
                        7. For simplicity sake, make sure you're in /root: cd /root
                        8. Now let's pull the source RAR from the dropbox link. Reason I suggest this is there is a higher risk of corruption if you're downloading, unpacking, uploading, unpacking... 1 hop directly to the device is best: wget https://www.dropbox.com/sh/ft2o8olt88vm9mi/AABd76gFyXGhd-cGU8RDM89la/02Linux/01LinuxSourceCode/MaaXBoard-LinuxSourceCode…
                        9. Unrar the file: unrar e rarfile.rar
                        10. Extract linux_4.14.78_develop_3d21737092eb.tar.gz: tar -zxvf tarfile.tar.gz (I can't remember if this dumps to a tar file next, if so extract it with tar xvf file.tar)
                        11. You should now have a linux directory: cd linux

                         

                        This is the directory you'll want to run all the following commands from. At this point you could build your own config, but it's best to have a starting point that you know is compatible... which is why we will load the config stored in the source directory /root/linux/arch/arm64/configs/em-sbc-imx8m_defconfig <-- copy this path since you'll need it shortly.

                         

                        1. Now we will load the ncurses menu to simplify selecting the tweaks we want to make. Run: make menuconfig
                        2. In the menu you'll notice a "load" option at the bottom. Select that and load the config we referenced above
                        3. Now you're editing the em-sbc-imx8m_defconfig. I'll build ftdi serial support in this example, but you can modify the selection process to your needs.
                        4. In my case since I'm adding in ftdi serial support I navigate to Device Drivers -> USB Support -> Enable USB Serial Peripheral Support.
                        5. Now I go into the USB Serial Peripheral Support menu and flag USB Serial Generic Support and FTDI as Modules.
                        6. Select save from the bottom menu and simply save as ".config" so you don't overwrite the default config.

                         

                        Now rather than building the entire kernel for this purpose, we only want to build the modules we've selected. We will need to specify a path in our make command and you can almost guess the path based on the menu selections we made, but you can also run: find . -name "ftdi*" to find the location of the source & header files. In this case, the path is drivers/usb/serial

                         

                        1. Compile the module: make -C . M=path (this will compile all modules in the path)

                         

                        Once completed you should now have .ko files in the same path which are the compiled modules. The last thing to do is copy them to the active module path and load them.

                         

                        1. Run: cp path/to/.ko /lib/modules/4.14.78/kernel/drivers/usb/serial
                        2. Probe/Load new modules: depmod

                         

                        Success!

                        1 of 1 people found this helpful