Jlink to download a bin file to memory and execute it

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

  • Jlink to download a bin file to memory and execute it

    Hello,

    I have a serial flash chip in my hardware and I have developed a bare metal application to download the program to flash memory.
    Currently I am using DS-5 IDE to download the the bare metal application and to execute it in the debug mode.



    I need to get rid of the IDE and I want a command line utility to download the raw bin file of the bare metal application to the memory and execute it.

    I am using a JLink base (I have ordered another JLink pro as well)

    My processor is Renesas
    R7S721001.



    If the IDE can download a binary to the memory and execute it, why cannot jlink to do it in command line?

    Thanks
    Ushan
  • Hi Ushan,
    If the IDE can download a binary to the memory and execute it, why cannot jlink to do it in command line?
    Who says this?...
    Have a look here: segger.com/jlink-flash-download.html#DevelopmentPurposes
    For your device, you should select "R7S721001"

    - Alex
    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 Alex,

    This is correct with Genmai Platform.
    Everything is working with it.

    However, it does not work with my target that uses serial flash of different manufacturer.

    Then I wrote a bare metal application that can directly be loaded to RAM using DS-5 IDE and execute it. That application can erase the serial flash and download the binaries.
    After that, my device is booted from serial flash.


    Does J-Link flasher support only Spansion serial flash?? (I use Winbond Serial flash that is almost same command set)

    Other alternative is to load my bare metal application to RAM from the J-Link. If J-Link can execute it, then the application will do the rest.

    I feel that J-Link can not do either! (1. Flash Winbond serial flash, Load a binary to RAM and execute it)

    Do you have any suggestion for it?

    Thanks,
    Ushan
  • Hi Ushan,

    I feel that J-Link can not do either! (1. Flash Winbond serial flash, Load a binary to RAM and execute it)
    Then your feeling is not correct... :)
    Download to RAM:
    How you do it, is up to you.
    Example via J-Link Commander:

    J-Link>halt
    J-Link>loadbin ,
    J-Link>setpc
    J-Link>go


    - Alex
    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 Alex,

    I know this...
    J-Link>halt
    J-Link>loadbin ,
    J-Link>setpc
    J-Link>go
    </addr></addr>



    My question is

    How do we download a binary to RAM using Jlink and JLink Commander?
    "J-Link>loadbin" failed all the time if I specify a RAM address....!


    I think it is a fair question to be asked from whom I bought the debugger hardware.


    Thnaks,
    Ushan
  • Hi Ushan,

    I got your question, but the answer is the same as before...
    Can you give an *exact* example of what loadbin command sequence fails, with *which* error message?
    J-Link ever was able to write RAM, is able to do so and will ever be able to do so...

    We have *thousands* of customers doing exactly what you want to do (for automated testing etc.)
    and it is working perfectly fine for them.


    - Alex
    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 Alex,

    This is the error I got. (Please note that I used the QSPI loader example provided by Renesas to to download binaries to RAM. Initially It was working with Genmai QSPI flash)

    ============================================================================

    Found 1 JTAG device, Total IRLen = 4:
    #0 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
    Cortex-A9 identified.
    Target interface speed: 12000 kHz
    Processing script file...

    Reset delay: 0 ms
    Reset type NORMAL: Toggle reset pin and halt CPU core.


    NumBytes should be <= 0x100000

    Downloading file [RAM_BASED/RZ_A1H_QSPI_LOADER.bin]...O.K.

    Loading binary file RAM_BASED/RZ_A1H_QSPI_LOADER.bin
    Reading 716132 bytes data from target memory @ 0x20000000.
    Verify failed @ address 0x20000000.
    Expected 18 read 20



    Script processing completed.

    Press any key to continue . . .
    ============================================================================




    and this is my commander file looks like
    ============================================================================

    //
    // Forces J-Link to program, even if flash contents already match data to be programmed
    //
    r
    //
    exec SetSkipProgOnCRCMatch=0
    //
    // Download application into QSPI flash
    //
    mem 0x20000000,0xA00000
    loadbin RAM_BASED/RZ_A1H_QSPI_LOADER.bin,0x20000000
    verifybin RAM_BASED/RZ_A1H_QSPI_LOADER.bin,0x20000000
    SetPC 0x20000000
    go
    exit

    ============================================================================

    this is the command I used to download the bin.


    "C:\Program Files (x86)\SEGGER\JLink_V490\JLink.exe" -speed 12000 -if JTAG -device R7S721001_DualSPI -CommanderScript NU_LOADER.Command


    I tried with the 'R7S721001' as well. Bu the result is same. I really appreciate if you can help on this matter!

    Thanks
    Ushan



    ---------------------------------------------------------------------------------------------------------------

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