Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nRF5340 wrong GPIO mapping #490

Open
sw opened this issue Oct 30, 2024 · 0 comments
Open

nRF5340 wrong GPIO mapping #490

sw opened this issue Oct 30, 2024 · 0 comments

Comments

@sw
Copy link

sw commented Oct 30, 2024

nrf5340_app_hal and nrf5340_net_hal seem to have a wrong mapping of the GPIOs.

The nRF5340 has two GPIO ports:

  • P0 (pins 0 .. 31)
  • P1 (pins 0 .. 15)

Both are available on both the application core and the network core. On the application core, there are secure and non-secure variants:

  • P0_S (0x50842500)
  • P0_NS (0x40842500)
  • P1_S (0x50842800)
  • P1_NS (0x40842800)

There are at least two problems in the current implementation:

First, P1 is not available on nrf5340_app_hal.

Second, if you use P0_S on nrf5340_app_hal, pin_port will actually select P1:

#[cfg(any(feature = "5340-app"))]
Port::Port0Secure => 0x20,
#[cfg(any(feature = "52833", feature = "52840", feature = "5340-net"))]
Port::Port1 => 0x20,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant