Thingy91: Process to flash s340 and 52840

Hi,

I have been doing my development on the 9160DK and now its time to move the code over to the thingy 91.  I managed to get the 9160 flashed by following (https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/getting-started-cellular/posts/how-to-program-any-project-to-the-thingy-91-with-dfu), but the 52840 and s340 softdevice seem to be a different story.

I  tried to follow, without success:
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_thingy91_gsg%2FUG%2Fthingy91_gsg%2Fupdating_fw.html

What I am not sure or have tried:
* Do I need to have the SWD-Select on nRF52, before I power-up (whilst holding sw4) ?  I saw one document indicating you needed to, but the above doesnt indicate you need to.  (I tried both)

* The image starts to load, but then I get the `Image Upload Failed: Bad response from device`.  I got the same error with the 9160, but by following the DFU link above, got around the problem - I am not sure how to get around it with the 52840, since I am not using zephyr.

* My 52840 software is using ANT+ therefore, I require the s340 softdevice and am using the legacy nRF5 SDK - since its not supported in zephyr.  The original way to load the s340 was with `nrfjprog` but that doesnt seem to work.

* For the 52840, do I need to use an external connection - say the 9160dk to be able to flash it ?

regards
-brett

Parents
  • * For the 52840, do I need to use an external connection - say the 9160dk to be able to flash it ?

    Yes, then you have full control over the firmware you program (and not limited to DFU over a serial interface that may not allow update of for instance softdevice out of the box), so please follow this setup:
    https://infocenter.nordicsemi.com/topic/ug_thingy91_gsg/UG/thingy91_gsg/updating_fw_ext_probe.html

    It should be possible to use an j-link programmer or nRF DK to program the nRF52840 on the thingy91. Then you can also program using nrfjprog.

    Kenneth

  • Hi Kenneth,

    Sorry for the slow response, I was waiting for a cable to arrive to test this process...

    I was able to flash the 52840 with out a problem, however, when I tried to flash the 9160 I get the following error on the programmer:

    2021-11-11T19:34:37.975Z INFO Using nrfjprog to communicate with target
    2021-11-11T19:34:39.005Z INFO Using J-Link Software version 6.88
    2021-11-11T19:34:39.794Z INFO Segger serial:  960048905
    2021-11-11T19:34:39.794Z INFO Segger speed:  2000  kHz
    2021-11-11T19:34:39.794Z INFO Segger version:  J-Link OB-K22-NordicSemi compiled Apr 29 2021 15:10:52
    2021-11-11T19:34:39.797Z INFO Core probed: 960048905
    2021-11-11T19:34:39.797Z INFO Core RAM: 256KiB
    2021-11-11T19:34:39.797Z INFO Core ROM: 1024KiB in pages of 4KiB
    2021-11-11T19:34:39.916Z INFO Model: NRF52840_xxAA_REV2.
    2021-11-11T19:34:40.742Z INFO Core0: Reading device non-volatile memory. This may take a few seconds.
    2021-11-11T19:34:41.520Z INFO Core0: UICR has been read. Click read button to read full non-volatile memory.
    2021-11-11T19:34:51.571Z INFO Using nrfjprog to communicate with target
    2021-11-11T19:34:52.350Z INFO Using J-Link Software version 6.88
    2021-11-11T19:34:53.102Z INFO Segger serial:  960048905
    2021-11-11T19:34:53.103Z INFO Segger speed:  2000  kHz
    2021-11-11T19:34:53.103Z INFO Segger version:  J-Link OB-K22-NordicSemi compiled Apr 29 2021 15:10:52
    2021-11-11T19:34:53.103Z INFO Core probed: 960048905
    2021-11-11T19:34:53.103Z INFO Core RAM: 256KiB
    2021-11-11T19:34:53.103Z INFO Core ROM: 1024KiB in pages of 4KiB
    2021-11-11T19:34:53.230Z INFO Model: NRF52840_xxAA_REV2.
    2021-11-11T19:34:54.013Z INFO Core0: Reading device non-volatile memory. This may take a few seconds.
    2021-11-11T19:35:03.590Z INFO Core0: Non-volatile memory has been read. 4 non-empty memory blocks identified
    2021-11-11T19:35:03.710Z INFO SoftDevice detected, id 0xCE (S340 v7.0.1)
    2021-11-11T19:36:02.413Z INFO Using nrfjprog to communicate with target
    2021-11-11T19:36:02.991Z ERROR Could not fetch memory size of target devkit: Error: Error occured when get library info. Errorcode: CouldNotOpenDevice (0x4)
    Lowlevel error: JLINKARM_DLL_ERROR (ffffff9a)

    2021-11-11T19:36:45.354Z INFO Target device closed.
    2021-11-11T19:36:50.987Z INFO Using nrfjprog to communicate with target
    2021-11-11T19:36:51.549Z ERROR Could not fetch memory size of target devkit: Error: Error occured when get library info. Errorcode: CouldNotOpenDevice (0x4)
    Lowlevel error: JLINKARM_DLL_ERROR (ffffff9a)

    When I try from the CLI, I get:
    nrfjprog --eraseall
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.

    I have tried

    * restarting all boards but it still doesnt seem to be able to see or write to the 9160,

    * confirmed SW2 set to nrf91 (on the thingy91)

    * tried the Prog/DEBUG switch on the 9160 to nrf52 and nrf91

    Since I was able to update the 52840 on the thingy, I assume the cable and connection is all good, but any other thoughts ?

    cheers
    -brett

  • I also tried the original way of flashing the 9160 (on the thingy), via the USB and MCUBoot method, but I cant even get the USB to work.

    * Connect USB
    * Hold down SW3 whilst turning on the thingy
    * I dont see the device in the pulldown of the programmer, and I dont see any usb devices in /dev (I am on a mac)

Reply Children
No Data
Related