TMS320F28379S: Can't program JTAGLOCK OTP

Part Number: TMS320F28379S
Other Parts Discussed in Thread: C2000WARE

Tool/software:

We would like to disable the JTAG interface. For that, I added the following to the linker cmd:

JTAGLOCK            : origin = 0x078018, length = 0x000004    /* used to disable JTAG interface */

and further down:

.jtaglock        : > JTAGLOCK, PAGE = 0, ALIGN(8)

Then in my application I added this:


#pragma RETAIN(jtaglock)
#pragma DATA_SECTION(jtaglock,".jtaglock");
const uint32_t jtaglock = 0x0;

But I get the following error when I try to flash the controller via CCS:

_CPU1: Error during Flash verification. Address of failure: 0x00078018, Data on target: 0xFFFFFFFF, Data from program: 0x00000000 (0)
C28xx_CPU1: Flash verification returned error condition. Operation cancelled.
C28xx_CPU1: Please make sure the memory location you are programming have not already been programmed.

I checked the DCSM OTP address as well as the ECC DCSM OTP address and they are all 0xFF.

What am I doing wrong?