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

NRF52 Mesh DFU on sdk coexistence

Hi everyone,

I'm currently trying to develop an application with the mesh, the uart and the DFU.

I've started the project with the sdk_coexistence for use the uart and the mesh, i decided to add even the BLE capabilities to make the application compatible with the phone.

Now i need to add the DFU, previously i managed to make the DFU work correctly on the light_switch example.

This new project don't have the serial enabled because i want to start the DFU with another board, this one use the old light_switch example (that is working with the other light_switch example board).

By debugging this new project i've seen that i never recive the MESH_DFU_START, thing that happen on the light_switch modified example.

I don't really know why i don't recive the event.

Any help will be usefull, sorry for my bad english

Thanks for the support

  • Hello,

    Is "LOG_SRC_DFU" part of your __LOG_INIT() arguments?

    Do you get any of the other Mesh DFU events in the mesh_evt_handler()?

    NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED,
    NRF_MESH_EVT_DFU_FIMRWARE_OUTDATED_NO_AUTH,
    NRF_MESH_EVT_DFU_END (probably not this one, if you don't get "start".
    NRF_MESH_EVT_DFU_BANK_AVAILABLE

    Any of them?

    Have you programmed the bootloader and device page as in the dfu example?

    I understand that you don't want the serial part in the end, but can you try to enable the serial part, and see if you then receive the DFU image over Mesh when you start the transmission via serial on another board?

    BR,

    Edvin

  • Dear Edvin,

    Thank you very much for what you did. At the moment I am in London so I cannot control the code right now but I will keep you fully informed as soon as possible. So far I can only tell you that I don't receive any event linked to the DFU, whereas I receive all of those linked to the MESH.

    Thank you and have a good day,

    Alessandro Mattioli

  • Hi Edvin,

    I tried to activate the serial port as you asked me and in that case I can receive the DFU update through the serial port and this is correctly sent to the other devices.

    For this reason I really believe that the bootloader that the device page is correct, always loaded as the example describe.
    When I try to receive the DFU instead through another device I get nothing.

    None of the events you asked for are received.

    Thanks for the help

  • It sounds like you are missing some parts from the dfu example. Something in initialize() or start() isn't included, like it is in the dfu example. It is a bit hard to say what it is without seeing the project. 

    Is nrf_mesh_dfu_init() called inside your nrf_mesh_init()? (And if it is, what is the return value of nrf_mesh_dfu_init()?

    BR,

    Edvin

  • Hi Edvin,

    the nrf_mesh_dfu_init() is called, the result was 0x06. 

    The error was due this part

    static uint32_t dfu_cmd_handler_set(bl_if_cmd_handler_t handler)
    {
        if (handler == NULL)
        {
            return NRF_ERROR_NULL;
        }
        if (BOOTLOADERADDR() == 0xFFFFFFFF)
        {
            /* No bootloader present. */
            return NRF_ERROR_NOT_SUPPORTED;
        }
        //FIXME
        NRF_LOG_INFO("handler dfu %X\n", handler);
        NRF_LOG_INFO("flash dfu %X\n", DEVICE_FLASH_END_GET());
        NRF_LOG_INFO("boot dfu %X\n", BOOTLOADERADDR());
        if (((uint32_t) handler >= DEVICE_FLASH_END_GET()) ||
            ((uint32_t) handler < BOOTLOADERADDR()))
        {
            /* out of bounds. */
            return NRF_ERROR_INVALID_ADDR;
        }
        m_cmd_handler = handler;
        return NRF_SUCCESS;
    }

    The result of the third if was the cause. I fixed it by changing 

    In flash_placement.xml the line 32 from

      <MemorySegment name="RAM" start="$(RAM_PH_START)" size="$(RAM_PH_SIZE)">

    to

      <MemorySegment name="RAM" start="$(RAM_PH_START)" size="$(RAM_SIZE)">

    as suggested here. Now the status is 0 but i still don't recive the DFU.

    I hope that this can help to understand what's not working.

    Thanks for the help and the support

Related