[SOLVED] Programming speed

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

  • [SOLVED] Programming speed

    Hello, I'm using STM32L031 and I wish I could use jlink plus as a production tool.
    I manage to program my device with JFlash in less than 2s (erase + program / Verify), but it takes 35s when using jlink.exe. I've read it could be a matter of vtref, but it would also affect JFlash.
    The command line used is

    Source Code

    1. Jlink.exe -device STM32L031G6 -If SWD -speed 4000 -CommandFile JlinkCommand.txt -autoconnect 1




    the Command file is


    Source Code

    1. is
    2. log jlinklog.txt
    3. Speed 4000
    4. VTREF 3300
    5. r
    6. Speed 4000
    7. erase
    8. loadfile D:\jlinktest\firsttry.hex
    9. r
    10. g
    11. qc
    Display All


    Log file is
    [code]T7104 000:382 SEGGER J-Link V5.12f Log File (0001ms, 0379ms total) T7104 000:382 DLL Compiled: May 17 2016 16:03:35 (0001ms, 0379ms total) T7104 000:382 Logging started @ 2019-06-11 09:31 (0001ms, 0379ms total) T7104 000:383 JLINK_SetSpeed(4000) (0000ms, 0379ms total) T7104 000:386 JLINK_SetResetDelay(0) (0000ms, 0379ms total) T7104 000:386 JLINK_Reset() -- CPU_ReadMem(4 bytes @ 0x20000000) -- CPU_WriteMem(4 bytes @ 0x20000000) -- CPU is running... T7104 000:403 JLINK_SetSpeed(4000) (0000ms, 0395ms total) T7104 000:403 JLINK_IsHalted() returns TRUE (0000ms, 0395ms total) T7104 000:404 JLINK_EraseChip() ... -- Total time needed: 11.142s (Prepare: 0.266s, Compare: 0.000s, Erase: 0.863s, Program: 0.000s, Verify: 0.000s, Restore: 10.011s) returns 0 (11146ms, 11541ms total) T7104 011:552 JLINK_IsHalted() returns TRUE (0000ms, 11541ms total) T7104 011:552 JLINK_DownloadFile()JLINK_BeginDownload(Flags = 0x00) (0002ms, 11543ms total) T7104 011:552 JLINK_WriteMem(0x08000000, 0x2610 Bytes, ...) - Data: 10 06 00 20 D5 00 00 08 69 17 00 08 DB 14 00 08 ... returns 0x2610 (0003ms, 11544ms total) T7104 011:552 JLINK_EndDownload() -- CPU is running at low speed (4193 kHz). -- CPU is running at 4193 kHz. ... -- All CRCs match -- Comparing ... -- All CRCs match -- End of comparing flash ***** Error: Verification failed @ address 0x08000000 -- End of verifying flash -- Start of restoring -- Restore RAMCode -- Total time needed: 23.809s (Prepare: 0.069s, Compare: 20.103s, Erase: 0.068s, Program: 0.545s, Verify: 0.000s, Restore: 3.021s) ***** Error: Verification failed @ address 0x08000000 returns 0xFFFFFFFC (23817ms, 35358ms total) T7104 011:552 returns 0xFFFFFEF5 (23817ms, 35358ms total) T7104 035:371 JLINK_SetResetDelay(0) (0000ms, 35358ms total) T7104 035:371 JLINK_Reset() T7104 035:388 JLINK_GoEx(MaxEmulInsts = 0, Flags = 0x01) -- CPU_ReadMem(4 bytes @ 0xE0001000) -- CPU_WriteMem(4 bytes @ 0xE0001000) -- CPU_WriteMem(4 bytes @ 0xE0001004) (0001ms, 35376ms total) T7104 035:389 JLINK_IsOpen() returns 0x01 (0000ms, 35376ms total) T7104 035:412 JLINK_Close() >0x42 TIF> >0x28 TIF> >0x0D TIF> >0x21 TIF> (0002ms, 35378ms total) T7104 035:412 (0002ms, 35378ms total) T7104 035:412 Closed (0002ms, 35378ms total)[/code]
  • Hello,

    Thank you for your inquiry.
    The difference between J-Flash and J-Link Commander is how you call the commands.
    In J-Flash you provide the program already with your application for programming.
    So only the parts are erased that are overwritten by the new image.

    In case of Commander you explicitly call erase before programming which will issue a chip erase. This typically takes 20-30 seconds. It is already the fastest possible speed if you consult the ST manual.
    So if you want to use Commander for this and want faster erase times and dont need a chip erase skip the erase part in the commandfile and go directly to loadfile.

    As a side not we do not recommend using J-Link Commander for production purposes. For ths J-Flash has explicitly been created as our professional production tool. J-Link Commander is meant to be used for debugging and troubleshooting.

    Best regards,
    Nino
    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 contact us per e-mail.
    Alternatively our support system can be used as well: segger.com/ticket/
  • Thanks Nino,
    I need to programm 20 parts in the same batch, so that I need to synchronise Jlink with a personnal board made for this purpose. I don't see that jflash can be called by an external software, is there a way to do the opposite and that Jflash call an external tool that I could make?
  • Hello,

    Daffy wrote:

    I need to programm 20 parts in the same batch, so that I need to synchronise Jlink with a personnal board made for this purpose. I don't see that jflash can be called by an external software, is there a way to do the opposite and that Jflash call an external tool that I could make?
    J-Flash can be called via command line interface just like J-Link commander.
    More information can be found in the J-Flash user manual:
    segger.com/downloads/jlink/UM08003


    Daffy wrote:

    The procedure is indeed very fast without erase. I just need a way to catch the programming status now
    Under Windows you get a programming progress pop-up in both J-Flash and J-Link Commander.
    In J-Flash the progress is logged additionally logged in the console.

    Best regards,
    Nino
    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 contact us per e-mail.
    Alternatively our support system can be used as well: segger.com/ticket/