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

How can I find source of problem?

Hi !

I'm trying to debug. I followed this video : https://www.youtube.com/watch?v=uP8RYgYGRvI&list=PLx_tBuQ_KSqGHmzdEL2GWEOeix-S5rgTV&index=7 .  But I can't completely.

the program stop at NRF_BREAKPOINT_COND in app_error_weak.c.

I used breakpoint to understand which function the error occurred after.  I guess there is a problem when setting Uart. What should I do to better interpret the problem? What can be the problem ?

The program enters the following functions respectively:

1- nrf_drv_uart_init(...);

2- nrfx_uart_init(....);

3- interrupts_enable(....)

4- NRFX_IRQ_PRIORITY_SET(nrfx_get_irq_number((void *)p_instance->p_reg), interrupt_priority);

5- nrfx_get_irq_number(.....)

I added the 5 step's photos to explain better

1)

2)

3)

4)

5)

after step 5, the program stop at at NRF_BREAKPOINT_COND in app_error_weak.c

  • Did you ever check whether any of the peripherals you are using in your project attempt to set a priority that conflicts with the priority levels reserved for the SoftDevice that I mentioned earlier?

    wdt, timer and uart are used in the project. interrupt priority level setted 6 for all of them. I think there is no conflict since softdevice 132 uses interrupt priority level 0-1-4.

  • Hi,

    I have just realized this situation. 

    The comm_params variable is used when making the initial settings for the uart. however, the initial value of the interrupt_priority element belonging to the nrf_drv_uart_config_t struct is not given while doing this setting. therefore, its initial value is 0. this conflicts with the softdevice priority value. 

    Could this be what caused the problem?

  • When I insert this line and debug it I got another error message:

    <error> app: ERROR 211843 [Unknown error code] at D:\1_1_kale_kilit_yazilim\V.1.5.9_CML\V1.5.9\V1.5.9\examples\btc_ble_peripheral\BTC_Project\timer_init.c:299 PC at: 0x000335C5
    <error> app: End of error report

  • Hello,

    cemalb said:

    its initial value is 0. this conflicts with the softdevice priority value. 

    Could this be what caused the problem?

    If you were using interrupt priority 0 for your UART, then that would definitely be a problem, yes.
    Now you are using the NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY, is this still the default value, or have you modified this? 

    cemalb said:
    <error> app: ERROR 211843 [Unknown error code] at D:\1_1_kale_kilit_yazilim\V.1.5.9_CML\V1.5.9\V1.5.9\examples\btc_ble_peripheral\BTC_Project\timer_init.c:299 PC at: 0x000335C5
    <error> app: End of error report

    It seems the error is triggered at line 299 of your 'timer_init.c' file. Which function is being called here? Could you also share the entire function being executed in line 299 of timer_init.c, so I may take a look?

    Best regards,
    Karl

  • Hi,

    If you were using interrupt priority 0 for your UART, then that would definitely be a problem, yes.
    Now you are using the NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY, is this still the default value, or have you modified this? 

    I did not change it. it is 6 by default.

    It seems the error is triggered at line 299 of your 'timer_init.c' file. Which function is being called here? Could you also share the entire function being executed in line 299 of timer_init.c, so I may take a look?

    I forgot to return the error code value for the function that caused the error. I fixed it. the error code is:

    <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at D:\1_1_xxx_xxx_xxx\V.1.5.9_CML\V1.5.9\V1.5.9\examples\xxx_ble_peripheral\XXX_Project\timer_init.c:299
    PC at: 0x000335C7
    <error> app: End of error report

    The codes in the relevant line are as follows:

    also when I cancel this line, it gives the same warning for line 285:

    I guess there was a problem while creating the timers.I use 5 more timers other than these two timers. however, there was no such problem for them.

    but how can i solve this? 

Related