JLink wont connect to i.MX6UL EVK

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

    • JLink wont connect to i.MX6UL EVK

      I have been trying to debug my i.MX6UL_EVK board using JLink. I am getting following error log

      Source Code

      1. $ JLinkGDBServerCLExe -device mcimx6g2 -scriptfile ddr_init.jlinkscript
      2. SEGGER J-Link GDB Server V6.46d Command Line Version
      3. JLinkARM.dll V6.46d (DLL compiled Jun 7 2019 17:26:52)
      4. Command line: -device mcimx6g2 -scriptfile ddr_init.jlinkscript
      5. -----GDB Server start settings-----
      6. GDBInit file: none
      7. GDB Server Listening port: 2331
      8. SWO raw output listening port: 2332
      9. Terminal I/O port: 2333
      10. Accept remote connection: yes
      11. Generate logfile: off
      12. Verify download: off
      13. Init regs on start: off
      14. Silent mode: off
      15. Single run mode: off
      16. Target connection timeout: 0 ms
      17. ------J-Link related settings------
      18. J-Link Host interface: USB
      19. J-Link script: ddr_init.jlinkscript
      20. J-Link settings file: none
      21. ------Target related settings------
      22. Target device: mcimx6g2
      23. Target interface: JTAG
      24. Target interface speed: 4000kHz
      25. Target endian: little
      26. Connecting to J-Link...
      27. J-Link is connected.
      28. Firmware: J-Link V10 compiled May 27 2019 15:48:59
      29. Hardware: V10.10
      30. S/N: 50120405
      31. Feature(s): GDB
      32. Checking target voltage...
      33. Target voltage: 3.35 V
      34. Listening on TCP/IP port 2331
      35. Connecting to target...ERROR: Could not connect to target.
      36. Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
      37. Shutting down...
      38. Could not connect to target.
      39. Please check power, connection and settings.
      Display All
      I have followed the link : wiki.segger.com/IMX6UL-EVK to enable JTAG debugging.

      my ddr_init.jlinkscript looks like this :

      Brainfuck Source Code

      1. /*********************************************************************
      2. * SEGGER MICROCONTROLLER GmbH & Co. K.G. *
      3. * Solutions for real time microcontroller applications *
      4. **********************************************************************
      5. * *
      6. * (c) 2011-2015 SEGGER Microcontroller GmbH & Co. KG *
      7. * *
      8. * Internet: www.segger.com Support: support@segger.com *
      9. * *
      10. **********************************************************************
      11. ----------------------------------------------------------------------
      12. Purpose :
      13. ---------------------------END-OF-HEADER------------------------------
      14. */
      15. void Clock_Init() {
      16. // Enable all clocks
      17. MEM_WriteU32(0x020c4068,0xffffffff);
      18. MEM_WriteU32(0x020c406c,0xffffffff);
      19. MEM_WriteU32(0x020c4070,0xffffffff);
      20. MEM_WriteU32(0x020c4074,0xffffffff);
      21. MEM_WriteU32(0x020c4078,0xffffffff);
      22. MEM_WriteU32(0x020c407c,0xffffffff);
      23. MEM_WriteU32(0x020c4080,0xffffffff);
      24. Report("Clock Init Done");
      25. }
      26. void DDR_Init() {
      27. // Config IOMUX for ddr
      28. MEM_WriteU32(0x020E04B4,0x000C0000);
      29. MEM_WriteU32(0x020E04AC,0x00000000);
      30. MEM_WriteU32(0x020E027C,0x00000030);
      31. MEM_WriteU32(0x020E0250,0x00000030);
      32. MEM_WriteU32(0x020E024C,0x00000030);
      33. MEM_WriteU32(0x020E0490,0x00000030);
      34. MEM_WriteU32(0x020E0288,0x00000030);
      35. MEM_WriteU32(0x020E0270,0x00000000);
      36. MEM_WriteU32(0x020E0260,0x00000030);
      37. MEM_WriteU32(0x020E0264,0x00000030);
      38. MEM_WriteU32(0x020E04A0,0x00000030);
      39. MEM_WriteU32(0x020E0494,0x00020000);
      40. MEM_WriteU32(0x020E0280,0x00000030);
      41. MEM_WriteU32(0x020E0284,0x00000030);
      42. MEM_WriteU32(0x020E04B0,0x00020000);
      43. MEM_WriteU32(0x020E0498,0x00000030);
      44. MEM_WriteU32(0x020E04A4,0x00000030);
      45. MEM_WriteU32(0x020E0244,0x00000030);
      46. MEM_WriteU32(0x020E0248,0x00000030);
      47. // Config DDR Controller Registers
      48. MEM_WriteU32(0x021B001C,0x00008000);
      49. MEM_WriteU32(0x021B0800,0xA1390003);
      50. MEM_WriteU32(0x021B080C,0x00000000);
      51. MEM_WriteU32(0x021B083C,0x41570155);
      52. MEM_WriteU32(0x021B0848,0x4040474A);
      53. MEM_WriteU32(0x021B0850,0x40405550);
      54. MEM_WriteU32(0x021B081C,0x33333333);
      55. MEM_WriteU32(0x021B0820,0x33333333);
      56. MEM_WriteU32(0x021B082C,0xf3333333);
      57. MEM_WriteU32(0x021B0830,0xf3333333);
      58. MEM_WriteU32(0x021B08C0,0x00921012);
      59. MEM_WriteU32(0x021B08b8,0x00000800);
      60. // Config MMDC init
      61. MEM_WriteU32(0x021B0004,0x0002002D);
      62. MEM_WriteU32(0x021B0008,0x1B333030);
      63. MEM_WriteU32(0x021B000C,0x676B52F3);
      64. MEM_WriteU32(0x021B0010,0xB66D0B63);
      65. MEM_WriteU32(0x021B0014,0x01FF00DB);
      66. MEM_WriteU32(0x021B0018,0x00201740);
      67. MEM_WriteU32(0x021B001C,0x00008000);
      68. MEM_WriteU32(0x021B002C,0x000026D2);
      69. MEM_WriteU32(0x021B0030,0x006B1023);
      70. MEM_WriteU32(0x021B0040,0x0000004F);
      71. MEM_WriteU32(0x021B0000,0x84180000);
      72. MEM_WriteU32(0x021B0890,0x23400A38);
      73. MEM_WriteU32(0x021B001C,0x02008032);
      74. MEM_WriteU32(0x021B001C,0x00008033);
      75. MEM_WriteU32(0x021B001C,0x00048031);
      76. MEM_WriteU32(0x021B001C,0x15208030);
      77. MEM_WriteU32(0x021B001C,0x04008040);
      78. MEM_WriteU32(0x021B0020,0x00000800);
      79. MEM_WriteU32(0x021B0818,0x00000227);
      80. MEM_WriteU32(0x021B0004,0x0002552D);
      81. MEM_WriteU32(0x021B0404,0x00011006);
      82. MEM_WriteU32(0x021B001C,0x00000000);
      83. Report("DDR Init Done");
      84. }
      85. /* ConfigTarget */
      86. void ConfigTargetSettings(void)
      87. {
      88. Report("Config JTAG Speed to 4000kHz");
      89. CORESIGHT_AddAP(0, CORESIGHT_AHB_AP);
      90. CORESIGHT_AddAP(1, CORESIGHT_APB_AP);
      91. CORESIGHT_IndexAPBAPToUse = 1;
      92. JTAG_Speed = 4000;
      93. }
      94. /* SetupTarget */
      95. void SetupTarget(void) {
      96. unsigned int reg;
      97. reg = MEM_ReadU32(0x021B0000);
      98. reg = reg & 0x80000000;
      99. if(reg == 0){
      100. Report("Enabling i.MX6UL DDR3L");
      101. Clock_Init();
      102. DDR_Init();
      103. }
      104. }
      Display All


      Please help me connect to my evaluation board so i can proceed to next steps to start bare metal debugging on my imx6ul board.

      The chip on my imx6ulevk board is MCIMX6G2CVM05AA. This is my first time with freescale part, so I will need some walking through.

      Further tried to connect using Segger Embedded Studio using Generated code for MCIMX6G2. I get the following log:

      Connecting 'J-Link' using 'USB 50120405'
      Connecting to target using JTAG
      Loaded /usr/share/segger_embedded_studio_for_arm_4.16/bin/libjlinkarm.so
      Firmware Version: J-Link V10 compiled May 27 2019 15:48:59
      DLL Version: 6.44d
      Hardware Version: V10.10
      Target Voltage: 3.354
      Device "MCIMX6G2" selected.
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      ConfigTargetSettings() start
      J-Link script: Setting up AP map
      ConfigTargetSettings() end
      TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
      Failed to connect to target.

      Regards,
      Vikram

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

    • New

      Hello,

      Thank you for your inquiry.
      Such an issue is not known to us.
      Could you check connection with J-Link Commander?
      wiki.segger.com/J-Link_cannot_…ty_using_J-Link_Commander
      If it does not work as well could you try SWD instead, does that work?
      Which revision of the i.MX6UL EVK do you use?

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      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 contact us per e-mail.
      Alternatively our support system can be used as well: segger.com/ticket/