zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.44k stars 6.4k forks source link

LORA Module crashes SHT3XD sensor. #38177

Closed alfonsotames closed 2 years ago

alfonsotames commented 3 years ago

Describe the bug Adding the LORA module (CONFIG_LORA=y) in prj.conf crashes I2C.

To Reproduce Add the Lora module to any project that uses I2C (tested on a nucleo_wl55jc) using sensor sht3xd:

Add CONFIG_LORA=y to file zephyr/samples/sensor/sht3xd/prj.conf

I2C will not read from the sensor anymore.

Expected behavior LORA should work alongside any module, including I2C.

Impact Projects cannot use LORA + I2C (maybe other modules).

Logs and console output

Without LORA module:

*** Booting Zephyr OS build zephyr-v2.6.0-1397-g7d07a941faf4  ***
SHT3XD: 23.54 Cel ; 53.69 %RH
SHT3XD: 23.58 Cel ; 53.71 %RH
SHT3XD: 23.57 Cel ; 53.74 %RH
SHT3XD: 23.54 Cel ; 53.71 %RH
SHT3XD: 23.57 Cel ; 53.69 %RH

With LORA module:


*** Booting Zephyr OS build zephyr-v2.6.0-1397-g7d07a941faf4  ***
SHT3XD:  Cel ;  %RH
SHT3XD:  Cel ;  %RH
SHT3XD:  Cel ;  %RH
SHT3XD:  Cel ;  %RH
SHT3XD:  Cel ;  %RH
SHT3XD:  Cel ;  %RH

Environment (please complete the following information):

cfriedt commented 3 years ago

@erwango - may be fairly specific to stm

alfonsotames commented 3 years ago

I tried the same with the BME280 sensor and it doesn't crash. Seems to work fine. Something is going on with the SHT3DX sensor.

Mani-Sadhasivam commented 3 years ago

@alfonsotames I think this issue is specific to STM32WL platform or the sensor as lora driver should not interfere with other peripherals. @erwango @fabiobaltieri any ideas?

Mani-Sadhasivam commented 3 years ago

@alfonsotames To help debugging, can you please share the SHT3DX overlay?

fabiobaltieri commented 3 years ago

Weird, I have a board with an STM32WLE5 (the Seeed Lora-E5 modules), couple SPI devices and an I2C EEPROM... I2C is working fine. Maybe a pinmux misconfiguration that breaks the i2c when LoRa is enabled?

erwango commented 2 years ago

@alfonsotames Did you make any progress in identifying the root cause of the issue you're seeing ?

alfonsotames commented 2 years ago

For my project, I had to stop using CONFIG_NEWLIB_LIBC=y

That did the trick but I don't know how it is related and why it conflicts with the LoRa module.

On Wed, 22 Sept 2021 at 02:41, Erwan Gouriou @.***> wrote:

@alfonsotames https://github.com/alfonsotames Did you make any progress in identifying the root cause of the issue you're seeing ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zephyrproject-rtos/zephyr/issues/38177#issuecomment-924669091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK75QSUTUPCZJBJCG2CTRDUDGCC5ANCNFSM5DETGKFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

erwango commented 2 years ago

@alfonsotames I'm not sure we have enough info to debug this point, so I propose to close for now, since you've found a workaround. Don't hesitate to re-open if you find new elements.