Secure bootloader ble with UART

HI currently  i am utilizing sdk ver 17.1.10  nrf52840 s140 we are using dfu/secure_bootloader/pca10056_ble app and i need to add UART app to it so that so we need both bootloader ble  advertiser and with UART added to it   currently we have added UART to it but whenever we call app_uart_put() function it was unable to advertise if we comment this function it is advertising as dfuTarg can you suggest me any steps to add uart to the secure bootloader /ble so that both peripheral can be utilized f it is possible NOTE: We referred secure bootloader /pca10056_uart  example but in this sdk it will not advertise so we need both advertiser + Uart 

  • Hello,

    It should be possible to add uart to the BLE bootloader. But the way it is added in the bootloader is a bit strange.

    If you look at nrf_dfu_serial_uart.c, line 86:

    DFU_TRANSPORT_REGISTER(nrf_dfu_transport_t const uart_dfu_transport) =
    {
        .init_func  = uart_dfu_transport_init,
        .close_func = uart_dfu_transport_close,
    };

    So simply by including this file, uart will be added as a DFU transport layer. This is then fetched by nrf_dfu_transports_init() in nrf_dfu_transport.c.

    So it should be a matter of adding nrf_dfu_serial_uart.c (and including the folder that contains nrf_dfu_serial.h), and try to build. If it complains about lacking functions/files, then keep adding until it builds without warnings/errors.

    Best regards,

    Edvin

  • Oh, you may also need these in your sdk_config.h:

    // <h> nrf_dfu_serial_uart - UART DFU transport
    
    //==========================================================
    // <q> NRF_DFU_SERIAL_UART_USES_HWFC  - HWFC configuration
     
    
    #ifndef NRF_DFU_SERIAL_UART_USES_HWFC
    #define NRF_DFU_SERIAL_UART_USES_HWFC 1
    #endif
    
    // <o> NRF_DFU_SERIAL_UART_RX_BUFFERS - Number of RX buffers. 
    // <i> Number of buffers depends on flash access vs.
    // <i> transport throughtput. If value is too low it may lead
    // <i> to received packets being dropped.
    
    #ifndef NRF_DFU_SERIAL_UART_RX_BUFFERS
    #define NRF_DFU_SERIAL_UART_RX_BUFFERS 3
    #endif
    
    // </h> 
    //==========================================================
    
    // </h> 
    //==========================================================
    

    If it complains about other things that are lacking, look for it in the uart bootloader, and include it in your current bootloader.

    BR,
    Edvin

  • 1. Hi thanks for the reply our requirements is we will use uart to transport the bin file which will receive in the dfu ota Ie through mobile instead of storing in the flash after uploading the bin from mobile

    2. It should check some condition whether it should perform dfu ble for nordic or just take the bin to uart via uart we will transfer the data to other device so main thing is we should perform dfu via mobile app and the data should transfer in uart  

    3. one more thing is there any checks for the size for uploading zip file via mobile app if it is there where should i check in secure bootloader/pca10056_ble sdk

    4. we added uart to the secure bootloader /pca10056_ble  whenever we call func   app_uart_put(data[i]) in main func device unable to advertise 

  • Oh, sorry. I misunderstood. 

    The init packet is sent first, and is used by the bootloader to determine whether or not to store the rest of the image. This protocol isn't very good documented. But do you want to do this test locally before forwarding the packet over UART, or do you want to check it on the device that receives the UART messages? Because the signature of the init packet and DFU image itself needs to be checked on the device that actually holds the keys for the bootloader/image.

    AP1 said:
    4. we added uart to the secure bootloader /pca10056_ble  whenever we call func   app_uart_put(data[i]) in main func device unable to advertise 

    So what do you observe? Do you just don't see the advertisements, or did you actually try to debug the bootloader? In cases like these, when you are modifying the bootloader, I suggest you use the pca10056_ble_debug bootloader, so that you can check the logs from the bootloader. This way it is easier to check where things don't go as planned.

    When it is unable to advertise, what does the log say?

    Best regards,

    Edvin

  • Hi thanks for the reply what about this point 

    3. one more thing is there any checks for the size for uploading zip file via mobile app if it is there where should i check in secure bootloader/pca10056_ble sdk

    Beacuse we already tried with other than nordic bin in which we observe that if the size of the bin is more than 1 MB than it was unable to perform DFU OTA but for less than 1 MB it is ok to perform DFU OTA 

    It is possible to perform dfu ota  and transfer those bytes via UART Transport layer ?

Related