Legato 18.04.4: compilation fails for targe "red_wp85"

Hello,

I have tried to set up a Ubuntu Dev Machine for Mangoh Red develompemnt by following the Mangoh Red Getting Started guide published on Mangoh.io.
I have tried to do so both on a native Linux Ubuntu and on Virtual Box Linux Ubuntu. In both case I use Ubuntu 16.04.4 LTS.
The installation fails in the same way. I have the logs for the whole installation process.

The error that leads to the compilation failure is:

4/968] Build kernel driver module
FAILED: make -C /home/acal/mangOH/build/red_wp85/modules/0-iio
make[1]: Entering directory ā€˜/home/acal/mangOH/build/red_wp85/modules/0-iioā€™
make -C /opt/swi/y17-ext-wp85/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel M=/home/acal/mangOH/build/red_wp85/modules/0-iio modules
make[2]: Entering directory ā€˜/opt/swi/y17-ext-SWI9X15Y_07.12.14.00/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernelā€™
CC [M] /home/acal/mangOH/build/red_wp85/modules/0-iio/industrialio-core.o
/home/acal/mangOH/linux_kernel_modules/iio/industrialio-core.c:73:10: error: ā€˜IIO_GASRESISTANCEā€™ undeclared here (not in a function)
[IIO_GASRESISTANCE] = ā€œgasresistanceā€,
^
/home/acal/mangOH/linux_kernel_modules/iio/industrialio-core.c:73:9: error: array index in initializer not of integer type
[IIO_GASRESISTANCE] = ā€œgasresistanceā€,
^
/home/acal/mangOH/linux_kernel_modules/iio/industrialio-core.c:73:9: error: (near initialization for ā€˜iio_chan_type_name_specā€™)
scripts/Makefile.build:308: recipe for target ā€˜/home/acal/mangOH/build/red_wp85/modules/0-iio/industrialio-core.oā€™ failed
make[3]: *** [/home/acal/mangOH/build/red_wp85/modules/0-iio/industrialio-core.o] Error 1
Makefile:1276: recipe for target ā€˜module/home/acal/mangOH/build/red_wp85/modules/0-iioā€™ failed
make[2]: *** [module/home/acal/mangOH/build/red_wp85/modules/0-iio] Error 2
make[2]: Leaving directory ā€˜/opt/swi/y17-ext-SWI9X15Y_07.12.14.00/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernelā€™
Makefile:20: recipe for target ā€˜allā€™ failed
make[1]: *** [all] Error 2
make[1]: Leaving directory ā€˜/home/acal/mangOH/build/red_wp85/modules/0-iioā€™
[4/968] Build kernel driver module
make[1]: Entering directory ā€˜/home/acal/mangOH/build/red_wp85/modules/0-ltc294xā€™
make -C /opt/swi/y17-ext-wp85/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernel M=/home/acal/mangOH/build/red_wp85/modules/0-ltc294x modules
make[2]: Entering directory ā€˜/opt/swi/y17-ext-SWI9X15Y_07.12.14.00/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernelā€™
CC [M] /home/acal/mangOH/build/red_wp85/modules/0-ltc294x/ltc2941-battery-gauge.o
LD [M] /home/acal/mangOH/build/red_wp85/modules/0-ltc294x/0-ltc294x.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/acal/mangOH/build/red_wp85/modules/0-ltc294x/0-ltc294x.mod.o
LD [M] /home/acal/mangOH/build/red_wp85/modules/0-ltc294x/0-ltc294x.ko
make[2]: Leaving directory ā€˜/opt/swi/y17-ext-SWI9X15Y_07.12.14.00/sysroots/armv7a-vfp-neon-poky-linux-gnueabi/usr/src/kernelā€™
make[1]: Leaving directory ā€˜/home/acal/mangOH/build/red_wp85/modules/0-ltc294xā€™
ninja: build stopped: subcommand failed.
Makefile:67: recipe for target ā€˜red_wp85ā€™ failed
make: *** [red_wp85] Error 1

More details:
I am using the toolchain for WP8548 & WP75xx Firmware Release 15, that is: SWI9X15Y_07.12.14.00. The actual script file I downloaded from the source is: poky-swi-ext-glibc-x86_64-meta-toolchain-swi-ext-armv7a-vfp-neon-toolchain-swi-ext-1.7.3.sh
I also tried with and without the steps suggested in the ā€œ~/mangOH/README.mdā€ file: same failure.

thanks for your help
BR
Luigi

PS: in the same environment, the compilation for target ā€œgree_wp85ā€ works just fine

Hi Luigi,

I had exectly the same problem. Build works for mangoh green but not for red and stops exactly there. I ended up using the makefile from two months ago. I am not sure if it messes up anything but it seems to workā€¦Letā€™s keep in touch!

tom

Hi Tom,

thanks for sharing.
Which version of the makefile works for you?

BR
Luigi

Hi,

I have used the ā€œmangOH.sdefā€ and the ā€œMakefileā€ from here


Let us know what you experience.

tom

I believe I have fixed it in a mangOH repository commit that I just pushed.

Basically the problem was that the iio kernel module was changed to depend on an enum definition that doesnā€™t exist in the wp75/85 kernel. For the 76/77, iio is already built into the kernel, so the change to the iio kernel module within the mangOH repository had no effect. As a quick fix, I have added an #ifdef to make sure that the undefined symbol isnā€™t referenced.

A better solution might involve moving the IIO headers out of tree as well. I need to think about that some more thoughā€¦

1 Like

Hello,

I just tried to recompile with the latest commit of the Mangoh repository (3b57736) and I can confirm that the compilation went completely ok!!!
Well done!

thanks for the very quick response

BR
Luigi