you need to first “make wp77xx” successfully to compile out the legato.cwe
After that go to legato/modules/WiFi/wifi.sdef and add the
kernelModules section
(just like the yellow.sdef)
Finally you can directly download the legato.cwe
you need to first “make wp77xx” successfully to compile out the legato.cwe
After that go to legato/modules/WiFi/wifi.sdef and add the
kernelModules section
(just like the yellow.sdef)
Finally you can directly download the legato.cwe
Done! I have to use legato.cwe from build/wp77xx/ directory right?
gian
Yes, you can use “fwupdate download /tmp/legato.cwe” to update
Yes. all generated and device updated.
On device i’ve following modules and files:
/lib/modules/3.18.140/kernel/drivers/iio/imu/bmi160
/lib/modules/3.18.140/kernel/drivers/iio/imu/bmi160/bmi160.ko
/mnt/legato/system/modules/bmi160-i2c.ko
/mnt/legato/system/modules/bmi160.ko
find: /proc/3663: No such file or directory
/sys/bus/i2c/drivers/bmi160_i2c
/sys/firmware/devicetree/base/soc/pinctrl@1000000/bmi160_int2_default
/sys/firmware/devicetree/base/soc/pinctrl@1000000/bmi160_int1_default
/sys/firmware/devicetree/base/soc/i2c@78b8000/bmi160@68
/sys/firmware/devicetree/base/soc/i2c@78b8000/bmi160@68/bmi,gpio_irq
/sys/firmware/devicetree/base/soc/i2c@78b8000/bmi160@68/bmi,init-interval
/sys/firmware/devicetree/base/soc/i2c@78b8000/bmi160@68/bmi,place
/sys/module/bmi160
/sys/module/bmi160/holders/bmi160_i2c
/sys/module/bmi160_i2c
But accelerometer still dont work. Maybe drivers are not loaded.
My wifi.sdef looks like this:
#include “$LEGATO_ROOT/default.sdef”
#include “wifi.sinc”
#include “wifi_samples.sinc”
kernelModules: {
$CURDIR/linux_kernel_modules/bmi160/bmi160-i2c
$CURDIR/linux_kernel_modules/bmi160/bmi160
}
Suggest you adding most of the driver as yellow.sdef in wifi.sdef, and check dmesg and lsmod so that you will know what driver is loaded
If i include all kernel_modules:
kernelModules:
{
$CURDIR/linux_kernel_modules/mangoh/mangoh_yellow_dev
$CURDIR/linux_kernel_modules/bmi160/bmi160-i2c
$CURDIR/linux_kernel_modules/bmi160/bmi160
$CURDIR/linux_kernel_modules/rtc-pcf85063/rtc-pcf85063
$CURDIR/linux_kernel_modules/rtc_sync/rtc_sync
$CURDIR/linux_kernel_modules/bq25601/bq25601
$CURDIR/linux_kernel_modules/bq27xxx/bq27xxx_battery
$CURDIR/linux_kernel_modules/opt300x/opt300x
$CURDIR/linux_kernel_modules/expander/expander
$CURDIR/linux_kernel_modules/cp2130/cp2130
}
the compilation fails… error is in legato MakeFile on line 542.
ninja: build stopped: subcommand failed.
Makefile:542: recipe for target ‘system’ failed
make: *** [system] Error 1
gian
maybe you add it one by one and see which line makes the problem
Solved. Accel modules loaded and working.
Will continue with tests with this custom firmware to see if reboot problem is present or if keep to remain stable.
Thank you for your help (and your patience).
Regards,
Gianmaria
Nope… not working. In dmesg i dont have a load message (like this from mangoh dmesg: [ 25.967171] mangoh yellow mangoh yellow: mapping bmi160 gyro/accel/temp sensor).
This is lsmod
oot@swi-mdm9x28-wp:/etc# lsmod
Tainted: G
expander 3648 0 - Live 0xbf009000 (O)
bmi160_i2c 1646 0 - Live 0xbf005000 (O)
bmi160 4520 1 bmi160_i2c, Live 0xbf000000 (O)
this is modinfo bmi160:
root@swi-mdm9x28-wp:/etc# modinfo bmi160
filename: /lib/modules/3.18.140/kernel/drivers/iio/imu/bmi160/bmi160.ko
author: Contact contact@bosch-sensortec.com
description: driver for bmi160
license: GPL v2
alias: of:NTCbmi160*
alias: of:NTCbosch-sensortec,bmi160*
alias: i2c:bmi160
depends:
intree: Y
vermagic: 3.18.140 preempt mod_unload ARMv7 p2v8
but… this is modinfo bmi160_i2c
root@swi-mdm9x28-wp:/etc# modinfo bmi160_i2c
modinfo: module ‘/lib/modules/3.18.140/bmi160_i2c’ not found
I think i’m near…
gian
in mangoh_yellow.c under mangOH/linux_kernel_modules/mangoh/ i see code for loading drivers that is not present (naturally) in default legato version:
static struct i2c_board_info mangoh_yellow_imu_devinfo = {
I2C_BOARD_INFO("bmi160", 0x68),
};
and
/* Map the I2C BMI160 IMU for gyro/accel/temp sensor */
dev_dbg(&pdev->dev, "mapping bmi160 gyro/accel/temp sensor\n");
mangoh_yellow_driver_data.imu =
i2c_new_device(i2c_adapter_port1, &mangoh_yellow_imu_devinfo);
if (!mangoh_yellow_driver_data.imu) {
dev_err(&pdev->dev, "i2c_new_device() failed for BMI160 IMU\n");
ret = -ENODEV;
goto cleanup;
}
but i dont know how to move this initialization calls to another file.
I think the problem is right here.
regards,
Gianmaria
Did you add
$CURDIR/linux_kernel_modules/mangoh/mangoh_yellow_dev
yes… i added this line in wifi.sdef as you suggested… but with this line uncommented i receive an error during make (make wp77xx):
ninja: build stopped: subcommand failed.
Makefile:542: recipe for target ‘system’ failed
make: *** [system] Error 1
gian
You need this line
What is the full log for the compilation error
compile log attached.
compile_log.txt (72.9 KB)
I can compile with SDK swi-wp77_4.0.0 (legato 19.11.2)
This is my wifi.sdef:
#include "$LEGATO_ROOT/default.sdef"
#include "wifi.sinc"
#include "wifi_samples.sinc"
buildVars:
{
MANGOH_BOARD = yellow
MANGOH_ROOT = /home/owner/mangOH/mangOH_2-7-2019
}
kernelModules:
{
$MANGOH_ROOT/linux_kernel_modules/mangoh/mangoh_yellow_dev
$MANGOH_ROOT/linux_kernel_modules/bmi160/bmi160-i2c
$MANGOH_ROOT/linux_kernel_modules/bmi160/bmi160
$MANGOH_ROOT/linux_kernel_modules/bmm150/bmc150_magn_i2c
$MANGOH_ROOT/linux_kernel_modules/bmm150/bmc150_magn
$MANGOH_ROOT/linux_kernel_modules/rtc-pcf85063/rtc-pcf85063
$MANGOH_ROOT/linux_kernel_modules/rtc_sync/rtc_sync
$MANGOH_ROOT/linux_kernel_modules/bq25601/bq25601
$MANGOH_ROOT/linux_kernel_modules/bq27xxx/bq27xxx_battery
$MANGOH_ROOT/linux_kernel_modules/opt300x/opt300x
$MANGOH_ROOT/linux_kernel_modules/expander/expander
// $MANGOH_ROOT/linux_kernel_modules/cypwifi/cypwifi
$MANGOH_ROOT/linux_kernel_modules/cp2130/cp2130
}
It worked. Thank you.
I’m investigating the reset problem anyway to discover the root of the problem. I dont want solve this problem later or discover some imperfection after production.
My best regards,
Gianmaria