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

Problem with PWM and Timer simultaneous with WS2812B leds

I'm using nRF52832 SDK board with softdevice s132_nrf52_5.0.0 and SDK 14.2. The program compile without an error. I tested the led and timer separately and these work.

When the timer throws the timeout_handler and try to send pwm to set ws2812b leds, the program crashed.

<error> app: ERROR 3735928559 [Unknown error code] at C:\Nordic_Semi\nRF5_SDK_14
.2.0_17b948a\components\drivers_nrf\pwm\nrf_drv_pwm.c:286

when I comment the part code of to send pwm to leds, it works fine.

static void animation_timeout_handler(void * p_context)
{   

 //set_pixel_RED(0);
 //nrf_drv_WS2812_show(); //error, send pwm to leds.

 NRF_LOG_INFO("animation_counter %d", counter_iteration);
 counter_iteration--;
 if(counter_iteration<=0){
    stop_animation_timer();
    counter_iteration = ITERATION_MAX;
 }   
}

I'm using app_timer.h in timer, and nrf_drv_pwm.h to pwm0.

Parents
  • Hi,

    If you convert 3735928559 to hex value, you get the code DEADBEEF. This is typically a assert from the SoftDevice. This could happen if you are using e.g a peripheral with restricted access(The SoftDevice need e.g. TIMER0), or if you are calling a SoftDevice function from a high interrupt priority.

    Could you post the code for the nrf_drv_WS2812_show() function? If we look at line 286 in nrf_drv_pwm.c, we have this line:

    ASSERT(p_cb->state != NRF_DRV_STATE_UNINITIALIZED);
    

    This means that you are trying to start a nrf_drv_pwm_simple_playback(), but you have not initialized the driver with nrf_drv_pwm_init().

Reply
  • Hi,

    If you convert 3735928559 to hex value, you get the code DEADBEEF. This is typically a assert from the SoftDevice. This could happen if you are using e.g a peripheral with restricted access(The SoftDevice need e.g. TIMER0), or if you are calling a SoftDevice function from a high interrupt priority.

    Could you post the code for the nrf_drv_WS2812_show() function? If we look at line 286 in nrf_drv_pwm.c, we have this line:

    ASSERT(p_cb->state != NRF_DRV_STATE_UNINITIALIZED);
    

    This means that you are trying to start a nrf_drv_pwm_simple_playback(), but you have not initialized the driver with nrf_drv_pwm_init().

Children
No Data
Related