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
  • Thanks for the valuable feedback, Brett!

    Brett said:
    * SW 9160 - read (fails with the error you can see a the bottom of the log)

    I’m a little bit confused here, because the log does not say nRF9160:

    2021-11-24T10:35:03.512Z INFO Using nrfjprog to communicate with target
    2021-11-24T10:35:04.420Z INFO Using J-Link Software version 6.88
    2021-11-24T10:35:05.170Z INFO Segger serial:  801036805
    2021-11-24T10:35:05.170Z INFO Segger speed:  2000  kHz
    2021-11-24T10:35:05.170Z INFO Segger version:  J-Link EDU Mini V1 compiled Feb 18 2021 11:25:23
    2021-11-24T10:35:05.171Z INFO Core probed: 801036805
    2021-11-24T10:35:05.171Z INFO Core RAM: 256KiB
    2021-11-24T10:35:05.171Z INFO Core ROM: 1024KiB in pages of 4KiB
    2021-11-24T10:35:05.291Z INFO Model: NRF52840_xxAA_REV2.
    2021-11-24T10:35:06.083Z INFO Core0: Reading device non-volatile memory. This may take a few seconds.
    2021-11-24T10:35:15.877Z INFO Core0: Non-volatile memory has been read. 4 non-empty memory blocks identified 
    2021-11-24T10:35:15.987Z INFO SoftDevice detected, id 0xCE (S340 v7.0.1)
    2021-11-24T10:35:15.990Z INFO SoftDevice detected, id 0xCE (S340 v7.0.1)
    2021-11-24T10:35:25.414Z INFO Using nrfjprog to communicate with target
    2021-11-24T10:35:26.001Z 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-24T10:38:39.050Z ERROR Unable to open log file: Could not find file at path: /Users/bdunstan/Library/Application Support/nrfconnect/pc-nrfconnect-programmer/logs/2021-11-24T04_00_30.042Z-log.txt
    2021-11-24T10:38:41.589Z ERROR Unable to open log file: Could not find file at path: /Users/bdunstan/Library/Application Support/nrfconnect/pc-nrfconnect-programmer/logs/2021-11-24T04_00_30.042Z-log.txt

    2021-11-24T10:35:05.291Z INFO Model: NRF52840_xxAA_REV2.

    Have you switched SWD SELECT (SW2) to nRF91?

    Regards,

    Markus

  • Hi Markus,

    I also noticed. 

    If I have the JLinkExe connected to the 9160 and then try to connect again from the nrfConnect programmer, I get the same 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)`.

    Is there any way my code is doing something which has the same effect as this ? Be that, opening a port, clocking , UART or ?

    All of this works on the 9160DK, is there something fundamentally different between the thingy91 and 9160DK which I have not catered for ?

    regards
    -brett

Reply
  • Hi Markus,

    I also noticed. 

    If I have the JLinkExe connected to the 9160 and then try to connect again from the nrfConnect programmer, I get the same 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)`.

    Is there any way my code is doing something which has the same effect as this ? Be that, opening a port, clocking , UART or ?

    All of this works on the 9160DK, is there something fundamentally different between the thingy91 and 9160DK which I have not catered for ?

    regards
    -brett

Children
No Data
Related