[SOLVED] JLinkGDBServer does not use script file

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

  • [SOLVED] JLinkGDBServer does not use script file

    I'm using a JLink EDU under Linux. With the command line JLinkGDBServer -device ARM9 -endian little -speed 15000 -port 2331 I can connect to the device and debug it.
    Now I want to use a jlinkscript and to start I wrote a small test.

    C Source Code: Test.JLinkScript

    1. int InitTarget(void) {
    2. JLINK_SYS_Report("Test");
    3. CPU = ARM9;
    4. return 0;
    5. }
    If I try to start this with JLinkGDBServer -endian little -speed 15000 -port 2331 -jlinkscriptfile "Test.JLinkScript" it doesn't work. It complains about an unspecified device and the "Test" string is nowhere to be seen.

    What is wrong with my script?

    Other unclear things:
    - The prototype for function InitTarget in the documentation is int InitTarget(void) but it is also used as void InitTarget(void). Can these uses be exchanged freely?
    - The documentation of global DLL constants state there are values like "ARM926EJS" for the CPU variable. These do not appear in the selection dialog for unspecified targets. Are these values still valid?
  • Hi,

    If you pass the device name via the -device option to GDB Server, there is no need to have the "CPU = ARM9" statement in the script.
    Also, GDBServer expects you to select the device inside GDBServer (e.g. by passing the -device option).
    The script file is a black box for GDB Server and just forwarded to the J-Link DLL.
    The "CPU = " option in the script file is mainly there for some exotic overrides for buggy IDEs.

    Long story short:
    Go for the "-device" option and you are set.


    BR
    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.