[SOLVED] "Error: PC of target system has unexpected value after Verifying sector. (PC = 0x0000029C)! " when download into External Flash.

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

  • [SOLVED] "Error: PC of target system has unexpected value after Verifying sector. (PC = 0x0000029C)! " when download into External Flash.

    Hi,
    I am trying to use the J-Link Flash loader in the following setup:
    Eclipse IDE for C/C++ Developers Oxygen Release (4.7.0)
    GNU Tools ARM Embedded(Compiler, Linker)
    GDB SEGGER J-Link Debugging plugin
    J-Link software V6.30h
    J-Link Hardware version: V9.20
    Our Cortex-M0 Device


    The memory map of device is:
    0x00000000-0x0000FFFF: PRAM(Contains the main application)
    0x20002000-0x20005FFF: SRAM(Working RAM)
    0x60000000-0x607FFFFF: External Flash



    I use the flash loader and add support for new devices to the J-Link DLL. This two flash loader(see attachment) can work well in Keil uVision 5 + J-Link.
    And here is my JLinkDevices.xml: (see attachment)
    <DataBase>
    ...
    <Device>
    <ChipInfo Vendor="SONiX" Name="SNC7312" WorkRAMAddr="0x20002000" WorkRAMSize="0x4000" Core="JLINK_CORE_CORTEX_M0"/>
    <FlashBankInfo Name="Code Flash" BaseAddr="0x00000000" MaxSize="0x10000" Loader="Devices/SONiX/SNC7312_PRAM2Flash_160422.FLM" LoaderType="FLASH_ALGO_TYPE_OPEN" AlwaysPresent="1"/>
    <FlashBankInfo Name="Data Flash" BaseAddr="0x60000000" MaxSize="0x800000" Loader="Devices/SONiX/SNC7312_SPIFLASH_160421.FLM" LoaderType="FLASH_ALGO_TYPE_OPEN" AlwaysPresent="1"/>
    </Device>
    ...
    </DataBase>



    My eclipse based project is in attachment, which memory map is:
    Memory Configuration
    Name Origin Length Attributes
    FLASH 0x00000000 0x00010000 xr
    RAM 0x20000000 0x00010000 xrw
    CCMRAM 0x10000000 0x00000000 xrw
    FLASHB1 0x00000000 0x00000000 xr
    EXTMEMB0 0x00000000 0x00000000 xr
    EXTMEMB1 0x00000000 0x00000000 xr
    EXTMEMB2 0x00000000 0x00000000 xr
    EXTMEMB3 0x00000000 0x00000000 xr
    MYVARS 0x60020000 0x00800000 xrw
    *default* 0x00000000 0xffffffff


    Question 1.So far, I can download into PRAM(0x00000000-0x0000FFFF), but can't download into External Flash(0x60000000-0x607FFFFF).I checked memory 0x60020000-0x6002000F in Eclipse memory window or J-Mem V6.30h, it always 0.But it should like this:AddressData0x6002000001 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00


    Question 2.
    I find error message "PC of target system has unexpected value after Verifying sector. (PC = 0x0000029C)!" in J-Link Log.(see attachment)


    Any advice on how to download into the External Flash? I would be grateful for any suggestions.




    Best Regards
    Wilson
  • Hi,

    I encountered some problems when I was uploading files. I can't upload any attachments.
    Is there another way I can send attachments to you?

    Sorry, it is unclear about "Question 1" in previous post.
    Revised as follows,
    Question 1.
    So far, I can download into PRAM(0x00000000-0x0000FFFF), but can't download into External Flash(0x60000000-0x607FFFFF).
    I checked memory 0x60020000-0x6002000F in Eclipse memory window or J-Mem V6.30h, it always 0.
    But it should like this:
    Address: 0x60020000-0x6002000F, Data: 01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00

    Best Regards
    Wilson

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

  • Hello,

    Thank you for your inquiry.
    Regarding Q1:
    Do you get any error messages when programming?
    Are you using the same JLinkDevices.xml and flash loader when using J-Mem?
    If not, J-Mem can't access the external memory and will show 00000 as data instead.

    Q2:
    Such an issue is not known to us.
    Attachments in this forum are limited to maximum 1.05 MB in size. Make sure the file you try to upload is smaller than that or split it in multiple files.

    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.
  • Hi Nino,

    I can upload files now, please see attachments.

    Q1:
    Do you get any error messages when programming?
    I get error message " ***** Error: 02-00000000-00-00014641-0053: PC of target system has unexpected value after Verifying sector. (PC = 0x0000029C)!" when programming.

    In
    JLinkLog.txt,
    Line 411 - Line 442. It seems download into PRAM is OK.
    Line 444 - Line 449. It seems download into external flash is OK.
    Line 451 - Line 512. I don't understand why J-Link compares, erases and programs several times, and prints error messages.


    Are you using the same JLinkDevices.xml and flash loader when using J-Mem?
    If not, J-Mem can't access the external memory and will show 00000 as data instead.
    Yes, I am using the same JLinkDevices.xml and flash loader when using J-Mem.

    Best regards,
    Wilson
    Files
    • FlashLoader.7z

      (8.09 kB, downloaded 405 times, last: )
    • JLinkDevices.7z

      (3.95 kB, downloaded 399 times, last: )
    • EclipseProject.7z

      (89.9 kB, downloaded 390 times, last: )

    The post was edited 2 times, last by mingfeng_wu ().

  • Hello Wilson,

    if it is working with keil but not with Eclipse it is most likely a project setup issue.
    From J-Link perspective everything is working correctly and J-Link does what the IDEs tell it to do.
    Please understand that we can't put more time into this as this is not J-Link related issue.
    We recommend using another IDE (e.g. Embedded Studio) or to get in contact with Eclipse support.

    Regarding J-Mem. Check if you can read any of the external memory in the memory window of the IDE. If not J-Mem will also not be able to access it
    which could point to a incorrect flash loader or the loaded application disabling access to the memory after download.

    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.