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

General question

Hello,
we are using microchip bluetooth as uart tranpsarent and we have custom app in android to control it. In future we are going to do mesh application in android. But for now, we want to create system, which was able use DFU bootloader and upgrade version ble_app_uart. Future main goal is system with one chip which is able comunicate throught bluetooth with next devices. I compiled and try 2 examples ble_app_uart and light_switch_client with nrf52832 DK and it works. Is possible use DFU bootloader and turn into mesh and than back from mesh to uart?

Parents
  • Hello,

    Yes. That should be possible. Out of the box, Mesh has it's own bootloader, which is used to update Mesh nodes in a network, but it is possible to use the "standard" SDK's bootloader instead, which sounds like what you want to do. 

    Did you intend to use the BLE bootloader or a serial (uart) bootloader?

    If you are going to use the BLE bootloader, you must make sure that your Mesh app and the BLE app is using the same softdevice version. So basically you would want to use the bootloader from the SDK that your version of the Mesh SDK uses. E.g. Mesh SDK 4.0.0 and nRF5SDK_16.0.0, which both use S132_v7.0.1.

    This part should go automatic, but I'll let you know since there is a bug in the Mesh SDK3.2.0, which uses SDK15.3.0

    Mesh stores it's network data in the top of the flash. Somewhere in the initialization functions, it checks where to store this, and it also checks whether or not there is a bootloader present. This happens in flash_manager_defrag_init(), in flash_manager_defrag.c. This checks the bootloader address in the BOOTLOADERADDR() macro. If you use that exact version of the nRF Mesh, just port that macro to the mesh SDK v 4.0.0 version. 

    So, all this being said, for the BLE part it should work quite out of the box. But when you add the mesh part you need to think about a couple of things. If you want to store the Mesh network data (keys) while DFUing to the BLE app and back to Mesh, and you want to store something in the flash for the BLE application (f.eks bonding information), make sure that these doesn't use the same area. Also, make sure that the bootloader doesn't erase the flash areas that you want to keep. In the nRF5 Bootloader from the normal SDK, that is set in sdk_config.h in the define NRF_DFU_APP_DATA_AREA_SIZE.

    From the description of that define:

    // <o> NRF_DFU_APP_DATA_AREA_SIZE - The size (in bytes) of the flash area reserved for application data. 
    // <i> This area is found at the end of the application area, next to the start of
    // <i> the bootloader. This area will not be erased by the bootloader during a
    // <i> firmware upgrade. The size must be a multiple of the flash page size.

    In addition to this, remember that you need some method, both from the BLE app and the Mesh app to enter DFU mode. This can either be a button press, a write to a BLE characteristic (such as in the ble_app_buttonless_dfu), or some specific serial command (that you need to implement on your own, but that would look pretty much like the buttonless_dfu characteristic implementation). In case of the serial command, you need to write to the power register, and then reset.

    I hope some of this information was useful. Let me know if anything was unclear.

    Best regards,

    Edvin

  • Thank you very much, it helped. I work on another problem, I went through a lot of Q&A here, but I don´t have solution. Light switch, client, server and app nRF Mesh works. I replaced client with ble_app_uart_coexist, but I already donť see it in your nRF Mesh app on my phone. I wold like configure it, but I donť know how. My goal is create mesh network, where I connect to one node with help app Serial BLE Terminal in phone and send serial packet to all others nodes to uart in network/connection. I hope that is clear what I think, create wireless system what transciver serial data, no problem when it will be low speed. In the best case send serial data to specific node in mesh network. Programmig is quite time consuming. Maybe great thing would be to have existing Mesh system able configurate with help AT commands. Example: app Serial BLE Terminal send serial packet "0x01, 0x02, ..." and I see it on uarts on others three BLE device. And when it would go with help AT commands configure name and password "mesh network" It would by great.

Reply
  • Thank you very much, it helped. I work on another problem, I went through a lot of Q&A here, but I don´t have solution. Light switch, client, server and app nRF Mesh works. I replaced client with ble_app_uart_coexist, but I already donť see it in your nRF Mesh app on my phone. I wold like configure it, but I donť know how. My goal is create mesh network, where I connect to one node with help app Serial BLE Terminal in phone and send serial packet to all others nodes to uart in network/connection. I hope that is clear what I think, create wireless system what transciver serial data, no problem when it will be low speed. In the best case send serial data to specific node in mesh network. Programmig is quite time consuming. Maybe great thing would be to have existing Mesh system able configurate with help AT commands. Example: app Serial BLE Terminal send serial packet "0x01, 0x02, ..." and I see it on uarts on others three BLE device. And when it would go with help AT commands configure name and password "mesh network" It would by great.

Children
No Data
Related