[ANSWERED] JLink programming Cypress CYBL10xxx erases address 0 (bootloader)

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [ANSWERED] JLink programming Cypress CYBL10xxx erases address 0 (bootloader)

    Hello,

    I am trying to use a j-link plus to flash my cypress proc CYBL10563. I find that it is erasing the bootloader I have previously loaded even though I am not writing anywhere near that address.

    In the J-Link Server GDB output, you can see reads done near 0x00 that contain data, after loading, those values are all 0.

    This is preventing me from being able to flash my application using J-Link onto my cypress PRoC and have it run, as the bootloader have been removed.

    Any ideas or help would be greatly appreciated. We have several J-Link Plus and Base's and are looking to get this working so we don't need to keep using the MiniProg3.


    Using GDB:
    x/32wx 0
    0x0: 0x00000000 0x00000000 0x00000000 0x00000000
    0x10: 0x00000000 0x00000000 0x00000000 0x00000000
    0x20: 0x00000000 0x00000000 0x00000000 0x00000000
    0x30: 0x00000000 0x00000000 0x00000000 0x00000000
    0x40: 0x00000000 0x00000000 0x00000000 0x00000000
    0x50: 0x00000000 0x00000000 0x00000000 0x00000000
    0x60: 0x00000000 0x00000000 0x00000000 0x00000000
    0x70: 0x00000000 0x00000000 0x00000000 0x00000000


    J-Link Server GDB output:

    SEGGER J-Link GDB Server V6.00g Command Line Version

    JLinkARM.dll V6.00g (DLL compiled Aug 17 2016 13:22:04)

    -----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: on
    Init regs on start: on
    Silent mode: off
    Single run mode: on
    Target connection timeout: 5000 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: none
    J-Link settings file: none
    ------Target related settings------
    Target device: CYBL10xxx
    Target interface: SWD
    Target interface speed: 1000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V10 compiled Aug 17 2016 11:20:46
    Hardware: V10.00
    S/N: 600000556
    Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    Checking target voltage...
    Target voltage: 2.11 V
    Listening on TCP/IP port 2331
    Connecting to target...Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20004000)
    Target interface speed set to 1000 kHz
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x00000010)
    R0 = 40100004, R1 = 00000011, R2 = 00000000, R3 = 00000000
    R4 = 20004000, R5 = 08000000, R6 = A0000000, R7 = 0FFFF140
    R8 = 66D22029, R9 = 1D054813, R10= 82921548, R11= 8CAC9A78
    R12= 00003D00, R13= 20004000, MSP= 20004000, PSP= CC9F7F30
    R14(LR) = 10000153, R15(PC) = 00000010
    XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x00000010 (Data = 0xF000B508)
    Select auto target interface speed (2000 kHz)
    Flash breakpoints enabled
    Read 4 bytes @ address 0x00000010 (Data = 0xF000B508)
    Downloading 4096 bytes @ address 0x00001580 - Verified OK
    <<<CUT>>>
    Downloading 512 bytes @ address 0x00018300 - Verified OK
    Downloading 64 bytes @ address 0x0001FFC0 - Verified OK
    Writing register (PC = 0x90150000)
    Read 4 bytes @ address 0x00001590 (Data = 0x4B02B508)
    Read 2 bytes @ address 0x00003652 (Data = 0x4B4F)
    Read 2 bytes @ address 0x00003654 (Data = 0x4A4F)
    Read 2 bytes @ address 0x00003650 (Data = 0xB538)
    WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
    WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x00000000)
    Read 2 bytes @ address 0x00003652 (Data = 0x4B4F)
    Read 2 bytes @ address 0x00003654 (Data = 0x4A4F)
    Read 2 bytes @ address 0x00003652 (Data = 0x4B4F)
    Read 2 bytes @ address 0x00003654 (Data = 0x4A4F)
    Read 2 bytes @ address 0x00003650 (Data = 0xB538)
    R0 = 40100004, R1 = 00000000, R2 = 00000000, R3 = 00000000
    R4 = 00000000, R5 = 08000000, R6 = A0000000, R7 = 0FFFF140
    R8 = 66D22029, R9 = 1D054813, R10= 82921548, R11= 8CAC9A78
    R12= 00003D00, R13= 00000000, MSP= 00000000, PSP= CC9F7F30
    R14(LR) = 10000153, R15(PC) = 00000000
    XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
    Setting breakpoint @ address 0x00003650, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
    ...Target halted (DBGRQ, PC = 0xFFFFFFFE)
    Reading all registers
    WARNING: Failed to read memory @ address 0xFFFFFFFE
    Removing breakpoint @ address 0x00003650, Size = 2
    WARNING: Failed to read memory @ address 0xFFFFFFFC
    WARNING: Failed to read memory @ address 0xFFFFFFF8
  • Hi,

    All Cypress PSoc devices (as the one you are using) are handled to have only one big flash sector.
    It was implemented like this based on Cypress' requirements.
    So each time you do flash programming, the complete internal flash is erased.

    If you need a different behavior for your special case, you can always write your own flashloader and replace the one the J-Link software uses, by your one.
    For more information please refer to the J-Link User Guide shipped with the current version.
    Chapter "Adding Support for New Devices" / "Open Flashloader" (will be renamed in future manuals)


    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.