JLink.exe Remove APPROTECT

My employer will be building a custom product in the next two weeks containing the NRF52840 module. We are using JLink debuggers in our test fixture to achieve this. We are using the JLink debugger's output target power feature to control power delivery within the fixture to the DUTs.

In order to enable target power, we use a short JLink.exe command script.

The problem is, we cannot then use nrfjprog to flash the device because it causes the JLink to reset (I assume it is switching to a HID device mode or similar), and this disables the target power. There is no way for nrfjprog to enable target power that I am aware of, so we are forced to use a JLink script for the entire operation.

We need to both apply and remove read protection as part of our automation. I have learned from another thread on this forum how to apply the read protection by writing to the APPROTECT register prior to it being locked, but I have not tested it yet. However, JLink does not support unlocking NRF52 devices with the "unlock" command, and I cannot figure out a way to select a different SWD access port to send the mass erase command, and if I could I wouldn't know how to do it either.

How can I use JLink.exe to both enable and disable read protection of the NRF52 without using nrfjprog?

Or, alternatively, how can I tell nrfjprog to enable the target power?

Thanks.

Parents
  • Update: I discovered that an older version of JLink was installed (from 2017) and was being used instead. Apparently the support for disabling protection came only a month after this version of JLink and this version did not support removing protection. The latest version of JLink does this automatically after attempting to connect to the chip.

    I am able to lock the device using these JLink commands:

    w1 0x10001208 0

    reset

    And unlocking is as simple as issuing a connect command.

Reply
  • Update: I discovered that an older version of JLink was installed (from 2017) and was being used instead. Apparently the support for disabling protection came only a month after this version of JLink and this version did not support removing protection. The latest version of JLink does this automatically after attempting to connect to the chip.

    I am able to lock the device using these JLink commands:

    w1 0x10001208 0

    reset

    And unlocking is as simple as issuing a connect command.

Children
No Data
Related