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.

Parents Reply
  • 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.

Children
  • 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.

  • Maybe you can trace back to the modification you made to the firmware. 

    How do you plan to send data to the bootloader from the application. Please be aware that you still need the mesh bootloader flashed. What the DFU application does is to forward the data packet it receive to the bootloader (by calling nrf_mesh_dfu_cmd_send() ).

    You would need to follow what we do in serial_handler_openmesh_rx() and serial_handler_dfu_rx()

  • I had not made changes to the firmware when I get this error. This appears when I use the base code on my Thingy52. after adding a board_init from the ThingySDK but by this point I had made many changes and still, on occasion get this error.

    I just wanted to know what could be wrong with the base code?

  • Hi, 

    I think we need to have some clarification here.

    Please let us know what exact firmware you are using, on which hardware board.

    Is the "base code" you mentioned the default Thingy code  ? We don't have mesh supported in that code. Please give us the exact link to the code you use. 

    What are you planning to create in your application ? 

Related