This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_ERROR_NO_MEM when initializing multiple app_pwm (NRF 52832/ SDK 15.2)

Hi,

I am using nRF52 DK PCA10040 to develop an application starting from the ble_app_uart example, Then I introduced PWM and SAADC from other examples, and after I verified all the functions, I disabled UART since there will be no more UART on my custom board.

NRF_ERROR_NO_MEM is returned from app_pwm_init when I initialize the third PWM instance. I was trying to instantiating three PWM instances and 1 pin for each, so I think the total PPI channel usage is 3*4 = 12. Besides, in my application, an ADC is utilized, which I think takes 1 PPI channel that makes 13 in all.  I have searched nrf_drv_ppi_channel_alloc in my project and I think there is no other PPI channel allocated... when I decrease the PWM instances to 2 then everything is fine...The following shows where the program is stuck.

Thanks.

Parents
  • Hi 

    The app_pwm library is not recommended for use on the nRF52 series. It was mainly designed for the nRF51 devices, which didn't have dedicated PWM hardware modules, and uses the TIMER and GPIOTE modules to implement PWM rather than the dedicated hardware blocks introduced in the nRF52 series. 

    On the nRF52 family I would suggest using the nrfx_pwm driver instead, giving you a total of 12 PWM channels on the nRF52832. 

    Best regards
    Torbjørn 

Reply
  • Hi 

    The app_pwm library is not recommended for use on the nRF52 series. It was mainly designed for the nRF51 devices, which didn't have dedicated PWM hardware modules, and uses the TIMER and GPIOTE modules to implement PWM rather than the dedicated hardware blocks introduced in the nRF52 series. 

    On the nRF52 family I would suggest using the nrfx_pwm driver instead, giving you a total of 12 PWM channels on the nRF52832. 

    Best regards
    Torbjørn 

Children
Related