8 Replies Latest reply on Mar 24, 2014 4:27 AM by radiatortwo

    Hard Float on RIoTboard

    audumla

      It appears that freescale do not have a hard float linux released. This limits the platform significantly. Can anyone at Element14 please put pressure  on freescale, or better yet compile their own version of linux with the enabled? Without this the usefulness of the board as an embedded platform is limited as many libraries and frameworks are only building against hard float.

      Thanks.

        • Re: Hard Float on RIoTboard

          What of the Linux download from http://riotboard.org/index.php/download is it soft float ?

           

          Personally, I ran through http://www.linuxfromscratch.org/ to build my own system with the settings I wanted.

           

          Which libraries and frameworks ?  Examples ?   If you have source to these libraries I think it's very likely you can build them for whatever you like.

          • Re: Hard Float on RIoTboard
            radiatortwo

            All you need is an RootFS partition with debian with hardfloat.

             

            You can create one with debootstrap and qemu inside a virtual machine for example. Then pack the files into a tgz and flash it to the Riotboard.

             

            No need to compile the whole System from scratch.

             

            If you need directions for this just ask.

              • Re: Hard Float on RIoTboard
                czudekm

                Hello, may I ask you for a little help with creating rootfs using debootstrap? I managed to download ubuntu rootfs using debootstrap, but I was not able to run qemu with compiled kernel 3.0.35 for RiotBoard. I tried kernel from ubuntu sites Index of /ubuntu-ports/dists/precise/main/installer-armel/current/images/linaro-vexpress/netboot which works in qemu, but when I finished debootstrap --second-stage, tarball rootfs and flash it to RiotBoard, during boot it hangs with message Freeing init memory: 212K

                 

                So if you are able to write some steps how to go through this. It would be nice.

                 

                Thank you

                  • Re: Hard Float on RIoTboard
                    radiatortwo

                    I didn´t test it with the Ubuntu rootfs system by now. I did it with Debian.

                    Also I used the precompiled Kernel you get with the Ubuntu Linux Image.

                     

                    Here are the steps I did to create the rootfs. (I have a Windows System with a Debian VMWare Virtual Machine to create and then flash it)

                     

                    1. Get the needed packages in the host system

                     

                    apt-get install qemu-user-static debootstrap binfmt-support

                     

                    2. Set the evironment variables then create the directory and download the basic Debian system

                    targetdir=rootfs

                    distro=wheezy

                     

                    mkdir rootfs

                    debootstrap --arch=armhf --foreign $distro $targetdir

                     

                    3. Copy the qemu-arm-static-binary into the created system and the resolv.conf from the host

                     

                    cp /usr/bin/qemu-arm-static $targetdir/usr/bin/

                    cp /etc/resolv.conf $targetdir/etc

                     

                    4. Change into the new rootfs system

                     

                    chroot $targetdir

                     

                    5. In the new rootfs system we need to set the variables again

                     

                    distro=wheezy

                    export LANG=C

                     

                    6. Execute second stage

                     

                    /debootstrap/debootstrap --second-stage

                     

                    7. We need a sources.list and some settings.

                    Change the locale in the URLs in the following script to your locale:

                     

                    cat <<EOT > /etc/apt/sources.list

                    deb http://ftp.de.debian.org/debian $distro main contrib non-free

                    deb-src http://ftp.de.debian.org/debian $distro main contrib non-free

                    deb http://ftp.de.debian.org/debian $distro-updates main contrib non-free

                    deb-src http://ftp.de.debian.org/debian $distro-updates main contrib non-free

                    deb http://security.debian.org/debian-security $distro/updates main contrib non-free

                    deb-src http://security.debian.org/debian-security $distro/updates main contrib non-free

                    EOT

                     

                    cat <<EOT > /etc/apt/apt.conf.d/71-no-recommends

                    APT::Install-Recommends "0";

                    APT::Install-Suggests "0";

                    EOT

                     

                    8. Update the lists

                    (You´ll get some ignored lines because we didn´t set up the locales by now.)

                     

                    apt-get update

                     

                    9. Setup the missing locales and update again

                    (The ignored lines should be pulled now)

                     

                    apt-get install locales dialog

                    dpkg-reconfigure locales

                    apt-get update

                     

                    10. Now we have basically installed all we need, but I like to install some useful stuff.

                     

                    apt-get install openssh-server ntpdate

                     

                    11. Set the root password

                     

                    passwd

                     

                    12. We need at least an DHCP connection on eth0 (configure as you like)

                     

                    echo <<EOT >> /etc/network/interfaces

                    allow-hotplug eth0

                    iface eth0 inet dhcp

                    EOT

                     

                    13. We need a hostname (Change as you like)

                     

                    echo debian-armhf > /etc/hostname

                     

                    14. We can quit the chroot shell now

                     

                    exit

                     

                    15. We need to remove the files we copied into the system

                     

                    rm $targetdir/usr/bin/qemu-arm-static

                    rm $targetdir/etc/resolv.conf

                     

                    16. We now have a fully functional rootfs system and can put it into a tgz file

                    Notice the parameter p in the tar command. This means the permissions stay like they are inside the rootfs. This is very important!

                     

                    cd rootfs

                    tar cvzpf oneiric.tgz *

                     

                    Now you can flash the file by replacing it inside the files folder in the standard linux image with MFGTools.

                      • Re: Hard Float on RIoTboard
                        czudekm

                        Thank you very much for your guide. I followed your solution which lead me to bootable rootfs, but unfortunately when system starts booting on my RiotBoard it hangs after loading openssh and die on that place. Have you experienced this kind of state?

                         

                        Freeing init memory: 208K
                        INIT: version 2.88 booting
                        [info] Using makefile-style concurrent boot in runlevel S.
                        [ ok ] Starting the hotplug events dispatcher: udevd.
                        [ ok ] Synthesizing the initial hotplug events...done.
                        [....] Waiting for /dev to be fully populated...ERROR: v4l2 capture: slave not found!
                        ----mx6_csi0_cam_powerdown 0
                        --------Setting mclk to 24 MHz
                        ov2656_read_reg:write reg error:reg=300a
                        ----mx6_csi0_cam_powerdown 1
                        done.
                        [ ok ] Activating swap...done.
                        [warn] Creating compatibility symlink from /etc/mtab to /proc/mounts. ... (warning).
                        [ ok ] Cleaning up temporary files... /tmp.
                        [ ok ] Activating lvm and md swap...done.
                        [....] Checking file systems...fsck from util-linux 2.20.1
                        done.
                        [ ok ] Mounting local filesystems...done.
                        [ ok ] Activating swapfile swap...done.
                        [ ok ] Cleaning up temporary files....
                        [ ok ] Setting kernel variables ...done.
                        [ ok ] Configuring network interfaces...done.
                        [ ok ] Cleaning up temporary files....
                        INIT: Entering runlevel: 2
                        [info] Using makefile-style concurrent boot in runlevel 2.
                        [ ok ] Starting enhanced syslogd: rsyslogd.
                        [ ok ] Starting periodic command scheduler: cron.
                        [ ok ] Starting OpenBSD Secure Shell server: sshd.
                        
                          • Re: Hard Float on RIoTboard
                            radiatortwo

                            If you get to that point the system should be up and running. It says ok at Starting OpenBSD Secure Shell server: sshd. Which means the shell is started.

                             

                            You can now connect over ssh into the system.

                            If you don´t know the ip (because you´re using DHCP) you can look into your DHCP Server or Router for the ip.

                            If you can´t find it there do an IP-Scan with Advanced IP-Scanner or similar.

                            Alternatively connect it over HDMI to your monitor then login with root and your password and type in "ifconfig" to get the IP. You maybe have to reset the board to get a picture at this point.

                              • Re: Hard Float on RIoTboard
                                czudekm

                                Thank you for the hint. I was trying to access debian via ssh before, but it was not working. I thought that system died during the boot. Thanks to your hint I finally found the problem. In network configuration you used allow-hotplug eth0 I changed that to auto eth0 and than my network interface load successfully and I'm now able to login via ssh. Actually I don't know what difference is between those two configurations, but for me allow-hotplug was not working. Maybe it will help someone.

                                 

                                Thank you for your help one more time

                                  • Re: Hard Float on RIoTboard
                                    radiatortwo

                                    Strange. On my board hotplug is working.

                                     

                                    But you´re right. I used hotplug because it uses the Kernel Hotplug Event. It then won´t activate when restarting the interfaces with "/etc/intit.d/networking restart".

                                    It should be used for non static interfaces, like Wireless USB Sticks.

                                     

                                    For static interfaces the auto option is better. Maybe you didn´t get the hotplug event from the Kernel when the board started.

                                     

                                    Glad I could help and it´s working now.

                                     

                                    Edit:

                                    Just read that allow-hotplug is deprecated. Shouldn´t use it in the future...