Skip to content

TFM: Nordic pinctrl consumers broken #77185

@JordanYates

Description

@JordanYates

Describe the bug

The TFM and Zephyr repositories have mismatched views on how the pinctrl uint32_t is constructed.

https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/069455be098383bf96eab73e3ff8e0c66c60fa5a/platform/ext/target/nordic_nrf/common/core/common/nrf-pinctrl.h#L9-L20

/*
* The whole nRF pin configuration information is encoded in a 32-bit bitfield
* organized as follows:
*
* - 31..18: Pin function.
* - 17: Clockpin enable.
* - 16: Pin inversion mode.
* - 15: Pin low power mode.
* - 14..11: Pin output drive configuration.
* - 10..9: Pin pull configuration.
* - 8..0: Pin number (combination of port and pin).
*/

The pinctrl values are consumed by the TFM USART driver:
https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/069455be098383bf96eab73e3ff8e0c66c60fa5a/platform/ext/target/nordic_nrf/common/core/cmsis_drivers/Driver_USART.c#L56-L74

Introduced in:

This was probably missed because NRF_FUN_UART_TX is 0, so the shift in bits doesn't affect this one pin.
The flow control and RX pins are currently broken.

The first PR is present in Zephyr v3.7.0, so the LTS driver does not currently work as expected.

Expected behavior

TFM and Zephyr need the same view on pinctrl, as TFM consumes the values created by the Zephyr build system.

Impact

Nordic TFM consumers of pinctrl are currently broken.

Environment (please complete the following information):

  • Zephyr v3.7.0

Metadata

Metadata

Labels

BackportBackport PR and backport failure issuesarea: TF-MARM Trusted Firmware-M (TF-M)bugThe issue is a bug, or the PR is fixing a bugplatform: nRFNordic nRFxpriority: lowLow impact/importance bug

Type

Projects

Status

Backlog

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions