nRF52840 NCS PWM interrupt error

change pwm_handler  to NULL is OK.

How to solve this problem?

  • Hello, 

    The DevZone team is currently entering summer vacation period, some delays in answers must be expected.


    Can you please provide more information on what you trying to achieve? What application and version of the nRF Connect SDK are you working on?

    If you are working on nRF Connect SDK v2.0.0 please read the migrate note on changes in PWM API.

    Kind regards,
    Øyvnd

  • I working on nRF Connect SDK v2.0.0,

    I want to get the event NRFX_PWM_EVT_FINISHED, as like the nRF5_SDK.

    Can this problem be solved?

  • Hello, 
    Sorry for the delayed answer. What application are you working on? Can you provide more details for me to replicate?

    -Øyvind

  • Thanks for providing that information. I'm able to replicate the issue. 

    ** Booting Zephyr OS build v3.0.99-ncs1  ***<\r><\n>
    [00:00:00.254,791] <27>[0m<inf> main: Found device pwmleds<27>[0m<\r><\n>
    [00:00:00.254,791] <27>[0m<inf> main: Testing LED 0 - no label<27>[0m<\r><\n>
    [00:00:00.254,821] <27>[0m<inf> main:   Turned on<27>[0m<\r><\n>
    [00:00:01.254,943] <27>[0m<inf> main:   Turned off<27>[0m<\r><\n>
    [00:00:02.255,065] <27>[0m<inf> main:   Increasing brightness grad[00:00:02.265,197] <27>[1;31m<err> os: >>> ZEPHYR FATAL ERROR 1: Unhandled interrupt on CPU 0<27>[0m<\r><\n>
    [00:00:02.265,228] <27>[1;31m<err> os: Current thread: 0x20000730 (unknown)<27>[0m<\r><\n>
    [00:00:02.519,714] <27>[1;31m<err> fatal_error: Resetting system<27>[0m<\r><\n>
    

    Will need some time to find a solution.

    Edit: Please note. From modules\hal\nordic\nrfx\drivers\include\nrfx_pwm.h

     * @brief Function for initializing the PWM driver.
     *
     * @param[in] p_instance Pointer to the driver instance structure.
     * @param[in] p_config   Pointer to the structure with the initial configuration.
     * @param[in] handler    Event handler provided by the user. If NULL is passed
     *                       instead, event notifications are not done and PWM
     *                       interrupts are disabled.
     * @param[in] p_context  Context passed to the event handler.
     *
     * @retval NRFX_SUCCESS             Initialization was successful.
     * @retval NRFX_ERROR_INVALID_STATE The driver was already initialized.
     */
    nrfx_err_t nrfx_pwm_init(nrfx_pwm_t const *        p_instance,
                             nrfx_pwm_config_t const * p_config,
                             nrfx_pwm_handler_t        handler,
                             void *                    p_context);

    -Øyvind

Related