tintin

  • *
  • 9
Porting GCS to Raspberry Pi
« on: March 06, 2017, 12:51:34 pm »
From french forum:
I followed the "Linux - Building and Packaging" wiki

On PI2 with Raspbian and a PI3 with Ubuntu Mate it ends with the same error:
make build_sdk_install load 4.9-xxx version of gcc
But make fw_resource or make gcs asking 4.8-2015q1 version to be installed.

Any tip to lock gcc version or to update the build_sdk_install ?
Merci / Thank you

filnet

  • *****
  • 68
Re: Porting GCS to Raspberry Pi
« Reply #1 on: March 06, 2017, 06:19:11 pm »
Please tell us more. Which version of LibrePilot are you using (master, next) ?

What exact errors are you getting ?

Did you start from scratch or from an older checkout ?

tintin

  • *
  • 9
Re: Porting GCS to Raspberry Pi
« Reply #2 on: March 10, 2017, 04:32:39 pm »
Hi filnet,

I followed the wiki instructions here: https://librepilot.atlassian.net/wiki/display/LPDOC/Linux+-+Building+and+Packaging).
Checkout was done 4 days ago with git checkout next.

when I launch make build_sdk_install it loads and installs gcc-arm-none-eabi-4_9-2015q1-20150306-linux.tar.bz2
but make fw_ressourse or make gcs tells gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2 is expected.

Any idea ?

Re: Porting GCS to Raspberry Pi
« Reply #3 on: March 10, 2017, 04:56:07 pm »
I haven't built next in a while, but it would be easy to modify the makefiles.  Just change it to the later version string.

Mateusz

  • *
  • 749
Re: Porting GCS to Raspberry Pi
« Reply #4 on: March 10, 2017, 05:42:33 pm »
Regarding missing GCC or bad version. I had similar issue it was libc6-i386 missing so my system couldn't see installed binary which is i386 one.

filnet

  • *****
  • 68
Re: Porting GCS to Raspberry Pi
« Reply #5 on: March 10, 2017, 05:44:04 pm »
Did you try to build master before building next ?
Try to fully remove the build directory.

If the problem persists please provide the exact error message you get.

filnet

  • *****
  • 68
Re: Porting GCS to Raspberry Pi
« Reply #6 on: March 10, 2017, 07:34:54 pm »
Yes, the error is related to gcc arm which is needed to build the firmware.
It is very strange that one version gets installed and another version is later requested.
That's why seeing the exact error message that is produced will help...

The file where we specify which version is needed is : ./make/tools_install/gcc-arm-none-eabi.sh and there is no other place (afaik) where we specify a gcc arm version.

PS : there is a check for the presence of ARM GCC in ./make/tools.mk
The error message is wrong... Please ignore the 4.8 in the error message...
Now you need to find why gcc arm is not detected... Mateusz's message might help.


# Template to check ARM toolchain version before building targets
define ARM_GCC_VERSION_CHECK_TEMPLATE
   if ! $(ARM_SDK_PREFIX)gcc --version --specs=nano.specs >/dev/null 2>&1; then \
      $(ECHO) $(MSG_NOTICE) Please install ARM toolchain 4.8 2014q1 using \'make arm_sdk_install\' && \
      $(ECHO) $(MSG_NOTICE) Older ARM SDKs do not support new \'--specs=nano.specs\' option && \
      exit 1; \
   fi
endef
« Last Edit: March 10, 2017, 11:21:06 pm by filnet »

Mateusz

  • *
  • 749
Re: Porting GCS to Raspberry Pi
« Reply #7 on: March 10, 2017, 07:59:54 pm »
Yes, the error is related to gcc arm which is needed to build the firmware.
It is very strange that one version gets installed and another version is later requested.

The version installed is i386 binary. On RaspberryPi this cannot be executed as it is another architecture. Scripts can't detect installed version and complain or check default one.
The only way to build firmware on RPi is installing(if exists) or building gcc-arm-none-eabi for armhf. The none-eabi is the gcc used to build for bare-metal (micro-controllers) and package must be armhf to be executable on RaspberryPi architecture (armhf). So in other words it downloads gcc-arm-none-eabi which can be executed on i386 and it needs gcc-arm-none-eabi which can be executed on armhf.

But he can skip building firmware and just try building (and resolving issues) with GCS alone
Code: [Select]
make gcs

filnet

  • *****
  • 68
Re: Porting GCS to Raspberry Pi
« Reply #8 on: March 11, 2017, 12:05:49 am »
Yep, I confirm that "make gcs" will not complain about a missing arm gcc.

tintin

  • *
  • 9
Re: Porting GCS to Raspberry Pi
« Reply #9 on: March 14, 2017, 11:21:14 pm »
Thank you guys,

I am trying again, from scratch: new sd-card, a clean raspbian and my Pi2.
I will let you know if something failed or if everything passed with lot more details.

edit:
Code: [Select]
git checkout master
make -j3 build_sdk_install
Downloading https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q2-update/+download/gcc-arm-none-eabi-4_9-2015q2-20150609-linux.tar.bz2

Code: [Select]
sudo cp package/linux/45-uav.rules /etc/udev/rules.d/45-uav.rules
And a new error:
Code: [Select]
make -j3 gcs
...
compiling /home/pi/~code/librepilot/ground/gcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp
/home/pi/~code/librepilot/ground/gcs/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp:33:25: fatal error: QOpenGLWidget: Aucun fichier ou dossier de ce type
 #include <QOpenGLWidget>
                         ^
compilation terminated.
Makefile:1021: recipe for target '.obj/release-shared/opmapwidget.o' failed
make[6]: *** [.obj/release-shared/opmapwidget.o] Error 1
make[6]: Leaving directory '/home/pi/~code/librepilot/build/librepilot-gcs_release/src/libs/opmapcontrol/src/mapwidget'
Makefile:126: recipe for target 'sub-mapwidget-make_first-ordered' failed
make[5]: *** [sub-mapwidget-make_first-ordered] Error 2
make[5]: Leaving directory '/home/pi/~code/librepilot/build/librepilot-gcs_release/src/libs/opmapcontrol/src'
Makefile:38: recipe for target 'sub-src-make_first' failed
make[4]: *** [sub-src-make_first] Error 2
make[4]: Leaving directory '/home/pi/~code/librepilot/build/librepilot-gcs_release/src/libs/opmapcontrol'
Makefile:305: recipe for target 'sub-opmapcontrol-make_first-ordered' failed
make[3]: *** [sub-opmapcontrol-make_first-ordered] Error 2
make[3]: Leaving directory '/home/pi/~code/librepilot/build/librepilot-gcs_release/src/libs'
Makefile:41: recipe for target 'sub-libs-make_first-ordered' failed
make[2]: *** [sub-libs-make_first-ordered] Error 2
make[2]: Leaving directory '/home/pi/~code/librepilot/build/librepilot-gcs_release/src'
Makefile:38: recipe for target 'sub-src-make_first-ordered' failed
make[1]: *** [sub-src-make_first-ordered] Error 2
make[1]: Leaving directory '/home/pi/~code/librepilot/build/librepilot-gcs_release'
Makefile:278: recipe for target 'gcs' failed
make: *** [gcs] Error 2

Thank you again
« Last Edit: March 15, 2017, 12:14:57 am by tintin »

filnet

  • *****
  • 68
Re: Porting GCS to Raspberry Pi
« Reply #10 on: March 15, 2017, 04:59:47 pm »
As Laurent mentionned, OpenGL is not supported on Raspberry  PI.

Your best bet, at this stage, is to disable compilation of problematic libs and plugins.

Edit the file ./ground/gcs/src/libs/libs.pro and remove opmapcontrol.

Rebuild and repeat with the next failed module...

You'll have to edit ./ground/gcs/src/plugins/plugins.pro too.

Please note the various errors you get (in particular if they are not OpenGL related).