[SOLVED] Freescale IMX6SoloX support

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

  • [SOLVED] Freescale IMX6SoloX support

    I am trying to use JLink Ultra to debug IMX6SoloX processor from Freescale.
    Unfortunately, it does not detect neither Cortex-A9 nor Cortex-M4 core.
    Is there any advice or dedicated script file to support this chip ?
  • Hi all,

    We have already get back to "ak13" regarding this via E-Mail. For all other users, who may experience the same issue, please find the answer below:

    Freescale did not the best job when implementing multi-core for the iMX6 SoloX. Even the Cortex-A9 needs a script file for a successfully connection.

    Anyhow, in general, J-Link supports the i.MX6 SoloX. Please find attached the respective script files to connect to the A9 and M4 core.

    Please note that on the SoloX the M4 cannot be independently debugged without having something running on the A9 that enables the M4. Since Freescale removed some features from the i.MX6 to the SoloX, it is no longer possible to easily enable the M4 from the debug interface and so being able to debug it completely independent from the A9.

    Startup procedure is:
    1) Start debug session that connects to A9 and let it run the application to the point that enables the M4
    2) Start debug session that connects to M4
    [...]
    x) Close debug session that connects to M4
    x + 1) Close debug session that connects to A9

    How to use J-Link script files:
    Please refer to J-Link User Guide (UM08001), chapter "J-Link script files"


    - Erik
    Files
    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.
  • j-Link MX6SoloX Debug

    Hello,





    I am trying to debug an MX6SoloX Sabre-SD board using a
    J-Link EDU. I followed the instructions at the following link:





    wiki.segger.com/index.php?title=I.MX6_SoloX_Support





    when we try to connect to the board we get the following:





    SEGGER J-Link GDB Server V5.10e Command
    Line Version[font=&quot][/font]





    JLinkARM.dll V5.10e (DLL compiled Dec 21
    2015 18:21:49)[font=&quot][/font]





    -----GDB Server start settings-----[font=&quot][/font]


    GDBInit
    file:
    none[font=&quot][/font]


    GDB Server Listening
    port: 2331


    SWO raw output listening port: 2332[font=&quot][/font]


    Terminal I/O
    port:
    2333[font=&quot][/font]


    Accept remote
    connection: localhost only[font=&quot][/font]


    Generate
    logfile:
    on[font=&quot][/font]


    Verify
    download:
    on[font=&quot][/font]


    Init regs on
    start: off[font=&quot][/font]


    Silent
    mode:
    off[font=&quot][/font]


    Single run
    mode:
    on[font=&quot][/font]


    Target connection
    timeout: 0 ms


    ------J-Link related settings------[font=&quot][/font]


    J-Link Host
    interface: USB[font=&quot][/font]


    J-Link
    script:
    /home/freescale/mx6SoloX_BareMetal/MX6SX_m4/A9.JLinkScript[font=&quot][/font]


    J-Link settings
    file: none[font=&quot][/font]


    ------Target related settings------[font=&quot][/font]


    Target
    device:
    MCIMX6L8[font=&quot][/font]


    Target
    interface:
    JTAG[font=&quot][/font]


    Target interface speed:
    100kHz[font=&quot][/font]


    Target
    endian:
    little[font=&quot][/font]





    Connecting to J-Link...[font=&quot][/font]


    J-Link is connected.[font=&quot][/font]


    Firmware: J-Link V9 compiled Dec 21 2015
    09:38:47[font=&quot][/font]


    Hardware: V9.30[font=&quot][/font]


    S/N: 269306530[font=&quot][/font]


    OEM: SEGGER-EDU[font=&quot][/font]


    Feature(s): FlashBP, GDB[font=&quot][/font]


    Checking target voltage...[font=&quot][/font]


    Target voltage: 3.30 V[font=&quot][/font]


    Listening on TCP/IP port 2331[font=&quot][/font]


    Connecting to target...WARNING: At least
    one of the connected devices is not JTAG compliant (IEEE Std 1149.1, 7.1.1.d,
    IR-cells). (NumDevices = 4, NumBitsSet = 3)





    WARNING: At least one of the connected
    devices is not JTAG compliant (IEEE Std 1149.1, 7.1.1.d, IR-cells). (NumDevices
    = 4, NumBitsSet = 3)[font=&quot][/font]





    ERROR: Cortex-A/R (connect): Could not
    unlock debug registers[font=&quot][/font]


    ERROR: Could not connect to target.[font=&quot][/font]


    Target connection failed. GDBServer will
    be closed...Restoring target state and closing J-Link connection...[font=&quot][/font]


    Shutting down...





    We are probably doing something wrong, just not sure how to
    proceed here. Your help would be greatly appreciated.





    Thanks,


    Ronen Benayoun
  • Hi,


    we were able to reproduce this issue.
    There is an error regarding script parsing introduced with J-Link V5.10. A fixed version will be released in the near future.
    As a workaround, J-Link V5.02f can be used in the mean time.

    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.
  • We have just released V5.10g of the J-Link software and documentation package in which this has been fixed.
    The version is available for download on our webpage: segger.com/jlink-software.html

    Best regards
    Erik
    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.
  • Script for M4 is wrong

    Hello,

    the script for M4 is wrong. The correct configuration code inside the script should be:
    JLINK_CORESIGHT_Configure("IRPre=0;DRPre=0;IRPost=13;DRPost=3;IRLenDevice=4");

    Find attached the correct script file.

    Please fix as well the https://wiki.segger.com/index.php?title=I.MX6_SoloX_Support

    Thanks
    Anthony
    Files
  • Hi Anthony,

    thanks for providing the script.
    We will do a quick test and then update our wiki page.


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

    could your provide us with an example application for the A9 that starts the M4, so that we can test you script?

    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,

    I just spent the day trying to make it work with IAR Workbench and C-SPY !


    I am using the helloworld program from 'FreeRTOS_BSP_i.MX6SX - Windows installer (REV 1.0.0)' in i.MX6SX Software & Tools, chapter "Board Support Packages":
    nxp.com/products/microcontroll…sp=1&tab=Design_Tools_Tab

    Program is in FreeRTOS_BSP_1.0.0_iMX6SX\examples\imx6sx_sdb_m4\demo_apps\hello_world\iar\

    It requires the SABRE-SD board.

    I use IAR Workbench 7.50.2.

    The problem is that the start of the application does not reset the M4 core since the "void ResetTarget(void) {}" is empty in the J-Link script file. When I remove the "void ResetTarget(void) {}", the reset does not work neither with any reset strategy.

    Please see following post for correct code.

    Thanks
    Anthony

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

  • I found the mistake of the HardFault exception. It was because I did not set the bit[0] of the reset vector to 1, indicating it is thumb instructions. It is not necessary to reset the core at the first init, but it could be necessary to reset the core manually since the C-SPY reset button does not work:
    Here is the correct code:

    The interrupt vectors for NMI_Handler and HardFault_Handler are not necessary but this may be interesting in case of errors.

    The corresponding application is:

    Source Code

    1. ...
    2. __vector_table:
    3. 0x1fff8000: 0x20008000 DC32 CSTACK$$Limit ;CSTACK
    4. 0x1fff8004: 0x1fff9000 DC32 0x1fff9001 (536842241) ;Reset_Handler
    5. 0x1fff8008: 0x1fff9000 DC32 0x1fff9001 (536842241) ;NMI_Handler
    6. 0x1fff800c: 0x1fff9000 DC32 0x1fff9001 (536842241) ;HardFault_Handler
    7. ...
    8. 0x1fff9000: 0xe7fe B.N 0x1fff9000 ;Reset_Handler, NMI_Handler and HardFault_Handler
    9. ...

    The corresponding U-Boot code simulating this application is:

    Source Code

    1. mw.l 0x7f8000 0x20008000; mw.l 0x7f8004 0x1fff9001 3; mw.w 0x7f9000 0xe7fe; dcache flush; bootaux 0x7F8000

    We could also implement a complete exception table with the 144 interrupt vectors containing 0x1fff9001.

    Source Code

    1. mw.l 0x7f8000 0x20008000; mw.l 0x7f8004 0x1fff9001 144; mw.w 0x7f9000 0xe7fe; dcache flush; bootaux 0x7F8000


    Choose a program that loads in TCM RAM, for example FreeRTOS_BSP_1.0.0_iMX6SX\examples\imx6sx_sdb_m4\demo_apps\hello_world\iar\
    Before trying to load code with IAR, in the IAR project options, menu Debugguer, tab Download, uncheck "Verify download" and "Use flash loader(s)".

    Subsequent resets of Cortex-M4:
    Since the function "void ResetTarget(void) {}" is empty in the J-Link Script file, the reset button of the IAR C-SPY Debugger does not work. It is necessary to do it manually.

    Copy this macro in macro file (with a .mac extension):

    Source Code

    1. InitMacro() {
    2. __message "InitMacro():";
    3. __var value;
    4. //Retrieve the value of register SRC_SCR - Address is 0x420D8000 in Cortex-M4 memory map. Address is 0x020D8000 in Cortex-A9 memory map.
    5. value = __readMemory32(0x420D8000, "Memory");
    6. //Set self-clearing M4 core reset bit to 1
    7. value |= 0x8;
    8. //Write back - the core will start immediately
    9. __writeMemory32(value, 0x420D8000, "Memory");
    10. }

    Load the macro file when the debugger starts: open the project options, menu Debugger, tab Setup, select this macro file in the "Setup macros". Uncheck also the "Run to main"

    Set a breakpoint on the first instruction in the 'Reset_Handler' on 'CPSID I':

    Source Code

    1. Reset_Handler
    2. CPSID I ; Set breakpoint here
    3. LDR R0, =SystemInit

    With the Cortex-M4 halted or not, respect this procedure to avoid the error 'CPU is not halted. Abort debug session?':
    * open the terminal "View", "Macros" and "Macro Quicklaunch". Type "InitMacro()" and double-clicked on the blue arrow. The Cortex-M4 core is resetted and starts automatically then is halted on the breakpoint.
    * press F5 or F10 to refresh the contents of the C-SPY debugguer. All registers should be refreshed to the initial value.

    Anyway, if you have another solution to fill in the "void ResetTarget(void) {}", this is welcome.


    Anthony

    The post was edited 2 times, last by AnthonyG ().

  • I have another question:
    would it be possible to halt/run the Cortex-M4 core without halting the Cortex-A9 core ?

    From U-Boot:
    * I am starting the Cortex-M4 with: mw.l 0x7f8000 0x20008000; mw.l 0x7f8004 0x1fff9001 3; mw.w 0x7f9000 0xe7fe; dcache flush; bootaux 0x7F8000
    * I am starting the Linux core: env set fdt_file imx6sx-sdb-m4.dtb; boot


    Then, I start the J-Link commander with the M4 J-Link script as Default.JLinkScript. The Cortex-M4 is correctly found but the Cortex-A9 is stopped.



    I have no idea how to run the Cortex-A9 again.


    Thanks
    Anthony

  • Mose of the times, I rename the script in
    C:\Program Files\SEGGER\JLink_V510i\Default.JLinkScript

    and then I try to start the J-Link Commander.

    Be careful the script for M4 is wrong, you need to use inside the script:
    JLINK_CORESIGHT_Configure("IRPre=0;DRPre=0;IRPost=13;DRPost=3;IRLenDevice=4");
  • Hi Anthony,

    sorry for not testing your script file.
    However, I remember testing our M4 Script file with the A9 Core booted via UBoot, and it worked fine.
    I will give both script files a try and update this thread / the wiki accordingly to the results.

    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
    I wonder A9 is stopped because of High-Assurance Boot (HAB), I think we need to enable the bit HAB_JDE in register OCOTP_SCSn
    is there way to enable this bit from Jlink by adding code into the script.
    thanks
    Niranjan

  • Hi Anthony,

    I just updated the script located in the wiki.
    Seems like an old, broken version of the the script file somehow made it into the wiki.
    Thanks for pointing that out.

    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.
  • How do I use the JLinkScript files and debug using eclipse?

    Hello

    How do I use the .JLinkScript files?

    I'm working in eclipse and for example for other microcontrollers I just use the "-device [name of the device]" to be able to debug. But how exactly am I supposed to use the provided scripts?

    Is anyone debugging the iMX6 Solo X in eclipse that can guide me in the eclipse setup to debug with J-Link?

    Thanks!! :)