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

Mesh functionality in Bootloader

Hello,

I am currently attempting to include mesh functionality in a bootloader so as to have it do DFU over mesh without the serial port. I keep getting errors when trying to initialize the mesh (an ASSERTION ERROR in the entry_validation() function). Could you please explain to me what the bare minimum requirements are to initialize the mesh stack.

I have already added all mesh files and adjusted the linker to fit the bootloader in the flash space. I just want to know exactly what it would take to successfully initialize the mesh.

Context:

3 Nordic Thingy52s

nRF SDK for mesh v2.2.0

nRF SDK 15.0.0 softdevice (v6.0.0)

Base bootloader code from nRF15s secure_bootloader in the dfu example.

  • Hi. Thank you for the clarification. Started using the sdk_app_uart_coexist as my base and it does have a working mesh initializer and all. I will add the DFU functionality and report my findings.

    On occasion, I receive the error code NRF_ERROR_NO_MEM=4. It resolves itself upon restart but I was wondering why this was?

  • You need to point to a function that throws error NO_MEM so we can check what could the issue be. 

  • It starts as an event error in uarte_irq_handler() in nrfx_uarte.c It later goes on to report an APP_UART_FIFO_ERROR in main.c. It finally reports NO_MEM by app_handler_bare by the last call. I made a workaround for the FIFO error but then it reports an  APP_UART_COMMUNICATION_ERROR instead. This resolves after a restart but occurs every time I try debugging with the JLink.

  • Please check what exactly in uarte_irq_handler() give the error ? 

  • static void uarte_irq_handler(NRF_UARTE_Type *        p_uarte,
                                  uarte_control_block_t * p_cb)
    {
        if (nrf_uarte_event_check(p_uarte, NRF_UARTE_EVENT_ERROR))
        {
            nrfx_uarte_event_t event;
    
            nrf_uarte_event_clear(p_uarte, NRF_UARTE_EVENT_ERROR);
    
            event.type                   = NRFX_UARTE_EVT_ERROR;
            event.data.error.error_mask  = nrf_uarte_errorsrc_get_and_clear(p_uarte);
            event.data.error.rxtx.bytes  = nrf_uarte_rx_amount_get(p_uarte);
            event.data.error.rxtx.p_data = p_cb->p_rx_buffer;
    
            // Abort transfer.
            p_cb->rx_buffer_length = 0;
            p_cb->rx_secondary_buffer_length = 0;
    
            p_cb->handler(&event, p_cb->p_context);
        }
        
        
    /* Rest of function ... */
    }

    Immediately after startup (when debugging with JLink) an error gets caught in this first if statement and goes on to produce the NO_MEM. SEGGER does not give me a further backtrace and this happens almost immediately. If I do a hard reboot without the JLink Connected it works just fine but attempting to connect the JLink again leads to this error so it is difficult to debug by myself.

Related