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