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

Parents Reply
  • cemalb said:
    I added the error code.the program does not fail anymore. I could not understand why. So adding the error code solved everything?

    No, not exactly. you were passing in a declared variable to your error check, but you never initialized it. When you declare a variable that only means that the compiler will allocate the required memory for that variable type, it does not provide it with a value. So the variable will hold whatever value existed in the allocated memory prior to its allocation - which is pretty much random.

    When you then passed this random-valued error code to the error check it immediately failed, because it was != NRF_SUCCESS, causing your application to reset.

    I am happy to hear that your program is not failing any more, either way!

    Best regards,
    Karl

Children
Related