MAC57D5, J-Link, S32 DS

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

  • MAC57D5, J-Link, S32 DS

    I tried running Free RTOS by Mobiliya for CM4 in MAC57D5 using J-Link, but I have been successful in getting the set up to work. When I debug the RTOS project on S32 I get errors which are prvided down below. At this point, after having tried for so long without getting any help from anywhere, I am desperate. Any help or response otherwise would be greatly appreciated.
    Best Regards
    Asad Ullah

    "SEGGER J-Link GDB Server V6.14h Command Line Version

    JLinkARM.dll V6.14h (DLL compiled May 10 2017 18:22:45)

    WARNING: Unknown command line parameter -timeout found.
    WARNING: Unknown command line parameter 0 found.
    -----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: on
    Init regs on start: on
    Silent mode: off
    Single run mode: on
    Target connection timeout: 0 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: none
    J-Link settings file: none
    ------Target related settings------
    Target device: MAC57D5
    Target interface: SWD
    Target interface speed: 1000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V10 compiled Apr 21 2017 10:28:25
    Hardware: V10.10
    S/N: 260102083
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    Checking target voltage...
    Target voltage: 3.38 V
    Listening on TCP/IP port 2331
    Connecting to target...Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0xE59FF004)
    Target interface speed set to 1000 kHz
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x1840494C)
    R0 = 00000004, R1 = 00000001, R2 = 00000000, R3 = 00000000
    R4 = 00000001, R5 = 3E00026C, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000, R13= 3E0001EC, MSP= 3E0001EC, PSP= 00000000
    R14(LR) = 1840494D, R15(PC) = 1840494C
    XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x1840494C (Data = 0xD0062801)
    Select auto target interface speed (2000 kHz)
    Flash breakpoints enabled
    Semi-hosting enabled (Handle on BKPT)
    Semihosting I/O set to TELNET Client
    SWO disabled succesfully.
    ERROR: Could not detect CPU clock speed. Verification of test code downloaded into RAM failed.

    Failed to enable SWO. Could not measure target CPU frequency.
    Read 4 bytes @ address 0x1840494C (Data = 0xD0062801)
    Downloading 28 bytes @ address 0x18F9C000 - Verify failed
    .
    .//The statements have been replaced by dots to limit the whole message with in 10000 words.
    .
    Downloading 4096 bytes @ address 0x1902BAAC - Verify failed
    Downloading 4096 bytes @ address 0x1902CAAC - Verify failed
    Downloading 4096 bytes @ address 0x1902DAAC - Verified OK
    .
    .
    .
    .
    Downloading 4096 bytes @ address 0x1906CAAC - Verified OK
    Downloading 4096 bytes @ address 0x1906DAAC - Verify failed

    .
    .
    .
    Downloading 4096 bytes @ address 0x19104AAC - Verify failed
    Downloading 4096 bytes @ address 0x19105AAC - Verified OK
    .
    .
    .
    .
    Downloading 4096 bytes @ address 0x19144AAC - Verified OK
    Downloading 4096 bytes @ address 0x19145AAC - Verify failed
    Downloading 4096 bytes @ address 0x19146AAC - Verify failed
    Downloading 2332 bytes @ address 0x19147AAC - Verify failed
    Downloading 616 bytes @ address 0x191483C8 - Verify failed
    Downloading 4096 bytes @ address 0x19300000 - Verify failed
    Downloading 2752 bytes @ address 0x19301000 - Verify failed
    Downloading 752 bytes @ address 0x3E400000 - Verified OK
    Downloading 400 bytes @ address 0x3E401500 - Verified OK
    Writing register (PC = 0x58690119)
    Read 4 bytes @ address 0x19016958 (Data = 0xFFFFFFFF)
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x1840494C)
    Read 2 bytes @ address 0x190134EC (Data = 0xFFFF)
    Read 2 bytes @ address 0x190134EC (Data = 0xFFFF)
    Read 2 bytes @ address 0x190134EC (Data = 0xFFFF)
    R0 = 00000004, R1 = 00000001, R2 = 00000000, R3 = 00000000
    R4 = 00000001, R5 = 3E00026C, R6 = 00000000, R7 = 00000000
    R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
    R12= 00000000, R13= 3E0001EC, MSP= 3E0001EC, PSP= 00000000
    R14(LR) = 1840494D, R15(PC) = 1840494C
    XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x1840494C (Data = 0xD0062801)
    Setting breakpoint @ address 0x190134EC, Size = 2, BPHandle = 0x0001
    Starting target CPU...
    ERROR: Can not read register 15 (R15) while CPU is running
    Reading all registers
    ERROR: Can not read register 0 (R0) while CPU is running
    ERROR: Can not read register 1 (R1) while CPU is running
    ERROR: Can not read register 2 (R2) while CPU is running
    ERROR: Can not read register 3 (R3) while CPU is running
    ERROR: Can not read register 4 (R4) while CPU is running
    ERROR: Can not read register 5 (R5) while CPU is running
    ERROR: Can not read register 6 (R6) while CPU is running
    ERROR: Can not read register 7 (R7) while CPU is running
    ERROR: Can not read register 8 (R8) while CPU is running
    ERROR: Can not read register 9 (R9) while CPU is running
    ERROR: Can not read register 10 (R10) while CPU is running
    ERROR: Can not read register 11 (R11) while CPU is running
    ERROR: Can not read register 12 (R12) while CPU is running
    ERROR: Can not read register 13 (R13) while CPU is running
    ERROR: Can not read register 14 (R14) while CPU is running
    ERROR: Can not read register 15 (R15) while CPU is running
    ERROR: Can not read register 16 (XPSR) while CPU is running
    ERROR: Can not read register 17 (MSP) while CPU is running
    ERROR: Can not read register 18 (PSP) while CPU is running
    ERROR: Can not read register 24 (PRIMASK) while CPU is running
    ERROR: Can not read register 25 (BASEPRI) while CPU is running
    ERROR: Can not read register 26 (FAULTMASK) while CPU is running
    ERROR: Can not read register 27 (CONTROL) while CPU is running
    ERROR: Can not read register 32 (FPSCR) while CPU is running
    ERROR: Can not read register 33 (FPS0) while CPU is running
    ERROR: Can not read register 34 (FPS1) while CPU is running
    ERROR: Can not read register 35 (FPS2) while CPU is running
    ERROR: Can not read register 36 (FPS3) while CPU is running
    ERROR: Can not read register 37 (FPS4) while CPU is running
    ERROR: Can not read register 38 (FPS5) while CPU is running
    ERROR: Can not read register 39 (FPS6) while CPU is running
    ERROR: Can not read register 40 (FPS7) while CPU is running
    ERROR: Can not read register 41 (FPS8) while CPU is running
    ERROR: Can not read register 42 (FPS9) while CPU is running
    ERROR: Can not read register 43 (FPS10) while CPU is running
    ERROR: Can not read register 44 (FPS11) while CPU is running
    ERROR: Can not read register 45 (FPS12) while CPU is running
    ERROR: Can not read register 46 (FPS13) while CPU is running
    ERROR: Can not read register 47 (FPS14) while CPU is running
    ERROR: Can not read register 48 (FPS15) while CPU is running
    ERROR: Can not read register 49 (FPS16) while CPU is running
    ERROR: Can not read register 50 (FPS17) while CPU is running
    ERROR: Can not read register 51 (FPS18) while CPU is running
    ERROR: Can not read register 52 (FPS19) while CPU is running
    ERROR: Can not read register 53 (FPS20) while CPU is running
    ERROR: Can not read register 54 (FPS21) while CPU is running
    ERROR: Can not read register 55 (FPS22) while CPU is running
    ERROR: Can not read register 56 (FPS23) while CPU is running
    ERROR: Can not read register 57 (FPS24) while CPU is running
    ERROR: Can not read register 58 (FPS25) while CPU is running
    ERROR: Can not read register 59 (FPS26) while CPU is running
    ERROR: Can not read register 60 (FPS27) while CPU is running
    ERROR: Can not read register 61 (FPS28) while CPU is running
    ERROR: Can not read register 62 (FPS29) while CPU is running
    ERROR: Can not read register 63 (FPS30) while CPU is running
    ERROR: Can not read register 64 (FPS31) while CPU is running
    WARNING: Failed to read memory @ address 0x00000000
    Removing breakpoint @ address 0x190134EC, Size = 2
    WARNING: Failed to read memory @ address 0x00000000
    "
  • Hi Asad,


    could you please answer the questions I asked you in the first thread?
    Hi Asad,


    as you mentioned, the MCU is not listed as supported.
    We will reach out to NXP if they can provide us with an eval board.


    In the mean time, could you please provide us with a screenshot of the complete J-Link Commander output?
    To which core are you trying to connect?



    Best regards,
    Niklas
    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.
  • The problem in the old post has been solved, thanks to your answer on some one else's post.

    HI Niklas,
    Thanks for the response. And I am sorry, I didn't follow my last thread since the old problem has been solved, though I should mention it over there, which I will soon. The problem that I was having when I initiated the other thread was that the J-Link was unable to connect to the target, and now it does connect to Target thanks to the JScript file uploaded by you (SEGGER - Niklas) on an other thread. Now I have come further ahead as connection to target is no more an issue, but now the problem is with "reading the registers" while debigging with S32, as shown in the first post of this thread. Now I have attached the screenshots as asked by you from the J-Link Commander window when I try to connect to CORTEX M4 of MAC57D5, One is with the JScript file added and the others are without it of which 1 with SWD and the other with JTAG connection.
    Best Regards,
    Asad
    Images
    • JScript.png

      34 kB, 664×1,143, viewed 573 times
    • WO_JScript_SWD.png

      31.67 kB, 664×1,143, viewed 497 times
    • WO_JScript_JTAG.png

      27.9 kB, 664×1,143, viewed 509 times

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

  • Hi,


    the first screenshot looks good so far.
    Do the commands go / halt / regs work in J-Link Commander?
    What command line parameter do you use for J-Link GDBServer?


    Best regards,
    Niklas
    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.
  • MAC57D5, J-Link

    Dear Niklas,
    Thanks for the response, the first screenshot is the one with JLinkScript file added, while the other two are the ones taken prior to adding the JLinkScript file.
    Now I have tried the commands that you asked me to, and I guess they are working as they should, but anyway I am attaching the screenshot of them working. Also I tried GDB server and added the screenshot for it too. I am clueless beyond this point, Please help. If segger could add support for the device, it would be mighty helpful.
    Thanks
    Best Regards
    Asad
    Images
    • halt_regs_go.png

      79.97 kB, 664×1,143, viewed 534 times
    • GDBServer.png

      41.63 kB, 550×782, viewed 571 times

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

  • Hi Asad,


    Well, it is working with J-Link Commander, so you just need to to pass the scriptfile to the GDB server aswell, and it will work in GDB Server.
    In order to pass the scriptfile to gdbserver, just start it with JLinkGDBServer.exe -jlinkscriptfile $PATH_TO_SCRIPTFILE .


    Best regards,
    Niklas
    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.
  • GDBServer not connecting

    Hi Niklas,
    Again, I am grateful for your response. I tried the command "JLinkGDBServer.exe -jlinkscriptfile $(I added the path to the scriptfile)" as asked by you, but I will have to say that it is not working either. The result has been attached as screenshot, it has not been able to connect to GDB server.
    If you can offer any help, It will be greatly appreciated.
    Regards
    Asad
    Images
    • 1.png

      17.54 kB, 460×478, viewed 519 times
    • 2.png

      25.06 kB, 550×405, viewed 553 times
  • Hi,


    could you please give GDBServerCl.exe a try?
    If it does not work, could you please provide us the complete output of both the GDB Server as well as the GDB Client?


    Best regards,
    Niklas
    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.
  • I did try as you asked me to, but it didn't work. I have attached the screenshots. You mentioned that you were to ask NXP to provide you with the MAC57D5 and do something about it, so may I ask how did it pan out? Also when I asked NXP that Segger J-Link doesn't work with MAC57D5 and they have mentioned it on their website by mistake, so what's your take on it? As Segger themselves have mentioned that J-Link can work with cortex m4 and a5 but we haven't been able to get it to work it. So please help or if you too consider that the j-link can not work with mac57d5 then please inform so that I may stop wasting my time.
    Thanks
    Images
    • segger_out.JPG

      79.96 kB, 669×680, viewed 498 times
  • Hi,


    what exactly are you referring to with the term "didn't work"?
    According to the screenshots, everything is working, and the Server is waiting for a client to connect.

    It is also confirmed working for another customer:
    [SOLVED] NXP MAC57D54H


    Best regards,
    Niklas
    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 Asad,


    well what happening from this point on is usually up to you :)

    What IDE do you want to use?
    What are you trying to do in general?
    Debug a target application? Do you already have the application binary (like a .elf, .out, .hex. or .mot file?)


    Best regards,
    Niklas
    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 Nikolas,
    Thanks for the reply, I hear you, but the thing is that I am trying to put free RTOS in MAC57D5 by following the exact instructions given by NXP except that I am using Segger Jlink instead of Multilink Universal from PEmicro. I am using S32 design studio in the process and the elf gets generated successfully while the next step fails. I have mentioned the progress in the first post of this post. If you would please have another glance at the output I would really appreciate it. Also may I ask if you got any response in regard to your request for sending you the MAC evaluation board, which you had said that you would ask them?
    Though, by now I am tempted to drop Segger Jlink for PEmicro multilink as NXP themselves have said that they had put JLink's name below emulators for Emulators on their website by mistake.
    Anyway thanks, If you think Segger can do it please help.
    Best Regards
    Asad
  • Hi Asad,


    can you provide me a link to the instructions by NXP or a project file for S32?
    by following the exact instructions given by NXP except

    I will try to setup the J-Link script file in the project.


    As an alternative, you can use Ozone as a debugger with the application build by S32.
    Ozone is part of the software available for J-Link, which can be downloaded free of charge here .
    Ozone can be used for evaluation purposes free of charge with any J-Link. J-Link Plus or higher ship with a burned-in unlimited license for Ozone.
    • Start Ozone
    • In the startup-dialog, select Create New Project
    • Click on the Button "..." to the right of the Device Box and select your target device (Selecting only the core will only work when debugging in RAM)
    • Click Next
    • Choose the correct target interface (JTAG/SWD/etc..)
    • Use a valid speed (Default: 4000kHz, try 100-500 if default does not work)
    • Click Next
    • Click on the Button "..." in order to select a Data file (the .elf file / .out file/ etc build by the IDE)
    • Click Finish
    • enter Project.SetJLinkScript (<path to scriptfile>) in the console in order to use the J-Link script file
    • Press F5 or click the green on/off button in the left upper corner
    • The debug session should be ready to use
    If anything fails, could you please post a screenshot of the complete session, and copy paste the complete contents of the Console window?


    Best regards,
    Niklas
    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 Niklas,
    Thanks a lot for the reply. As you asked, the Link of the Free RTOS and instruction set is as follows: mobiliya.com/NXP
    Please download the package named as MAC57D5xx FreeRTOS Software Enablement , it includes the instruction file in the documents folder named as: Halo_FreeRTOS_UserGuide.
    I generated .elf file using S32 design studio of the RTOS and then used the .elf file with ozone to debug it, but the process failed. I am including text file that contains the console progress and the screenshot of complete session.
    Thanks,
    Regards
    Asad
    Images
    • segger_3.png

      187.36 kB, 1,024×768, viewed 512 times
    Files
  • Hi,


    actually, that looks quite successfully to me :)
    The script file was loaded and the connect was successful.
    Ozone says it found source for 294 source files and could not find 60.
    This is normal as you usually do not have source for standard libraries like stdio.

    Can you set breakpoints and single step?

    Best regards,
    Niklas
    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,
    As you say, the problem is not with JLink not being able to work with MAC57D5. So, ideally it should work with S32 design studio and RTOS project and not get stuck at "starting target CPU", but sadly it is what actually happens. I would request you to please study the attachments for once and tell me why it does not work.
    Thanks
    Regards
    Asad
    Images
    • s32_MAC57D5.png

      129.72 kB, 1,600×1,160, viewed 463 times
    Files
    • s32_MAC57D5.txt

      (23.62 kB, downloaded 497 times, last: )
  • Hi Asad,


    it seems like the J-Link script file is not used when J-Link GDB server is called from the IDE.
    How did you specify the J-Link script file inside the IDE?
    Or is the GDB server opened manually and the IDE does only connect?

    Best regards,
    Niklas
    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,
    I think there is no issue with Jscript file not being utilized, s32 design studio opens up the jlink gdb server by itself, and then I select M4 as the processor,as MAC57D5 isn't mentioned in the device list.
    When I had not added the JLink Script file it wouldn't even connect to the targer but now the console says that it does connect to the target, but it fails to start the target cpu. I am pasting a chunk of the console content shows that it does connect,
    "-----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: on
    Init regs on start: on
    Silent mode: off
    Single run mode: on
    Target connection timeout: 0 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: none
    J-Link settings file: none
    ------Target related settings------
    Target device: MAC57D54H
    Target interface: SWD
    Target interface speed: 1000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V10 compiled Jul 24 2017 17:04:53
    Hardware: V10.10
    S/N: 260102083
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    Checking target voltage...
    Target voltage: 3.38 V
    Listening on TCP/IP port 2331
    Connecting to target...Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0xE59FF004)
    Target interface speed set to 1000 kHz
    Resetting target
    Halting target CPU...
    ...Target halted (PC = 0x184047D6)"

    Regards
    Asad
  • Hi Asad,

    Connecting to target...Connected to target

    Sorry, i oversaw this.


    However, the J-Link script file is definitely not loaded:
    J-Link script: none



    According to the memory map, @0x19000000 is flash memory.
    Flash memory cannot be programmed w/o either native support or adding the device manually(by implementing a own flashloader): Adding Support for New Devices.

    Debugging in RAM should be possible though.


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