Skip to content

drivers: TI cc13xx_cc26xx: build error when PM is enabled (serial, entropy, spi, i2c modules) #35916

@niflostancu

Description

@niflostancu

Describe the bug
Latest Zephyr fails to build for CC13xx/26xx based boards (e.g., cc1352r1_launchxl) when power management is enabled.

The compiler complains that several pm/pm.h symbols were not defined (e.g., pm_constraint_set, PM_STATE_STANDBY).
I believe it was introduced by the following commits:

  • 3863be0 drivers: replace power/power.h with pm/device.h
  • 3f87c5a power: Rename constraint API

Note that many cc13xx/26xx driver modules have this problem: uart, entropy, i2c, spi ... maybe more.

To fix, I locally patched my Zephyr and added:

#include <pm/pm.h>

If this is the officially accepted fix, I can come later with a pull request. Though you should manually check those commits and see whether other modules (i.e., non-CC13xx/26xx) were affected.
Thanks.

To Reproduce
Steps to reproduce the behavior:

  1. cd zephyr/samples/subsys/shell/shell_module/
  2. west build --pristine -b cc1352r1_launchxl -- -DCONFIG_PM=y
  3. error :((

Expected behavior
Compilation to be successful.

Logs and console output

zephyr/drivers/serial/uart_cc13xx_cc26xx.c:247:17: warning: implicit declaration of function 'pm_constraint_set' [-Wimplicit-function-declaration]
zephyr/drivers/serial/uart_cc13xx_cc26xx.c:247:35: error: 'PM_STATE_STANDBY' undeclared (first use in this function)
...

Environment (please complete the following information):

  • OS: Arch Linux
  • Toolchain: arm-none-eabi-gcc (Arch Repository) 11.1.0
  • Commit: 951e72b

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions