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

thingy52 (&nRF52840) writing my own software

Hey Nordic Devzone,

I am really new to Nordic and am still a student in embedded software engineering. So first some background information.

I have 6x nRF52840 and 5x Thingy52. My goal is to create a mesh network using 5 thingy52's connected to a nRF52840. Than using thread/low6PAN to connect 2 nRF52840 and have one of the nRF52840 setup with a Wiznet5100 chip to post stuff to the internet.

Last few weeks were setup in to getting myself acquainted with the nRF52840 and got the Wiznet5100 chip working on a unit and can send HTTP GET & POST.

Back to the Thingy52: Right now I have Keil uVision installed and am able to compile (30 day license to bridge the 32k code limit) the code in : \thingy_sdk_v2.1.0\project\pca20020_s132 How do I get the .axf file on one of my Thingy52. If I am correct the Thingy52 does not support serial connection. So is it true that I have to use some cable to connect it to my nRF52840 to upload the program? Or can I do something else to get my program on the Thingy52? My goal is to get the Thingy52 connected with the nRF52840, any guides or tutorials available?

Another thing, the nRF52840 had some really good examples and documentation and getting started. I am kinda missing this with the Thingy52, I can only find documentation about the Android/iPhone app and the standard firmware/software the thingy52 is delivered with.

One note; the help has been awesome in this community and I want to thank all the people that have helped me in the last few weeks up front : Sigurd & Bjørn Kvaale

Parents
  • First off, thanks for the kind words! I will mention to Sigurd that you have been pleased with the support you got from us. :)

    If I were you, I would use Segger Embedded Studio (SES) instead of Keil from SDK 14 and onwards, as Keil is expensive and has the code limit that you mention (if you do not get the license). Not sure if you heard the news, but you can obtain a license for SES for free. You mentioned that the Thingy SDK does not have a folder labelled SES, so it works fine to use Keil.

    Edit: Got a tip from a colleague here at Nordic: it seems what I said previously was not correct. Over the air DFU of custom FW can only be done if a key is generated first. Then you can compile the bootloader with your own generated key & flash the bootloader with an external debugger. Only then can you sign the custom FW with your own defined key & OTA DFU custom FW. It should be possible to use an open bootloader in the future sometime, but for now Nordic uses secure DFU in the Thingy:52. Here's a fantastic blog post that should be able to get you started!

    When it comes to starting with secure DFU, you can do this via the SWD (edit: not JTAG) debug cable (attach your nrf52840 to usb, attach a SWD (edit: not JTAG) cable from the P19 port on the nrf52840 to the SWD (edit: not JTAG) connector on the Thingy).

Reply
  • First off, thanks for the kind words! I will mention to Sigurd that you have been pleased with the support you got from us. :)

    If I were you, I would use Segger Embedded Studio (SES) instead of Keil from SDK 14 and onwards, as Keil is expensive and has the code limit that you mention (if you do not get the license). Not sure if you heard the news, but you can obtain a license for SES for free. You mentioned that the Thingy SDK does not have a folder labelled SES, so it works fine to use Keil.

    Edit: Got a tip from a colleague here at Nordic: it seems what I said previously was not correct. Over the air DFU of custom FW can only be done if a key is generated first. Then you can compile the bootloader with your own generated key & flash the bootloader with an external debugger. Only then can you sign the custom FW with your own defined key & OTA DFU custom FW. It should be possible to use an open bootloader in the future sometime, but for now Nordic uses secure DFU in the Thingy:52. Here's a fantastic blog post that should be able to get you started!

    When it comes to starting with secure DFU, you can do this via the SWD (edit: not JTAG) debug cable (attach your nrf52840 to usb, attach a SWD (edit: not JTAG) cable from the P19 port on the nrf52840 to the SWD (edit: not JTAG) connector on the Thingy).

Children
  • Hey thanks a lot for your response, I will try switching to SES although I do not see a SES project for the bootloader project (thingy_sdk_v2.1.0\project\bootloader_secure).

    So right now I have compiled the bootloader project with my own created public key. I also used nrfutil to create a distripackage from it. So I have *.hex file, *.zip file. If I unzip the *zip I also have *.bin & *.dat file

    I tried using nRFconenct yesterday on my desktop, I can see the Thingy52 in DFU mode and can connect to it using a nRF52840. But I get the following error when uploading the boot_loader project:

    DFU failed with error: When writing 'EXECUTE' command to Control Point Characteristic of DFU Target: Operation code 4 (EXECUTE) failed on DFU Target. Result code 11 (EXTENDED_ERROR) Extended error code 5 (FW_VERSION_FAILURE).
    Discovered devices
    
    Start scanClear
    Options
    -60 dBm
    

    When using my android phone with nRFconnect I can also see the Thingy52 in DFU mode. When using the DFU button at the top right I get a menu with 4 choices :

    Distribution packet
    Soft Device
    Bootloader
    Application
    

    When using option 1 Distribution packet the following happens: "initializing, starting DFU, disconnection" no feedback of success or failure.

    When using option 3 Bootloader, I do not get the option to select my *.zip file. It just does not see *.zip files on my android file explorer. So what I did was I extracted the zip file to get the *.bin & *.dat file. So I choose the *.bin file. Then I get some message that the *.dat packet file should contain: " revision, application version, list of supported softdevices etc. ". I choose the *.dat. Same happens as before: "initializing, starting DFU, disconnection".

    So I tried 2 different ways of uploading it through nRFconnect but can't seem to get it working. Will try getting a cable in the meantime. Unless you have some tips or tricks for me.

  • Like I mentioned above, I would either get a cable or try it using the Nordic Thingy app? Do you have an iPhone or are you using an Android phone? I have not tried OTA-DFU using the nrf connect app yet, so I would need to look into that a bit more. But try one of the other two methods I posted first. :)

    EDIT: What I have posted previously is wrong, as you need to do Secure DFU in order to flash a custom FW onto the Nordic Thingy. For OTA-DFU of the Nordic Thingy FW, it is possible to either go via nrf51/52 dk/SWD (edit: not JTAG) cable or via the Thingy app for Android or iOS.

  • I have a Android, is it possible to upload a boot_loader package using the Thingy App. Because I cant see the device in DFU mode when using the thingy app.

  • Using the thingy app my boot_loader also does not get loaded correctly. I think it has to do with that error I am getting when using nRFconnect on my desktop. Although I am not getting any feedback or error code from the thingy app.

  • Trying to verify if my bootloader I compiled using the Thingy52 SDK is correct. So following the guides on the thingy52 website which refers me to the nrfutil guide

    If I try to tun the command specified there to check my boot_loader specifics:

    > nrfutil settings display nrf52832_xxaa_s132.hex
    Failed to parse .hex file: Bad access at 0xFF000: not enough data to read 4 contiguous bytes
    

    Starting to feel a bit helpless with these Thingy52's. No where it is specified while buying these I would need a specific development cable, nor is it delivered with the 5 units that were purchased.

    Cant I just use the bootloader that is present on the thingy52 and write my own application? I just want to connect them in a Mesh Network with the nRF52840 and share the sensor data.

    Thanks in advance for any help.

Related