zephyr 2.9.0 led_pwm sample nrf52840 1sec blink fails

Hello,

When running the sample on nrf52840DK:

 <inf> main:   Cycle period not supported - on: 1 sec, off: 1 sec
[00:00:28.621,917] <inf> main:   Turned off, loop end
[00:00:28.642,456] <inf> main: Testing LED 0 - no label
[00:00:28.663,208] <inf> main:   Turned on
[00:00:29.682,861] <inf> main:   Turned off
[00:00:30.702,606] <inf> main:   Increasing brightness gradually
[00:00:32.744,445] <inf> main:   Blinking on: 0.1 sec, off: 0.1 sec
[00:00:37.766,326] <err> pwm_nrfx: Prescaler for period_cycles 32000000 not found.
[00:00:37.789,764] <err> main: err=-22
[00:03:56.759,429] <inf> main:   Cycle period not supported - on: 1 sec, off: 1 sec

How to change the sample so that the 1sec on 1sec off blink pattern works?

I guess it has to do with the prescaler, but how to change it?

Tested this on nrf52840DK and custom hardware with nrf52840, both zephyr 2.6.2 and 2.9.0

  • Hello,

    From first inspection it seems that the issue is that the requested cycle period is just not supported on the nRF52840. The valid prescaler values are listed here (product specification).

    First steps could be to find out if the value for period_cycles is found in the linked table, and then try to find out what the maximum value for period_cycles is from there.

    Let me know what you find out, and we'll go from there.

    Best regards,

    Maria

Related