[SOLVED] j-link-plus We get an error "Writing Memory Failed".

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

  • [SOLVED] j-link-plus We get an error "Writing Memory Failed".

    We are using this programmer;
    https://www.segger.com/products/debug-probes/j-link/models/j-link-plus/
    After this command line;
    "C:\Program Files (x86)\SEGGER\JLink_V632h\JLink.exe" -device CY8C4248XXX-BLXXX -Speed 12000 -CommanderScript test.jlink

    We get an error "Writing Memory Failed".
    You can see all stage of programming below.What is the problem.Why we get this error.We are getting this error,but MCU is working properly.
    We are waiting for your response.
    Thank you very much.



    C:\arcelikC7S>"C:\Program Files (x86)\SEGGER\JLink_V632h\JLink.exe" -device CY8C
    4248XXX-BLXXX -Speed 12000 -CommanderScript test.jlink

    SEGGER J-Link Commander V6.32h (Compiled Jul 5 2018 18:11:36)
    DLL version V6.32h, compiled Jul 5 2018 18:11:19
    J-Link Command File read successfully.
    Processing script file...
    J-Link Commander will now exit on Error
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V10 compiled Jun 27 2018 10:57:29
    Hardware version: V10.10
    S/N: 600103142
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref=4.807V
    Selecting SWD as current target interface.
    Target connection not established yet but required for command.
    Device "CY8C4248XXX-BLXXX" selected.
    Connecting to target via SWD
    Found SW-DP with ID 0x0BB11477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x04770021)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xF0000000
    CPUID register: 0x410CC200. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p0, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ F0000000
    ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB471 ROM Table
    ROMTbl[1] @ E00FF000
    ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    Cortex-M0 identified.
    Reset delay: 0 ms
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    Executing ResetTarget()
    PC = 0002A91C, CycleCnt = 00000000
    R0 = 40100004, R1 = 0002A91D, R2 = 00000000, R3 = 00000000
    R4 = 20008000, R5 = 08000000, R6 = 0FFFF0E0, R7 = 00000000
    R8 = 304BD0B8, R9 = 920A9C21, R10= D2307C9F, R11= D384B364
    R12= 00000000
    SP(R13)= 20008000, MSP= 20008000, PSP= 2D727480, R14(LR) = 10000147
    XPSR = 61000000: APSR = nZCvq, EPSR = 01000000, IPSR = 000 (NoException)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    FPU regs: FPU not enabled / not implemented on connected CPU.
    Erasing device (CY8C4248xxx-BLxxx)...
    J-Link: Flash download: Total time needed: 0.107s (Prepare: 0.014s, Compare: 0.0
    00s, Erase: 0.089s, Program: 0.000s, Verify: 0.000s, Restore: 0.003s)
    Erasing done.
    Downloading file [ANAYAZILIM.hex]...
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (262144 bytes)
    J-Link: Flash download: Total time needed: 20.713s (Prepare: 0.044s, Compare: 0.
    193s, Erase: 0.088s, Program: 20.158s, Verify: 0.196s, Restore: 0.032s)
    Writing target memory failed.
    Script processing completed.
    Images
    • cypress_JLINK_error.jpg

      248.67 kB, 646×950, viewed 4,695 times
    • cypress_JLINK_error_2.jpg

      28.45 kB, 347×170, viewed 728 times
    Files
    • test.jlink

      (83 Byte, downloaded 386 times, last: )

    The post was edited 1 time, last by mutlukosemen ().

  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    We tried to reproduce the issue with a CY8CKIT-042 PSoC4 but erasing and flashing the chip was working without any errors using your sequence.
    Are you using custom hardware or an eval board?
    Could you provide an example .hex file with which the issue is reproducible?

    Best regards,
    Nino
    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.
  • Hello;

    You can find all files in the attachments.

    The HEX file was compiled with IAR for Arm 8.10.1.

    We are using this programmer.

    segger.com/products/debug-probes/j-link/models/j-link-plus/

    I have also send to you a form via "contact us" page apart from this forum.

    Best Regards.
    Images
    • cypress_JLINK_error.jpg

      248.67 kB, 646×950, viewed 681 times
    Files
    • ANAYAZILIM.hex

      (737.89 kB, downloaded 357 times, last: )
    • cypress_JLINK_error.txt

      (2.67 kB, downloaded 316 times, last: )
    • test.jlink

      (83 Byte, downloaded 352 times, last: )

    The post was edited 1 time, last by mutlukosemen ().

  • Hello,

    Thank you for providing the hex.
    There is an issue with that file. It has data at address 0x90600000 which is no valid Flash area.
    This needs to be removed from the file. Then you should be able to Flash your device without any errors.
    More information can be found here:
    wiki.segger.com/Flashing_Cypre…t_data_files_with_J-Flash

    mutlukosemen wrote:

    I have also send to you a form via "contact us" page apart from this forum.
    Please only use one communications channel, otherwise information can get lost and our response time could increase drastically.

    Best regards,
    Nino
    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.
  • Hello Nino;

    I have removed reletaed line from hex.

    But,i am getting this error.

    "Failed to open file."

    Best Regards.








    Erasing device (CY8C4248xxx-BLxxx)...
    J-Link: Flash download: Total time needed: 0.083s (Prepare: 0.015s, Compare: 0.0
    00s, Erase: 0.064s, Program: 0.000s, Verify: 0.000s, Restore: 0.004s)
    Erasing done.

    Downloading file [ANAYAZILIM_2.hex]...
    Failed to open file.

    Script processing completed.
    Files
    • ANAYAZILIM_2.hex

      (737.88 kB, downloaded 363 times, last: )
  • Hello,

    Did you remove all "non existing" memory areas?
    In your original file there was some more data at 0x90400000.
    After deleting all incorrect data I get the image attached.
    Is that working for you?

    Best regards,
    Nino
    Files
    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.
  • Hello;

    I have removed all "non existing memory areas.

    But, i am getting still same error."Failed to open file."

    The file that you sent is loaded with no errors.

    Can you send me in Intel Hex 16 bit format the file named "ANAYAZILIM_corrected.hex" like that.

    :10000000008000201DA902003DDE01003DDE010050
    :1000100000000000000000000000000000000000E0
    :1000200000000000000000000000000000000000D0
    :1000300000000000000000000000000000000000C0
    :1000400000000000000000000000000000000000B0
    :1000500000000000000000000000000000000000A0
    :100060000000000000000000000000000000000090
    :100070000000000000000000000000000000000080

    Thank you for your supoort.

    Best Regards.

    The post was edited 1 time, last by mutlukosemen ().

  • Hello,

    are you editing the file as explained in the Wiki article using J-Flash?
    Editing it in some other way might break the file format.

    mutlukosemen wrote:

    Can you send me in Intel Hex 16 bit format the file named "ANAYAZILIM_corrected.hex" like that.
    It does not make any difference for J-Link how the file is formatted. It will always be programmed correctly.

    Best regards,
    Nino
    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.
  • Thank you for your support.

    Problem is solved.

    As I understand,below lines are used only for cypress programmer.When I deleted these line,I could program the cypress through J-LINK with no error.


    :0200000490402A
    :1000000000000000000000000000000000000000F0
    :1000100000000000000000000000000000000000E0
    :1000200000000000000000000000000000000000D0
    :1000300000000000000000000000000000000000C0
    :1000400000000000000000000000000000000000B0
    :1000500000000000000000000000000000000000A0
    :100060000000000000000000000000000000000090
    :100070000000000000000000000000000000000080
    :0200000490501A
    :0C00000000021A1711AA00010000000005
    :0200000490600A
    :0100000001FE
    :040000050002A91D2F
  • Hello,

    Great to hear that you are up and running again.
    This thread will be marked as solved now.

    Best regards,
    Nino
    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.