Application image unable to control some GPIOs when mcuboot enabled


I'm working on the firmware for a custom board built around the nRF9151 SiP. The firmware is built against the nrf9151dk/nrf9151/ns board target included in zephyr, with an app.overlay file included to adjust peripherals to fit the function of the board. Mcuboot is also enabled to provide FOTA functionality, with the FOTA downloader being used directly (Custom solution, not using AWS/Azure/nrfcloud FOTA).

The specific issue I'm running into is that pins P0.16/P0.17 are required for use as generic GPIOs in the application image, but the firmware appears unable to correctly drive them or apply GPIO bias resistors. In testing, I determined that the pins behave as expected once mcuboot is disabled. After digging further I found the following

1. The default board definition uses P0.16/P0.17 for uart1 flow control. The aforementioned `app.overlay` file overrides this behaviour, as uart1 is used by the firmware without flow control and on different TX/RX pins. In the final merged application device tree (build/app/zephyr/zephyr.dts), the only reference to pins 16/17 are in a definition to expose them as gpios through dt.
2. In the final merged mcuboot device tree (build/mcuboot/zephyr/zephyr.dts), the uart1 definition from `app.overlay` is not applied, and the pins appear as uart flow control pins again
3. Enabling the device tree significantly changes the read result from the NS GPIO OUT memory mapped register (`0x40842500 + 0x004`, pg 167 of the v1.1 datasheet for this chip). Without mcuboot, the pinouts are read as `0x00540000`. When mcuboot is enabled the pinouts are read as `0x28554000`. Nothing in the application changes besides commenting out FOTA and bootloader feature from `prj.conf` and `sysbuild.conf`.

Finally, in trying to find existing problems in this vein, I found this thread Image booted by custom child image cannot control GPIOs, where the given solution is to update the custom overlay, and to set `CONFIG_TFM_LOG_LEVEL_SILENCE=y` in `prj.conf`. I've already taken both of these steps, and the problem persists.

I would appreciate any guidance for whether my analysis of the root cause here is correct, and help in making configuration changes to fix it.

Parents Reply Children
No Data
Related