[SOLVED] Open Flashloader: Timeout while preparing target, core does not stop

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

  • [SOLVED] Open Flashloader: Timeout while preparing target, core does not stop


    I'm creating a ramcode using the open flashloader for custom hardware using the cortex-m3 core. (ATSAM3U2C controller)

    We're using our own library to do operations on an external serial SPI flash, and basically just calling that library in the flashloader methods.

    1. I'm wondering what can cause the following timeout error in j-link (after calling reset, then erase on j-link):

    Source Code

    1. T5234 004:610 JLINK_IsHalted() returns TRUE (0000ms, 0499ms total)
    2. T5234 004:611 JLINK_EraseChip() -- CPU_ReadMem(4 bytes @ 0xE000ED90) -- -------------------------------------- -- Start of determining flash info (Bank @ 0x20008000) -- End of determining flash info -- Start of determining dirty areas -- End of determining dirty areas -- Start of preparing flash programming -- Preparing RAMCode -- Calculating RAM usage -- RAM usage = 23376 Bytes -- Preserving CPU registers -- Preparing memory -- Preparing target -- Downloading RAMCode
    3. -- End of preparing flash programming -- CPU speed could not be measured. -- Start of erasing sectors -- Erasing range 0x20008000 - 0x2000FFFF (128 Sectors, 32 KB) -- Recalculating RAMUsage for optimal performance during programming -- RAM usage changed from 23376 to 11088 Bytes -- Initializing RAMCode -- Executing Init()
    4. ***** Error: Timeout while preparing target, core does not stop. (PC = 0x00000028, XPSR = 0x01000003, SP = 0x00011B30)!
    5. ***** Error: Failed to initialize RAMCode
    6. -- End of erasing sectors -- Start of restoring -- Executing UnInit()
    7. ***** Error:
    8. PC of target system has unexpected value after restoring target. (PC = 0x00000000)!
    9. ---------------------------------------------------------------------- Registers -------------------------------------------------------------------------------------
    10. PC = 00000000
    11. Current: R0 = FFFFFFFE, R1 = 00000003, R2 = 00000003, R3 = FFFFFFFE
    12. R4 = 00948832, R5 = 0E001052, R6 = 60008842, R7 = 00000000
    13. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    14. (2098ms, 2597ms total)
    15. T5234 004:611 -- End of restoring -- Total time needed: 2.096s (Prepare: 0.082s, Compare: 0.000s, Erase: 2.006s, Program: 0.000s, Verify: 0.000s, Restore: 0.007s) returns -5 (2105ms, 2604ms total)
    Display All
    Additional info: if I run reset then erase from the second time onwards, it only gives the timeout error (no restore), if I run halt, it shows a hard fault in memory management (no faults the first time I run erase). (edit: newest version 652b still gives PC counter error)
    -watchdogs should be disabled already
    -init and un-init only sets up access for the SPI flash

    2. Also, since it's regular SPI, I've saw in this thread that the memory addresses we give can be any unused address. Is that for both JLinkDevices.xml and FlashDev.c?

    Thank you

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

  • Hello,

    Thank you for your inquiry.
    Could you open a support inquiry through our official channels for this? How you can find in my signature.

    This thread will be closed now to avoid double information.

    Best regards,
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    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.