WP77XX I2C Bus Issues Migrating from Rel14.1 to Rel15.1

I am building our firmware against release 15.1 moving from release 14.1 as these new WP7702 modules must run release 15.1.

I am able install our test system and communicate with the GPIOs and SPI bus but I’m having issues communicating with the I2C bus on our devices.

We have a TCA9546 I2C mux on our board which we have used since the initial development.  This design detail was taken from the MangOH Red dev kit.

When I connect to a new (fresh off the production line) device that has one of the new WP modules and run a i2cdetect I get the following device list:

i2cdetect -r -y 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- 04 05 06 07 -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- 6b -- -- -- --
70: -- UU -- -- -- -- 76 --

We have devices 68, 6b and 76 connected to the downstream ports of the I2C mux.  It seems like this new version of Linux has the PCA95X driver built in.  I also see the following in the logs

Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.128057] swimcu_i2c_init: start
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.848232] i2c /dev entries driver
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.849646] swimcu_i2c_probe: start 1
Jan  1 01:47:26 swi-mdm9x28-wp user.debug kernel: [    0.902020] wm8944_i2c_probe
Jan  1 01:47:26 swi-mdm9x28-wp user.debug kernel: [    0.903068] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/soc/i2c@78b8000/ioexp-mux@71[0]'
Jan  1 01:47:26 swi-mdm9x28-wp user.debug kernel: [    0.903078] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/soc/i2c@78b8000/ioexp-mux@71[0]'
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.903675] i2c i2c-4: Added multiplexed i2c bus 0
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.903895] i2c i2c-4: Added multiplexed i2c bus 1
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.904105] i2c i2c-4: Added multiplexed i2c bus 2
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.904309] i2c i2c-4: Added multiplexed i2c bus 3
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.905241] i2c i2c-4: Added multiplexed i2c bus 5
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.906193] i2c i2c-4: Added multiplexed i2c bus 6
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.907101] i2c i2c-4: Added multiplexed i2c bus 7
Jan  1 01:47:26 swi-mdm9x28-wp user.info kernel: [    0.907337] i2c i2c-4: Added multiplexed i2c bus 8
Jan  6 01:47:45 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[1431] | ERR* failed to read i2c data
Jan  6 01:47:45 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[1431] | ERR* failed to read i2c data
Jan  6 01:47:45 swi-mdm9x28-wp user.err Legato: =ERR= | wifiService[1431] | ERR* failed to read i2c data

When I rebuild the Legao image without WiFi enabled (I used kConfig to disable it) and then put the image on the BRNKL I loose access to those 3 I2C devices. You can see the output below:

root@swi-mdm9x28-wp:~# i2cdetect -r -y 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- 04 05 06 07 -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- UU -- -- -- -- -- --

I also see the following in the logs:

root@swi-mdm9x28-wp:~# logread | grep i2c
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.127750] swimcu_i2c_init: start
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.848207] i2c /dev entries driver
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.849614] swimcu_i2c_probe: start 1
Jan  1 01:16:22 swi-mdm9x28-wp user.debug kernel: [    0.902003] wm8944_i2c_probe
Jan  1 01:16:22 swi-mdm9x28-wp user.debug kernel: [    0.903055] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/soc/i2c@78b8000/ioexp-mux@71[0]'
Jan  1 01:16:22 swi-mdm9x28-wp user.debug kernel: [    0.903065] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/soc/i2c@78b8000/ioexp-mux@71[0]'
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.903662] i2c i2c-4: Added multiplexed i2c bus 0
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.903881] i2c i2c-4: Added multiplexed i2c bus 1
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.904084] i2c i2c-4: Added multiplexed i2c bus 2
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.904284] i2c i2c-4: Added multiplexed i2c bus 3
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.905229] i2c i2c-4: Added multiplexed i2c bus 5
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.906189] i2c i2c-4: Added multiplexed i2c bus 6
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.907098] i2c i2c-4: Added multiplexed i2c bus 7
Jan  1 01:16:22 swi-mdm9x28-wp user.info kernel: [    0.907331] i2c i2c-4: Added multiplexed i2c bus 8

Any thoughts on what might be causing this?

seems your rebuilt legato.cwe makes this problem, right?
BTW, why do you need to rebuild the legato.cwe?

Hi @jyijyi

Yes, I need to rebuild the legato.cwe. This has been part of our process for the last 4 years with the WP85 since 2017 and WP77 since 2021.

There are several services that are included in the prebuilt image that I don’t require and for some of WP SKUs they cause the image to be to large to fit into the RO are when combined with our firmware.

This problem is occurring without our firmware or apps being loaded onto the device. I’m just building legato from ./leaf-data/current/wp77xx-legato with Wifi disabled and this issue occurs. I don’t need or want WiFi as there isn’t any WiFi hardware on our devices.

Thanks,

if you build without any modification on legato by “make wp77xx”, will it have the i2c problem?

I did try that and the I2C worked. Ideally I don’t want to modify Legato but when I try building our firmware using mksys against the unmodified Legato it fails saying that I don’t have the WiFi service.

While I need to rebuild Legato, we do this do add our on version tag, I don’t have a need to modify the configuration of Legato. I just need to build against our firmware.

Thanks,

sorry, I still don’t understand why you need to disable the WIFI service…

when I try building our firmware using mksys against the unmodified Legato it fails saying that I don’t have the WiFi service.

didn’t the unmodified legato should have the wifi service?

BTW, if you say your legato in R14.1 has no problem, can you load it to your module now on R15.1?

@jyijyi Sorry, I wasn’t clear. Yes, the unmodified legato has the WiFi service. But when I build firmware using mksys it fails saying the WiFi service is missing as or .sdef doesn’t include the service. I don’t want to disable the WiFi service, I just want my firmware to build against unmodified Legato and it wouldn’t until I disabled that service.

Unfortunately I already tried running R14.1 on these modules but the have been locked and can’t be downgraded since they have a new memory driver not present in R14.1.

as you say that “make wp77xx” is working fine, how about adding your app to wifi.sdef and build the legato.cwe

In this case, you don’t need to use mksys

@jyijyi My device doesn’t have any WiFI hardware on it and our firmware is very close to the 8MB in size as it has several apps in it. I would have stayed with R14.1 but that wasn’t possible as these modules only support R15.1 and greater.

Have you loaded the r14.1 to your module?
Can you type at!bsinfo on these module?
It will show the flash type

At!entercnd=“A710”
At!bsinfo

E.g.

Btw, can you double check if “make wp77xx” will call mksys?

@jyijyi Here is the output of the AT command

AT!bsinfo
Product: WP7702
Revision: 40
Main:  MDM9206 (000)
Radio: WTR2965
Power: PMD9607 (002)
Flash: H27S4G8F2EKPB4      512MB x8 (173/0/0) (2048 blocks of 64 pages/block 4096B page size)

I have tried using both fwupdate and swiflash to install R14.1 on it stays at R15.1.

I can’t tell if make wp77xx is calling mksys

You can capture the log after “make wp77xx” and search mksys

Btw, Legato cwe image does not contain memory driver
So not sure if you can load the r14.1 legato image to r15.1 …
You can double check

@jyijyi I tied putting running swiflash -m wp7xx -I WP77xx_Release14.1_GENERIC_GCF_PTCRB.spk on the new module which didn’t work.

I confirmed the memory is different between the W7702 with R14.1 and the WP7702 with R15.1
The WP7702, SKU 1104214 has the following

AT!BSINFO
Product: WP7702
Revision: 40
Main:  MDM9206 (000)
Radio: WTR2965
Power: PMD9607 (002)
Flash: MT29F4G08ABBEA3W    512MB x8 (44/0/0) (2048 blocks of 64 pages/block 4096B page size)

"MT29F4G08ABBEA3W " is using the old memory

@jyijyi To be clear we are using 2 different WP modules. All the devices in the field are using WP7702 SKU 1104214 that have R14.1 and are using FLASH MT29F4G08ABBEA3W.

We just received a new production run of devices with WP7702 SKU 1104918, that have R15.1 and are using FLASH H27S4G8F2EKPB4. These new modules won’t let me install R14.1 on them. These also the modules I’m trying to get our firmware to run on but I can’t get the I2C to work.

I don’t see problem to use mksys to compile in leaf shell with “swi-wp77_6.0.1” which is using R15.1+ legato 21.05.0.
I can compile the .update file:

(lsh:wp77) owner@owner-ThinkPad-X220:~/LEAF/wp77$ ls -l ./fx30.wp77xx.update 
-rw-rw-r-- 1 owner owner 10352787 Aug 31 09:51 ./fx30.wp77xx.update

I used this command to compile:
mksys fx30.sdef -s components -t wp77xx

Here is my fx30.sdef:
fx30.sdef (2.6 KB)

@jyijyi I have spent all day continuing to troubleshoot this issue. Including the WiFi app our not including the WiFi app doesn’t make a difference as I initially thought.

It seems that R15.1is trying to communicate with something on the I2C bus at address 0x71. On our device I have a PCA9546A just like the MangOH Red and Yellow. I noticed strange access for this address on my logic analyzer. I also suspect this is why my kernel module fails to the driver for the PCA9546A.

Given the above clue I modified a PCB and changed the PCA9546A mux to address 0x73 and everything seems to work.

Any thoughts on what may be causing this conflict on 0x71?

Thanks,

Then did you still i2c problem with original legato image?

if you don’t see problem with the official legato image or your legato.cwe with original legato code, then that means there is no problem on the original image with i2c.

if you agree with this, then you need to figure out why you cannot compile with mksys.

@jyijyi Yes, the I2C problem is with the original legato image unmodified by me. It even happens with the Rel15.1.spk from source.sierrawireless.com

then seems it is different from what you mentioned at the beginning.

it is a bit confusing here, can you list a table what is working and what is not working with the hardware/firmware you are using?
Also you can disable legato framework to see if the problem is related to legato or not.

I just tried with WP76 with latest FW R17 (kernel 4.14) in mangoh red board, no problem is found:


root@fx30:~# legato stop
Stopping Legato..
DONE.
root@fx30:~#
root@fx30:~# i2cdetect -r -y 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- 04 05 06 07 -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --
root@fx30:~# cm info
root@fx30:~# ^C
root@fx30:~# legato start
Starting Legato...
root@fx30:~# cm info
Device:                        WP7605
IMEI:                          353532100012345
IMEISV:                        6
FSN:                           2A917285012345
Firmware Version:              SWI9X07Y_02.28.03.05 000000 jenkins 2019/07/08 11:04:16
Bootloader Version:            SWI9X07Y_02.28.03.05 000000 jenkins 2019/07/08 11:04:16
MCU Version:
PRI Part Number (PN):          9908705
PRI Revision:                  002.010
Carrier PRI Name:              KDDI
Carrier PRI Revision:          001.026_002
SKU:                           1104208
Last Reset Cause:              Power Down
Resets Count:                  Expected: 187    Unexpected: 0
root@fx30:~#
root@fx30:~# legato version
21.05.2.rc2_7f59219499ecf02274c4ac7575e4f8c5

I have also tried on older FW R16.3 (kernel 3.18) on WP7605 on mangoh red board, no problem is found.

root@swi-mdm9x28-wp:~# legato start
Starting Legato...
root@swi-mdm9x28-wp:~# i2cdetect -r -y 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- 04 05 06 07 -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --
root@swi-mdm9x28-wp:~# cm info
Device:                        WP7605
IMEI:                          353532101712345
IMEISV:                        6
FSN:                           76238530612345
Firmware Version:              SWI9X07Y_02.28.03.05 000000 jenkins 2019/07/08 11:04:16
Bootloader Version:            SWI9X07Y_02.28.03.05 000000 jenkins 2019/07/08 11:04:16
MCU Version:
PRI Part Number (PN):          9908705
PRI Revision:                  002.010
Carrier PRI Name:              KDDI
Carrier PRI Revision:          001.026_002
SKU:                           1104208
Last Reset Cause:              Power Down
Resets Count:                  Expected: 50     Unexpected: 1
root@swi-mdm9x28-wp:~# uname -r
3.18.140
root@swi-mdm9x28-wp:~# legato version
19.11.6_225ac9b7882467c5c7f9e0bf4cdb5523
root@swi-mdm9x28-wp:~# legato stop
Stopping Legato.
DONE.
root@swi-mdm9x28-wp:~# i2cdetect -r -y 4
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- 04 05 06 07 -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 --