Open
Description
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:
- Update the board.cmake (
boards/arm/nucleo_wl55jc/board.cmake
) fornucleo_wl55jc
board to useJ-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)
- Prepare the BME280 sensor or some I2C sensor. If you will use another sensor, please build with your sensor sample.
- Add
CONFIG_PM
tosamples/sensor/bme280
- Build and flash to test the I2C using BME280 sensor.
west build -b nucleo_wl55jc -p auto samples/sensor/bme280
west flash
- 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
- 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