Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. nRF5 OTA updates

nRF5 OTA updates

Scheduled Pinned Locked Moved Development
8 Posts 4 Posters 2.9k Views 9 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • d00616D Offline
    d00616D Offline
    d00616
    Contest Winner
    wrote on last edited by d00616
    #1

    There are discussions about OTA for nRF5 sensors. We have two variants to that:

    1. Use Nordics DFU mechanism.
    2. Implement a SoftDevice independent mechanism

    Nordics DFU is ready to use for applications using the official SDK and a SoftDevice. At the moment the MySensors port doesn't support running on Chips with SoftDevice. I think this is more than a little work to implement SoftDevice Support. (NVM collision, Interrupt and RTC sharing, dependencies to non-LGPL compatible SDK...)

    The SoftDevice supports updating the firmware with a smartphone and is pre-installed on most/all nRF5 chips. With this type of bootloader, it's easy to install MySensors without using programmers or special hardware. On the other side SoftDevice and bootloader requiring a lot of Flash memory, the SoftDevice reduces the usable RAM.

    As I know, Nordics bootloader cannot be protected to flash other software. When a device is lost, encryption keys can be extracted.

    My idea is creating a new bootloader which allows only flashing encrypted or signed code. The encryption keys can be protected with nRF5 hardware access control wich denies accessing the bootloader memory from applications. The debug interface can be disabled.

    This bootloader can initially be flashed via Nordic's DFU. To do this an additional loader is required, wich runs in RAM to erase the whole Flash.

    For flashing a second nRF5 or maybe nRF24 is needed. The flashing controller or additional software manages firmware delivery and encryption.

    The first installation of the alternative bootloader needs a component to establish a new connection with an asymmetric key exchange. The resulting key is stored in the protected bootloader area. The initialization part can be erased after pair to the central firmware management. This keeps the boot section small.

    New firmware should be flashed via a very small radio protocol, from internal flash for MySensors OTA support and via the serial port.

    1 Reply Last reply
    5
    • alowhumA Offline
      alowhumA Offline
      alowhum
      Plugin Developer
      wrote on last edited by
      #2

      Any luck? Has OTA support for NRF5 materialised?

      d00616D 1 Reply Last reply
      0
      • alowhumA alowhum

        Any luck? Has OTA support for NRF5 materialised?

        d00616D Offline
        d00616D Offline
        d00616
        Contest Winner
        wrote on last edited by
        #3

        @alowhum said in nRF5 OTA updates:

        Any luck? Has OTA support for NRF5 materialised?

        It's not complete yet. My idea is to use mcuboot as bootloader and the MySensors OTA protocol to transfer a new firmware image. The last one is completely finished. I use the zehpyr port of mcuboot. This is working fine for NRF52 MCUs, but it depends on an memory layout of zephyr. The arduino-nrf5 port is using another memory layout.

        At the moment, I can flash a new firmware image over the air, the image starts until the first interrupt routine is called. I think this can be fixed for NRF52 MCUs. Last time, I have looked into the mcuboot project, the NRF51 MCU wasn't supported.

        I can't work on that in the moment, because I'm very busy with non MySensors related tasks.

        1 Reply Last reply
        3
        • alowhumA Offline
          alowhumA Offline
          alowhum
          Plugin Developer
          wrote on last edited by
          #4

          Awesome! Glad to hear you're exploring it!

          1 Reply Last reply
          1
          • andrewA Offline
            andrewA Offline
            andrew
            wrote on last edited by andrew
            #5

            I just started to review the NRF5* possibilities. regarding to the code protection, are you sure that you have to implement this by your own?
            what do you think about CTRL-AP - Control Access Port, APPROTECT?

            http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fdif.html&anchor=concept_udr_mns_1s

            d00616D 1 Reply Last reply
            0
            • andrewA andrew

              I just started to review the NRF5* possibilities. regarding to the code protection, are you sure that you have to implement this by your own?
              what do you think about CTRL-AP - Control Access Port, APPROTECT?

              http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fdif.html&anchor=concept_udr_mns_1s

              d00616D Offline
              d00616D Offline
              d00616
              Contest Winner
              wrote on last edited by
              #6

              @andrew said in nRF5 OTA updates:

              I just started to review the NRF5* possibilities. regarding to the code protection, are you sure that you have to implement this by your own?
              what do you think about CTRL-AP - Control Access Port, APPROTECT?

              This is already implemented -> https://github.com/mysensors/MySensors/blob/development/hal/architecture/NRF5/MyHwNRF5.cpp#L69

              Do not enable this feature until the bootloader is working. I have an NRF52 board, I can't erase after enabling the feature. I think the problem is I haven't enabled the reset pin.

              I have tried to erase the MCU with ST-Link an CMSIS adapters. Maybe I have more luck with an J-Link.

              1 Reply Last reply
              1
              • LorenzoL Offline
                LorenzoL Offline
                Lorenzo
                wrote on last edited by
                #7

                Hi, Any news on that? If needed I can help developping.

                d00616D 1 Reply Last reply
                0
                • LorenzoL Lorenzo

                  Hi, Any news on that? If needed I can help developping.

                  d00616D Offline
                  d00616D Offline
                  d00616
                  Contest Winner
                  wrote on last edited by
                  #8

                  @lorenzo said in nRF5 OTA updates:

                  Hi, Any news on that? If needed I can help developping.

                  No news from my side. Currently I have no time to work on this feature.

                  You can fork my Repository https://github.com/d00616/ArduinoHwNRF5 to finish the work. It's possible to send a new firmware and the image is new replaced by the bootloader but with the first interrupt the MCU is crashing. For NF52 MCUs, I think this problem is fixable by moving the IV-Pointer to the image maybe there is an problem by different memory layouts of Arduino and Zephyr (used to compile mcuboot).

                  1 Reply Last reply
                  1
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  6

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.0k

                  Posts


                  Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular