PEmicro logo
Cart New Account Login

Logo image
HomeAbout usProductsSupportForumsBlogCustomer Service

search inside this forum
search inside all forums
Nordic Semi nRF52810 cannot reprogram if System Off (error $00000007)
Robbie B. Jul 6, 2021 at 03:27 PM (15:27 hours)
Staff: Johnny N.

  • Hi, I am attempting to setup a Cyclone FX Universal to program boards for our production.  We use the Nordic Semi nRF52810 SoC on some assemblies, and on other assemblies, it is unused, so we load a program into it to put it into System OFF mode (lowest power state) to effectively disable the SoC.  In all cases, after programming, we use the "SD" code to secure device. (See two example SAP configurations below.)

    My goal is to allow production to be able to program the boards, but be able to "reprogram" (unsecure/erase then reload different firmware) as production needs change.

    As long as we use the "normal" image to load the SoftDevice and Application code, we can successfully reprogram the SoC as needed. We can always program the "SystemOff" image once, but after that, we can never again reprogram the SoC (Cyclone FX shows error $00000007). Attempting to reprogram appears to remove the "Secure Device" lock, because Nordic Software (nRFgo Studio) sees the device as unsecure/blank. The only I've found to recover from this state is to connect to the SoC using nRFgo Studio and "Recover" the device.

    I have attempted to add a reset "RE" before erasing module "EM", and then I get error $00002003 (image won't even load once). I've also tried various delays after power up, pulling reset low before and after SAP operations, changing shift frequency. Nothing tried so far has been successful.

    Any ideas what may be causing this, and/or ideas for me to try?

    "Normal Image"
    :RESETDELAY 0
    :DEVICE NordicSemi_nRF52_NRF52810-QFAA
    :USESWD 1
    :DEBUGFREQUENCY 5560
    :SAPGUIVERSION 382E3336
    :PROVIDEPOWER
    :POWERVOLTAGE 3.0
    :POWERDOWNDELAY 250
    :POWERUPDELAY 250
    :KEEPPOWERON 0
    :BARFILE ;(barcode path)
    :NEWIMAGE
    :DESCRIBEIMAGE Normal
    CM C:\PEMicro\cyclone\supportfiles\supportFiles_ARM\NordicSemi\nRF52\Nordic_nRF52810-QFAA_1x32x48k.arp
    SS ;(softDevice path)
    EM ;Erase Module
    PM ;Program Module
    VM ;Verify Module
    SS ;(Application Path)
    PM ;Program Module
    VM ;Verify Module
    SD ;SECURE DEVICE

    "SystemOff/Disable Image"
    :RESETDELAY 0
    :DEVICE NordicSemi_nRF52_NRF52810-QFAA
    :USESWD 1
    :DEBUGFREQUENCY 5560
    :SAPGUIVERSION 382E3336
    :PROVIDEPOWER
    :POWERVOLTAGE 3.0
    :POWERDOWNDELAY 250
    :POWERUPDELAY 250
    :KEEPPOWERON 0
    :BARFILE ;(barcode path)
    :NEWIMAGE
    :DESCRIBEIMAGE SystemOff
    CM C:\PEMicro\cyclone\supportfiles\supportFiles_ARM\NordicSemi\nRF52\Nordic_nRF52810-QFAA_1x32x48k.arp
    SS ;(application path)
    EM ;Erase Module
    PM ;Program Module
    VM ;Verify Module
    SD ;SECURE DEVICE




    Comments

    • Additional detail:  I just realized that the reset signal from the Cyclone is not connected to the nRF52810, since the reset pin is disabled by default.  I've been reading the nRF52810 datasheet, and wonder if the issue may be with CTRL-AP - Control access port and System off. I would be interested to know any feedback you may have in light of nRF52810 datasheet sections 4.8.2 and 4.8.3.  The latter appears to suggest a
      https://infocenter.nordicsemi.com/pdf/nRF52810_PS_v1.3.pdf

      thanks,
      Robbie

      • Robbie,

        We are looking into this issue. Thank you for your patience.

        My initial thoughts on your problem are that the Cyclone FX Universal needs some improvement in debug entry so it can work with Nordic nRF52 devices running in low power modes. I'm trying to setup a test to verify test.

        I want to see if the Cyclone can unsecure your board if it is not in low power. Can you load a test program into the MCU that doesn't enable any low power modes and secure it? Then try to unsecure and reprogram the board again? Try it a few times and let me know if it works.

        Regards,
        Johnny
        PEMicro Support

        • Hi Johnny,

          I ran the test you requested. I took the firmware I've had issues with, and removed the line that put it into System Off mode, so the MCU stays in System ON in an infinite loop. The Cyclone was able to reprogram without any issues.

          I then put the MCU into Wait for Interrupt sleep mode, in place of the system off mode. The cyclone was able to reprogram without any issues.

          I then returned to my call for System Off mode; from Nordic SDK the call is: nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF); (or nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF), I tried both). In both cases, the cyclone could only load the program once, and any future attempts to load any firmware fail with the $00000007 error.

          Thanks,
          Robbie

        • Hi Johnny,

          If it's helpful, I hooked up my logic analyzer to the SWD line and took a recording of nRFGoStudio performing a "Recover" vs the Cyclone FX performing an "Erase Module". It's probably comparing apples to oranges, but maybe there would be some good data buried in there. The files are .txt, If you want them, let me know how to get them to you.

          Thanks,
          Robbie

Add comment


   Want to comment? Please login or create a new PEmicro account.







© 2021 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement