Skip to content

STM32WL I2C doesn't work with LPM #37414

Open
@honestech74

Description

@honestech74

Describe the bug
When enabled the low power management using CONFIG_PM, STM32WL I2C doesn't work with J-Link but sometimes works with STM32CubeProgrammer using openocd (not stm32cubeprogrammer). There is the same issue #37352.
Also It's not working when using low power STOP mode manually without CONFIG_PM.

To Reproduce
Steps to reproduce the behavior:

  1. Update the board.cmake (boards/arm/nucleo_wl55jc/board.cmake) for nucleo_wl55jc board to use J-Link
# SPDX-License-Identifier: Apache-2.0

board_runner_args(jlink "--device=STM32WL55JC" "--speed=4000" "--reset-after-load")
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset=hw")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
  1. Prepare the BME280 sensor or some I2C sensor. If you will use another sensor, please build with your sensor sample.
  2. Add CONFIG_PM to samples/sensor/bme280
  3. Build and flash to test the I2C using BME280 sensor.
west build -b nucleo_wl55jc -p auto samples/sensor/bme280
west flash
  1. Verify you are using J-Link in console logs like this
-- west flash: using runner jlink
-- runners.jlink: JLink version: 7.22b
-- runners.jlink: Flashing file: /home/honestech/zephyrproject/zephyr/build/zephyr/zephyr.hex
  1. See logs after reset the board

Expected behavior
When disabled CONFIG_PM, it works well.
When enabled CONFIG_PM, it doesn't work at all. Even if the log shows the zero values, you can't see any I2C signals on I2C lines. I have checked the I2C line using the logic analyzer.

Log

*** Booting Zephyr OS build zephyr-v2.6.0-1680-gc4079e4be29a  ***
Found device "ENVIRONMENTAL_SENSOR", getting sensor data
temp: 0.000000; press: 0.000000; humidity: 0.000000
temp: 0.000000; press: 0.000000; humidity: 0.000000
temp: 0.000000; press: 0.000000; humidity: 0.000000

Environment (please complete the following information):

  • OS: Ubuntu 18.04 LTS
  • Toolchain: 0.12.4
  • Commit SHA: c4079e4be2

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions