This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OTP programming issues

Other Parts Discussed in Thread: UNIFLASH

Hello,

I used UniFlash, to flash in a DCSM image into a 28397D processor.  Here was my associated dcsm.asm and dcsm.cmd

;----------------------------------------------------------------------
; Zone 1
;----------------------------------------------------------------------
.sect "dcsm_otp_z1_linkpointer"
.retain
.long 0x1FFFFFFE
.long 0xFFFFFFFF ;Reserved
.long 0x1FFFFFFE
.long 0xFFFFFFFF ;Reserved
.long 0x1FFFFFFE
.long 0xFFFFFFFF ;Reserved

;; .sect "dcsm_otp_z1_pswdlock"
;; .retain
;; .long 0xFFFFFFFF
;; .long 0xFFFFFFFF ;Reserved

;; .sect "dcsm_otp_z1_crclock"
;; .retain
;; .long 0xFFFFFFFF
;; .long 0xFFFFFFFF ;Reserved

;; .sect "dcsm_otp_z1_bootctrl"
;; .retain
;; .long 0xFFFFFFFF ;Reserved
;; .long 0x55490B5A

.sect "dcsm_zsel_z1"
.retain
.long 0x000000FF ; Z1-EXEONLYRAM
.long 0x00003FFF ; Z1-EXEONLYSECT
.long 0x10005555 ; Z1-GRABRAM

.long 0x05555555 ; Z1-GRABSECT

.long 0x00112233
.long 0x44556677
.long 0x8899aabb
.long 0xccddeeff


MEMORY
{
PAGE 0 : /* Program Memory */

DCSM_OTP_Z1_LINKPOINTER : origin = 0x78000, length = 0x00000C
DCSM_OTP_Z1_PSWDLOCK : origin = 0x78010, length = 0x000004
DCSM_OTP_Z1_CRCLOCK : origin = 0x78014, length = 0x000004
DCSM_OTP_Z1_BOOTCTRL : origin = 0x7801C, length = 0x000004

DCSM_ZSEL_Z1_P0 : origin = 0x78030, length = 0x000010

DCSM_OTP_Z2_LINKPOINTER : origin = 0x78200, length = 0x00000C
DCSM_OTP_Z2_GPREG : origin = 0x7820C, length = 0x000004
DCSM_OTP_Z2_PSWDLOCK : origin = 0x78210, length = 0x000004
DCSM_OTP_Z2_CRCLOCK : origin = 0x78214, length = 0x000004
DCSM_OTP_Z2_BOOTCTRL : origin = 0x7821C, length = 0x000004

DCSM_ZSEL_Z2_P0 : origin = 0x78220, length = 0x000010

}

SECTIONS
{
dcsm_otp_z1_linkpointer : > DCSM_OTP_Z1_LINKPOINTER PAGE = 0
dcsm_otp_z1_pswdlock : > DCSM_OTP_Z1_PSWDLOCK PAGE = 0, type = DSECT
dcsm_otp_z1_crclock : > DCSM_OTP_Z1_CRCLOCK PAGE = 0, type = DSECT
dcsm_otp_z1_bootctrl : > DCSM_OTP_Z1_BOOTCTRL PAGE = 0, type = DSECT
dcsm_zsel_z1 : > DCSM_ZSEL_Z1_P0 PAGE = 0

dcsm_otp_z2_linkpointer : > DCSM_OTP_Z2_LINKPOINTER PAGE = 0, type = DSECT
dcsm_otp_z2_pswdlock : > DCSM_OTP_Z2_PSWDLOCK PAGE = 0, type = DSECT
dcsm_otp_z2_crclock : > DCSM_OTP_Z2_CRCLOCK PAGE = 0

dcsm_otp_z2_bootctrl : > DCSM_OTP_Z2_BOOTCTRL PAGE = 0, type = DSECT
dcsm_zsel_z2 : > DCSM_ZSEL_Z2_P0 PAGE = 0, type = DSECT
}

The associated release build .hex file was successfully flashed into the processor, or at leas that is what UniFlash told me.  But afterwards, I can no longer unlock the processor, using the designated passwords (00112233, 44556677, 8899aabb, ccddeeff ).

I can see that the link pointer location was changed to 0x78030, as desired, and accomplished by setting the 3 LINK POINTER values to 0x1ffffffe.  And it looks like the related Zone Select Block values there are the ones I programmed in.  But again, I cannot unlock the processor, using the designated password values.

Please advise,

Robert

  • Hi Robert,

    How are you providing the password values to unlock it ? Can you post a snapshot of the same.

    Regards,

    Vivek Singh

  • Hi, thanks.  Doing it via the UniFlash too.  After a previous firmware download, I was able to use this method/location for entering the passwords, for lock/unlock.  And I thought the latest firmware had the same passwords.  But yet, no luck

  • I investigated the zone select blocks, by doing a data read in UniFlash, at the old one 0x70020, and the new at 0x70030.  And the passwords were swapped in the locations.  Once entering it in, in the new format, I was able to unlock.  But I still cannot load via JTAG, so will leave this open for more assistance.

    Robert

  • Able to unlock, but not flash image, per picture below.  I change the zone select block once more, to 0x78040, just for test.

    Here is the dcsm.asm and dcsm.cmd that the flash image was made with

    PAGE 0 : /* Program Memory */

    DCSM_OTP_Z1_LINKPOINTER : origin = 0x78000, length = 0x00000C
    DCSM_OTP_Z1_PSWDLOCK : origin = 0x78010, length = 0x000004
    DCSM_OTP_Z1_CRCLOCK : origin = 0x78014, length = 0x000004
    DCSM_OTP_Z1_BOOTCTRL : origin = 0x7801C, length = 0x000004

    DCSM_ZSEL_Z1_P0 : origin = 0x78040, length = 0x000010

    DCSM_OTP_Z2_LINKPOINTER : origin = 0x78200, length = 0x00000C
    DCSM_OTP_Z2_GPREG : origin = 0x7820C, length = 0x000004
    DCSM_OTP_Z2_PSWDLOCK : origin = 0x78210, length = 0x000004
    DCSM_OTP_Z2_CRCLOCK : origin = 0x78214, length = 0x000004
    DCSM_OTP_Z2_BOOTCTRL : origin = 0x7821C, length = 0x000004

    DCSM_ZSEL_Z2_P0 : origin = 0x78220, length = 0x000010

    }

    SECTIONS
    {
    dcsm_otp_z1_linkpointer : > DCSM_OTP_Z1_LINKPOINTER PAGE = 0 //, type = DSECT
    dcsm_otp_z1_pswdlock : > DCSM_OTP_Z1_PSWDLOCK PAGE = 0, type = DSECT
    dcsm_otp_z1_crclock : > DCSM_OTP_Z1_CRCLOCK PAGE = 0, type = DSECT
    dcsm_otp_z1_bootctrl : > DCSM_OTP_Z1_BOOTCTRL PAGE = 0, type = DSECT
    dcsm_zsel_z1 : > DCSM_ZSEL_Z1_P0 PAGE = 0 //, type = DSECT

    dcsm_otp_z2_linkpointer : > DCSM_OTP_Z2_LINKPOINTER PAGE = 0, type = DSECT
    dcsm_otp_z2_pswdlock : > DCSM_OTP_Z2_PSWDLOCK PAGE = 0, type = DSECT
    dcsm_otp_z2_crclock : > DCSM_OTP_Z2_CRCLOCK PAGE = 0, type = DSECT
    dcsm_otp_z2_bootctrl : > DCSM_OTP_Z2_BOOTCTRL PAGE = 0, type = DSECT
    dcsm_zsel_z2 : > DCSM_ZSEL_Z2_P0 PAGE = 0, type = DSECT

    .sect "dcsm_otp_z1_linkpointer"
    .retain
    .long 0x1FFFFFFD
    .long 0xFFFFFFFF ;Reserved
    .long 0x1FFFFFFD
    .long 0xFFFFFFFF ;Reserved
    .long 0x1FFFFFFD
    .long 0xFFFFFFFF ;Reserved

    ;; .sect "dcsm_otp_z1_pswdlock"
    ;; .retain
    ;; .long 0xFFFFFFFF
    ;; .long 0xFFFFFFFF ;Reserved

    ;; .sect "dcsm_otp_z1_crclock"
    ;; .retain
    ;; .long 0xFFFFFFFF
    ;; .long 0xFFFFFFFF ;Reserved

    ;; .sect "dcsm_otp_z1_bootctrl"
    ;; .retain
    ;; .long 0xFFFFFFFF ;Reserved
    ;; .long 0x55490B5A

    .sect "dcsm_zsel_z1"
    .retain
    .long 0x000000FF ; Z1-EXEONLYRAM
    .long 0x00003FFF ; Z1-EXEONLYSECT
    .long 0x10005555 ; Z1-GRABRAM

    .long 0x05555555 ; Z1-GRABSECT

    .long 0xccddeeff
    .long 0x8899aabb
    .long 0x44556677
    .long 0x00112233

  • Hi,

    You are programming below value for LINKPOINTER

    .sect "dcsm_otp_z1_linkpointer"
    .retain
    .long 0x1FFFFFFD
    .long 0xFFFFFFFF ;Reserved
    .long 0x1FFFFFFD
    .long 0xFFFFFFFF ;Reserved
    .long 0x1FFFFFFD
    .long 0xFFFFFFFF ;Reserved

    This is not correct. As I mentioned in other post, you can only program bit value '1' to '0' but can not program '0' to '1'. Value D means 0x1101. Assuming you have already programmed bit position 0 as '0', now you are trying to program it '1' which is no allowed. You can program it to either 0xC or 0x8.

    Please see below snapshot from TRM (section "3.13.1.5 Link Pointer and Zone Select")

    Please correct this and that should fix the issue.

    Regards,

    Vivek Singh

  • Yes, thank you, it now flashes.  I read that many times in TRM, but now have the context to understand it.  Maybe some future update of the documentation can add this type of an example, to give the reader better understanding.

    I'm also able to download via JTAG, so will close this thread (I'd expect more questions, but will generate a new thread).

    Robert