[ABANDONED] Jlink call in Jenkins doesnt exit

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

  • [ABANDONED] Jlink call in Jenkins doesnt exit

    Hi all,
    I am trying to set up new test station for our product on Jenkins. My first step was enabling automatic binary loading from artefacts so step for this look like this

    Java Source Code

    1. stage("Download MCU"){
    2. when {
    3. expression { params.download_mcu == true }
    4. }
    5. steps {
    6. copyArtifacts filter: '**/*Release*.hex', projectName: "Pyrrha FW/develop", selector: specific("${params.mcu_build_number}")
    7. powershell """
    8. \$hex_path=Get-ChildItem *.hex -Name
    9. "r`r`nloadfile \$hex_path `r`nr`r`ngo `r`nq" > program.jlink
    10. echo "exit `r`n" | &'C:/Program Files (x86)/SEGGER/JLink_v670c/JLink.exe' -device STM32F777NI -speed 4000 -if SWD -autoconnect 1 -CommanderScript C:/data/jenkins/workspace/pyrrha-testing_'${BUILD_NUMBER}'/program.jlink
    11. """
    12. }
    13. }
    Display All


    so basically I make new file program.jlink with sequence:
    r
    loadfile "our_tag.hex"
    r
    go
    q

    then I am trying to call JLink.exe with params listed. Problem is that JLink.exe never stops:

    Shell-Script

    1. Copied 1 artifact from "Pyrrha FW » develop" build number 170
    2. [Pipeline] powershell
    3. SEGGER J-Link Commander V6.70c (Compiled Apr 7 2020 16:26:04)
    4. DLL version V6.70c, compiled Apr 7 2020 16:25:12
    5. J-Link Command File read successfully.
    6. Processing script file...
    7. Unknown command. '?' for help.
    8. Script processing completed.
    9. Connecting to J-Link via USB...O.K.
    10. Firmware: J-Link Ultra V4 compiled Apr 16 2020 17:18:49
    11. Hardware version: V4.00
    12. S/N: 504504689
    13. License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    14. VTref=3.036V
    15. Device "STM32F777NI" selected.
    16. Connecting to target via SWD
    17. Found SW-DP with ID 0x5BA02477
    18. Found SW-DP with ID 0x5BA02477
    19. DPIDR: 0x5BA02477
    20. Scanning AP map to find all available APs
    21. AP[1]: Stopped AP scan as end of AP map has been reached
    22. AP[0]: AHB-AP (IDR: 0x74770001)
    23. Iterating through AP map to find AHB-AP to use
    24. AP[0]: Core found
    25. AP[0]: AHB-AP ROM base: 0xE00FD000
    26. CPUID register: 0x411FC270. Implementer code: 0x41 (ARM)
    27. Found Cortex-M7 r1p0, Little endian.
    28. FPUnit: 8 code (BP) slots and 0 literal slots
    29. CoreSight components:
    30. ROMTbl[0] @ E00FD000
    31. ROMTbl[0][0]: E00FE000, CID: B105100D, PID: 000BB4C8 ROM Table
    32. ROMTbl[1] @ E00FE000
    33. ROMTbl[1][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
    34. ROMTbl[2] @ E00FF000
    35. ROMTbl[2][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    36. ROMTbl[2][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
    37. ROMTbl[2][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
    38. ROMTbl[2][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
    39. ROMTbl[1][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
    40. ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BB9A9 TPIU-M7
    41. Cache: Separate I- and D-cache.
    42. I-Cache L1: 16 KB, 256 Sets, 32 Bytes/Line, 2-Way
    43. D-Cache L1: 16 KB, 128 Sets, 32 Bytes/Line, 4-Way
    44. Cortex-M7 identified.
    45. J-Link>Unknown command. '?' for help.
    46. J-Link>Unknown command. '?' for help.
    47. J-Link>Unknown command. '?' for help.
    48. J-Link>Unknown command. '?' for help.
    Display All
    Unknown command then cycle till I kill it. If I put it right to powershell window it just execute itself exit.

    any idea what I did wrong ?

    Thanks in advance!
    Joe
  • Hi Joe,
    Thank you for your inquiry.

    As lines 10, 52-55 indicate, it seems like the J-Link commander cannot comprehend the commands you are trying to issue.
    Therefore, the J-Link Commander does not do anything but connect to the device and therefore also does not quit.

    Could you please provide us with the command file you are creating ("program.jlink")?

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