nRF54LM20A, NCS v3.4.0: ESB only in the rest of each 20 ms period – esb_init()/esb_disable(), or Timeslot?

Before buying two nRF54LM20-DKs, I need to know which way is supported. Our own protocol uses RADIO directly: in each 20 ms period a SYNC goes out at 30 µs, started by a TIMER through DPPI, followed by slots up to 13.6 ms. In the remaining ~6 ms we want ESB (PTXLeft right arrowPRX, 2 Mbit/s, 252-byte payload, with acknowledgements), and ESB stopped 500 µs before the next period.

1. Is it supported to start and stop ESB in every period, e.g. with esb_init() and esb_disable()? How long do they take?

2. Or is the right way the "experimental support for concurrent operation of ESB with other radio protocols using the Timeslot feature" from the v3.3.0 release notes? Would our own frame then also have to run in an MPSL timeslot?

The design is open: github.com/.../NIC-Strelka

Thank you.

Parents
  • Hi,

    I'd recommend option 1:

    call esb_init() / esb_disable() every period. You keep full control of the timing and don't depend on an experimental feature.

    Kconfig:
    CONFIG_ESB=y
    CONFIG_ESB_DYNAMIC_INTERRUPTS=y
    CONFIG_DYNAMIC_INTERRUPTS=y
    CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y
    CONFIG_MPSL_FEM_ONLY=y
    # CONFIG_ESB_CLOCK_INIT is not set

    Dynamic interrupts let you swap in your own RADIO ISR between esb_disable() and esb_init(). With MPSL_FEM_ONLY set, MPSL is never initialized and doesn't reserve RADIO or TIMER10. Keep ESB_CLOCK_INIT off and hold HFXO on yourself for the whole period. Otherwise every esb_disable() stops HFXO and you pay the startup time again on the next init. 

    What to take care of:

    Peripherals:
    TIMER10: ESB uses it and reprograms it for every transaction. Run your 20 ms period from GRTC or a TIMER2x (via PPIB) instead. You can use TIMER10 for your own frame after esb_disable().
    DPPIC10 channels and EGU10 channels 6–8: ESB allocates its DPPI channels with nrfx_gppi in esb_init() and frees them in esb_disable(). Allocate yours through nrfx_gppi too so they don't collide.

    Hand-over: before esb_init(), leave RADIO clean: SHORTS, INTEN and your PUBLISH/SUBSCRIBE settings cleared.

    Re-init side effects: esb_init() resets several things every period:
    Addresses: reset to the ESB defaults. Call esb_set_base_address_0/1(), esb_set_prefixes(), esb_set_rf_channel() and esb_set_tx_power() again.
    FIFOs: flushed. Re-queue any pending TX and ACK payloads.
    Duplicate detection (PID): reset. Use a sequence number at the application level if duplicates matter.

    Stopping in time: ESB has no "stop at time T", and esb_disable() aborts a packet in flight. A 252-byte packet at 2 Mbit/s is about 1.05 ms on air, so plan on about 1.2 ms per TX+ACK attempt. Stop starting new TX about 1.3 ms before your cutoff. On the PRX, call esb_stop_rx() at the cutoff. That leaves room for about four attempts in your ~6 ms window. retransmit_delay must be longer than one TX+ACK.

    Timing: there are no published numbers for esb_init() / esb_disable(). Without ESB_CLOCK_INIT they only write registers and allocate resources. Please measure them with a GPIO toggle.

    Option 2 (CONFIG_ESB_MPSL_TIMESLOT) only makes sense if you also run a protocol that depends on MPSL, such as Bluetooth LE or 802.15.4. In that case, yes, your own frame would also have to run in an MPSL timeslot session, since MPSL then owns RADIO and TIMER10. Without such a protocol it only adds scheduling overhead and latency to ESB.

    Best regards,
    Kenneth

  • Thank you, Kenneth.

    • That is clear, and option 1 is what we have written now.
      One thing we hit when building it. With your Kconfig on the Belka (CONFIG_MPSL_FEM_ONLY=y, ESB with dynamic interrupts) and MCUmgr's OS group enabled (CONFIG_MCUMGR_GRP_OS=y), NCS v3.4.0 does not link for nrf54lm20dk/nrf54lm20a/cpuapp:
      undefined reference to `mpsl_low_latency_acquire_callback'
      undefined reference to `mpsl_low_latency_release_callback'
      The map shows libmpsl.a pulled in by nrf/subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt_reboot_bt.c (mpsl_uninit). MCUMGR_GRP_OS_REBOOT_BT has no prompt and is on by default with depends on (BT || MPSL), and ESB selects MPSL even with MPSL_FEM_ONLY, while the two callbacks are defined in subsys/mpsl/init/mpsl_init.c, which FEM-only leaves out. The same condition is in v3.4.1 and v3.5.0-preview4.
      We patched the Kconfig locally to
      depends on (BT || (MPSL && !MPSL_FEM_ONLY))
      and both images build. Is that the right fix, or is there a supported way to use MCUmgr's OS group with MPSL_FEM_ONLY? With FEM-only, MPSL is never initialised, so we assume nothing needs mpsl_uninit() before a reset.


    Thank you,
    Pavel

  • Hi Pavel,

    Looks like you are right.

    If you'd rather not patch the SDK: the symbol has no prompt, but you can add one from your application's Kconfig:

    config MCUMGR_GRP_OS_REBOOT_BT
    bool "Disable Bluetooth/MPSL before MCUmgr reboot"

    and then set CONFIG_MCUMGR_GRP_OS_REBOOT_BT=n in prj.conf. MPSL itself can't be removed, since ESB uses the MPSL FEM API. With CONFIG_MPSL_FEM_ONLY=y it is only linked as a library: it is never initialized and reserves no peripherals.

    Maybe you can test it before I report it?

    Kenneth

  • Hi Kenneth,


    Tested, and it works. With the SDK's Kconfig back as shipped (our patch removed), the prompt in the application's Kconfig and CONFIG_MCUMGR_GRP_OS_REBOOT_BT=n in prj.conf, the Belka links on NCS v3.4.0 for nrf54lm20dk/nrf54lm20a/cpuapp: the symbol is off in the .config, os_mgmt_reboot_bt.c is no longer linked, and MCUMGR_GRP_OS stays on. Our other image, which runs Bluetooth LE with MPSL whole, keeps the hook on and builds as before. So far built only, not yet run on hardware.
    So please go ahead and report it; the condition is the same in v3.4.1 and v3.5.0-preview4.


    Thank you,
    Pavel

  • Hi Kenneth,

    one more, following your advice to run the 20 ms period on a TIMER2x through the PPIB. Each unit stamps the SYNC packet's arrival in hardware and steers its IMU's clock to it, so the stamp's jitter is what our common time stands on; we assume 0.5 µs.

    Since TIMER10 is ours after esb_disable(), would you rather capture the SYNC on TIMER10, in the radio domain with no bridge, and relate TIMER10 to TIMER22 by starting both from one event — or capture on TIMER22 through PPIB11→PPIB21? Does a common start through the bridge land in the same cycle every time?
    If through the bridge: how many cycles of latency, and how much variation, should we expect for a RADIO event captured on TIMER22, with and without Constant Latency mode?
    We will measure it on the DK, but would like to know what to expect.

    Thank you,

    Pavel

  • Hi Pavel,

    I’d recommend capturing the RADIO.EVENTS_SYNC directly on TIMER22 across the PPI bridge, rather than trying to juggle both TIMER10 and TIMER22. The RADIO and TIMER10 live together in the radio domain, while TIMER22 lives in the peripheral domain. Because the two timers sit in different domains, any "common start" signal would still have to cross the PPI bridge to reach one of them. You’d end up with the same bridge delay and clock-cycle uncertainty on the start edge as you would on the capture edge. On top of that, ESB re-claims and reconfigures TIMER10 every time it wakes up in your active window, which means you'd constantly have to re-synchronize and recalculate offsets. Letting TIMER22 run continuously as your single source of truth is much simpler and avoids dual-timer math altogether.

    Routing the event from RADIO.EVENTS_SYNC through DPPIC10, over the PPI bridge, and into TIMER22 via DPPIC20 should take roughly 250 to 500 ns. The cross-domain synchronizers introduce at most 1 to 2 clock cycles of variation - around 125 ns with a 16 MHz clock. That easily fits inside your 0.5 µs budget, so bridge jitter alone won't be an issue for your timing requirements.

    To avoid extra jitter that could blow past your 0.5 µs budget, the main thing to watch out for is power management. If the peripheral domain or its high-frequency clock is allowed to enter an idle or retention state while waiting for a packet, the wake-up and clock ramp-up times can introduce several microseconds of unpredictable delay. To avoid this jitter, make sure you keep Constant Latency mode active while waiting for the SYNC event. That keeps the domain clocked and ready, ensuring your capture timing stays rock-solid.

    Best regards,
    Kenneth

  • Hi Kenneth,
    thank you — that settles it. TIMER22 alone keeps the set's time now, and Constant Latency mode is held for as long as the crystal is, on every chip, no longer only for erratum 20.
    One last thing from the ESB side. 128689 is still open: two nRF54L15s on v3.0.1 and v3.3.0, the PTX apparently missing the ACKs while the PRX sends at 3 to 7 dBm. Is that a known issue in v3.4.0, or one fixed since? Our units will be the PTX with acknowledgements on the nRF54LM20A, the base the PRX.

    Thanks you,

    Pavel

Reply
  • Hi Kenneth,
    thank you — that settles it. TIMER22 alone keeps the set's time now, and Constant Latency mode is held for as long as the crystal is, on every chip, no longer only for erratum 20.
    One last thing from the ESB side. 128689 is still open: two nRF54L15s on v3.0.1 and v3.3.0, the PTX apparently missing the ACKs while the PRX sends at 3 to 7 dBm. Is that a known issue in v3.4.0, or one fixed since? Our units will be the PTX with acknowledgements on the nRF54LM20A, the base the PRX.

    Thanks you,

    Pavel

Children
No Data
Related