Skip to content

uart: nrfx_uarte: babblesim address conversion error #108476

@JordanYates

Description

@JordanYates

Describe the bug

UART instances initialize the timer_regs variable either from a hardware address via a timer property reference or directly from a NRF_TIMER{N} macro, if a CONFIG_UART_0_NRF_HW_ASYNC_TIMER kconfig exists.

.timer_regs = COND_CODE_1(UARTE_HAS_PROP(idx, timer), \
(UARTE_TIMER_REG(idx)), \
(COND_CODE_1(CONFIG_UART_##idx##_NRF_HW_ASYNC, \
(NRFX_CONCAT(NRF_TIMER, CONFIG_UART_##idx##_NRF_HW_ASYNC_TIMER)), \
(NULL)))), \

For babblesim, these two addresses are not equivalent, NRF_TIMER{N} is a pointer to the simulated peripheral in RAM, the hardware address is some invalid memory on the simulated platform. The driver attempts to map the hardware address back to the simulated peripheral:

if (cfg->timer_regs != NULL) {
((struct uarte_nrfx_config *)dev->config)->timer_regs =
nhw_convert_periph_base_addr(cfg->timer_regs);
}

But in the case where the pointer is already the simulated peripheral, this fails, instead setting cfg->timer_regs to NULL.

Regression

  • This is a regression.

Steps to reproduce

No response

Relevant log output

d_03: @00:00:00.000000 ERROR: (modules/bsim_hw_models/nrf_hw_models/src/HW_models/NHW_misc.c:85): Could not find real peripheral addr 0x81c31d8

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

  • Zephyr v4.4.0

Additional Context

Introduced in 6e65fbe

Metadata

Metadata

Assignees

Labels

bugThe issue is a bug, or the PR is fixing a bugplatform: nRF BSIMNordic Semiconductors, nRF BabbleSimpriority: lowLow impact/importance bug

Type

Projects

Status

To triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions