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

How to flash Thingy 52 with custom firmware on osx

Hi,

I've just got my hands on this amazing little thing call Thingy 52. I have played around with the default app but now I'm struggling with flashing a custom firmware.

So far I manage to perform the following steps:

  • Downloaded Thingy 52 SDK 2.1.0
  • Followed the README to setup the SDK.
  • Successfully compiled project\pca20020_s132 with GCC.
  • Installed nrfutil.
  • Generated own public and private keys.
  • Manage to compile the bootloader (project/bootloader_secure)

Next step would be to flash the custom bootloader onto the Thingy 52. Unfortunately the documentation does not mention how this can be done only states that this needs to be done.

I consulted this blog post about secure DFU and there's a segment about Update softdevice and bootloader.

The drawback is that I'm using OSX and Keil and nRF Go is not available (to my knowledge) meaning that I'm stuck with the command line tools.(?)

So how can I flash a custom bootloader onto Thingy 52 and then create my own firmware DFU package to flash onto Thingy 52 using OSX?

Any help is highly appreciated!

Thanks

Parents
  • Hello Kristian,

    The Thingy52 does not have a programming chip. Do you have an external programmer? An nRF5x DK would also work.

    You will need to use the P9 connector on the thingy as described in this case.

    You can use the command line tools. If you type "nrfjprog -h" you will see a list of  all commands. Typically, you would want to erase your Thingy52 first, by writing "nrfjprog -e". Depending on your command line tools version, you might have to add the nRF family like this: "nrfjprog -f NRF52 -e".

    Program your thingy using the following command:

    "nrfjprog --program [path to .hex file] --verify"

    Once you have programmed the bootloader you can use nRF Connect to upload your applications.

    BR,

    Edvin

  • Hello Edvin, 

    I've manage using a SWD cable along with a nRF52 DK to flash the bootloader using your suggestions. Next step (according to the docs) is to flash the soft device. I downloaded S132 v4.0.2 and flash that onto the board using:

    nrfjprog --program s132_nrf52_4.0.2_softdevice.hex -f nrf52 --chiperase

    I've also manage to create a DFU package using:

    nrfutil pkg generate --application nrf52832_xxaa_s132.hex --application-version 0 --hw-version 52 --sd-req 0x98 --key-file private-key.pem myApp.zip

    However when trying to perform an OTA-DFU using nRFConnect on a mobile I can't find the Thingy device while scanning. Is the bootloader really flashed? Do I need to create bootloader settings and flash them as well?

    Thanks in advance.

Reply
  • Hello Edvin, 

    I've manage using a SWD cable along with a nRF52 DK to flash the bootloader using your suggestions. Next step (according to the docs) is to flash the soft device. I downloaded S132 v4.0.2 and flash that onto the board using:

    nrfjprog --program s132_nrf52_4.0.2_softdevice.hex -f nrf52 --chiperase

    I've also manage to create a DFU package using:

    nrfutil pkg generate --application nrf52832_xxaa_s132.hex --application-version 0 --hw-version 52 --sd-req 0x98 --key-file private-key.pem myApp.zip

    However when trying to perform an OTA-DFU using nRFConnect on a mobile I can't find the Thingy device while scanning. Is the bootloader really flashed? Do I need to create bootloader settings and flash them as well?

    Thanks in advance.

Children
No Data
Related