Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Cross compile mysensors gateway

Cross compile mysensors gateway

Scheduled Pinned Locked Moved General Discussion
gatewayraspberry pi
6 Posts 4 Posters 90 Views 4 Watching
  • 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.
  • Jasper van ZuijlenJ Offline
    Jasper van ZuijlenJ Offline
    Jasper van Zuijlen
    wrote on last edited by
    #1

    Hi!

    I'm about to attempt to cross compile a gateway for Arm (raspi 1 b+) on Ubuntu. Has anymore tried that before (I could't find any posts related)? Would it be interesting to document this here as well?

    monteM 1 Reply Last reply
    0
    • Jasper van ZuijlenJ Jasper van Zuijlen

      Hi!

      I'm about to attempt to cross compile a gateway for Arm (raspi 1 b+) on Ubuntu. Has anymore tried that before (I could't find any posts related)? Would it be interesting to document this here as well?

      monteM Offline
      monteM Offline
      monte
      wrote on last edited by monte
      #2

      @Jasper-van-Zuijlen well, it took 6 minutes to compile on my Raspberry 1 B+, so no big deal, but if you will achieve cross compiling, I think documenting it here will be much appreciated :)

      1 Reply Last reply
      2
      • J Offline
        J Offline
        Jens Jensen
        wrote on last edited by
        #3

        maybe a good knowledge resource for cross-compilation against rpi targets:
        https://tttapa.github.io/Pages/Raspberry-Pi/C++-Development/Building-The-Toolchain.html

        1 Reply Last reply
        0
        • mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          I use ccache, so recompiling (which I do occasionally when I try to help forum members troubleshooting) doesn't take much time.

          1 Reply Last reply
          0
          • Jasper van ZuijlenJ Offline
            Jasper van ZuijlenJ Offline
            Jasper van Zuijlen
            wrote on last edited by
            #5

            @monte yeah, it does only take that long. I think I got sidetracked a bit 😅 I usually set up my pi by Ansible, but it's very slow. I was thinking about ways to speed that up.

            Maybe get my project working first before I dive into this. I'll post what I have so far shortly should anyone be interesed.

            Thanks for screwing my head on straight again 😁

            1 Reply Last reply
            1
            • Jasper van ZuijlenJ Offline
              Jasper van ZuijlenJ Offline
              Jasper van Zuijlen
              wrote on last edited by Jasper van Zuijlen
              #6

              As promised, what I found so far: the following dockerfile yeilds a usable cross-compile environment, provided you use it with a Makefile.

              FROM ubuntu:xenial
              
              RUN apt-get update \
                  && apt-get install --yes \
                    vim \
                    build-essential \
                    git
              
              RUN git clone https://github.com/raspberrypi/tools
              
              RUN git clone https://gist.github.com/3873805.git /build
              
              WORKDIR "/build"
              
              CMD ["/usr/bin/make", "CC=/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc"
              , "HelloWorld"]
              
              
              # Seems I need a real makefile for the above to work.
              

              For cross compiling mysensors to work, hoever, you also need to properly seed the variable in configure, for it to work correctly. This is where I left off.

              Sources:
              https://stackoverflow.com/questions/18007326/how-to-change-default-values-of-variables-like-cc-in-makefile
              https://bitbucket.org/mitchallen/pi-hello-cross-compile/src/master/
              https://desertbot.io/blog/how-to-cross-compile-for-raspberry-pi
              https://github.com/mitchallen/pi-cross-compile/blob/master/Dockerfile
              https://github.com/mysensors/MySensors/blob/development/configure
              https://github.com/raspberrypi/tools/tree/master/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin
              https://www.raspberrypi.org/documentation/linux/kernel/building.md
              https://www.mysensors.org/build/raspberry

              1 Reply Last reply
              2
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              15

              Online

              11.7k

              Users

              11.2k

              Topics

              113.0k

              Posts


              Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular