This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52832 revision 3

Hello 

Now we are testing the third version of nRF52832 nrf52833 nrf52840 ic

I learned that there is a feature to lock and unlock the debug port of the device, but I use the armgcc and segger development environment instead of MDK.

How do I test this feature?Thank you.

SDK:sdk17.2

IDLE:segger/armgcc

Project: ble_app_uart

1. Start with a CTRL-AP ERASEALL operation.

Can I use nrfjprog.exe --eraseall?

2. Program code compiled with MDK 8.40.1 or later, with ENABLE_APPROTECT defined.

I am using armgcc and segger? Can I do it like this picture below? 

I search all the project but I can't find ENABLE_APPROTECT,why?

3. Write Enabled (0x00) to UICR.APPROTECT

Can I write like this NRF_UICR->APPROTECT = 0x00;

Parents
  • Why can't the program be run using the following command
    nrfjprog.exe -f NRF52 --recover
    nrfjprog.exe -f NRF52 --program xxx.hex
    nrfjprog.exe -f NRF52 --reset


    Need to use the following instructions to burn to run
    nrfjprog.exe -f NRF52 --recover
    nrfjprog.exe -f NRF52 --eraseall
    nrfjprog.exe -f NRF52 --program xxx.hex
    nrfjprog.exe -f NRF52 --reset

  • Hi,

    Can I use nrfjprog.exe --eraseall?

    Yes. 

    I am using armgcc and segger? Can I do it like this picture below? 

    Yes.

    I search all the project but I can't find ENABLE_APPROTECT,why?

    It's in the system_nrf52_approtect.h under nRF5_SDK_17.1.0_ddde560\modules\nrfx\mdk

    Август said:
    Why can't the program be run using the following command

    Because APPROTECT has been enabled. You need the --recover when APPROTECT has been enabled, which means you will need it after power cycling / pin resetting a device with empty flash.

    Regards,
    Amanda

  • Hi 

    Thanks for your quick response,but I can't find system_nrf52_approtect.h.

    Because APPROTECT has been enabled. You need the --recover when APPROTECT has been enabled, which means you will need it after power cycling / pin resetting a device with empty flash.

    But I have to use the following two commands.

    nrfjprog.exe -f NRF52 --recover
    nrfjprog.exe -f NRF52 --eraseall

Reply
  • Hi 

    Thanks for your quick response,but I can't find system_nrf52_approtect.h.

    Because APPROTECT has been enabled. You need the --recover when APPROTECT has been enabled, which means you will need it after power cycling / pin resetting a device with empty flash.

    But I have to use the following two commands.

    nrfjprog.exe -f NRF52 --recover
    nrfjprog.exe -f NRF52 --eraseall

Children
  • Hi, 

    nRF52832 rev3 is added in SDK 17.1.0 which contains system_nrf52_approtect.h.

    You can bundle --program with --recover.

    Can you try this ?

    nrfjprog.exe -f NRF52 --program xxx.hex --recover

    This approach ensures that the FW is written directly after the CTRLAP->ERASEALL (--recover), which makes it so that the intermediate unlocking image is not needed.

    The intermedia unlocking image must be removed when programming your fw image, hence a sector erase or page erase could in fact be used instead of eraseall if not bundling the commands after each other as proposed above.

    -Amanda

Related