How to Use Segger J-Link Plus with i.MX 8M Processors EVKs to Debug an SDK Application using VS Code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Use Segger J-Link Plus with i.MX 8M Processors EVKs to Debug an SDK Application using VS Code

How to Use Segger J-Link Plus with i.MX 8M Processors EVKs to Debug an SDK Application using VS Code

Note: This guide is specifically for use with VS Code. For standalone with Segger software please refer to this guide. (How to Use Segger J-Link Plus with i.MX 8M Process... - NXP Community)

In this guide we will describe the process to start using VS Code to debug an SDK application. The board used for this guide specifically is the i.MX 8M Nano EVK, but it also applies to all processors of the i.MX 8M Family.

This guide covers the following topics:

  • Hardware requirements
  • Software requirements
  • How to find, build, and download the i.MX SDK
  • Debug Probe and i.MX 8M Nano EVK connection
  • Create an SDK Application with MCUXpresso for VS Code
  • Run and debug your SDK Application with MCUXpresso for VS Code


Hardware requirements

Software requirements

 

How to find, build, and download the i.MX 8M Nano SDK

  1. Enter Welcome | MCUXpresso SDK Builder (nxp.com)
  2. Click on "Select Development Board" 
    hector_delgado_1-1697746581517.png
  3. Select EVK-MIMX8MN (MIMX8MN6xxxJZ) from Boards -> i.MX -> EVK-MIMX8MN
    hector_delgado_2-1697746609185.png
  4. Click on the Build MCUXpresso SDK button
    hector_delgado_3-1697746626426.png
  5. Click on Download SDK, you'll be redirected to the MCUXpresso SDK Dashboard
    hector_delgado_4-1697746644373.png
  6. Look for the i.MX 8M Nano SDK and click on Download SDK
    hector_delgado_5-1697746661949.png
  7. Click on Download SDK archive and documentation, accept the Software Terms and Conditions and the .zip file for the SDK will be downloaded.
    hector_delgado_6-1697746676556.png

Debug Probe and i.MX 8M Nano EVK connection

  1. Connect the debug cable (USB-UART) to the board and the other end to your PC.
    hector_delgado_1-1697749079954.png
  2. Connect the power cable to the second USB-C port and to a wall socket. Don't turn on the board yet.
    hector_delgado_2-1697749135391.png
  3. Connect the JLink Plus to your PC with the USB cable.
    hector_delgado_3-1697749187156.png
  4. Connect the JLink Plus to the JTAG of the i.MX 8M Nano EVK board
    In this part we will need to identify pin number 1 from the 9 Pin Cortex-M adapter and from the i.MX 8M Nano EVK board. For the first one identifies pin 7 identifiable by a "non-connect pin".
    hector_delgado_4-1697749207742.png

    For the i.MX 8M Nano, you can identify easily with a number 1 in one corner of the connectors.

    hector_delgado_7-1697749286806.png

     

    hector_delgado_6-1697749236838.png
  5.  The whole setup should look similar to this:
    brian14_0-1725557771980.png

     

Create an SDK Application with MCUXpresso for VS Code

Before delving into the details of creating an SDK Application it is important to recognize the sections of VS Code User Interface. This will help us to describe accurately the buttons' position.

brian14_6-1698518604598.png
  1. Click on MCUXpresso for VS Code extension icon from the Activity Bar. 
    1.png
  2. In the section “Quickstart Panel” located in the Side Bar click on “Import Repository.”
    2.png
  3. On this window, go to “Local” and select your previously downloaded SDK folder location. Then, click on “Import.”
    3.png
  4. Expand the section “Installed Repositories” from Side Bar and verify your selected SDK.
    4.png
  5. Expand the section “Projects” from Side Bar and click on “Import Example from Repository” and complete the options:
    • Choose a toolchain
    • Choose a board
    • Choose a template
    • Name
    • Location
    Finally, click on the "Create" button.
    5.png
  6. Click on the gear icon located in the project folder to build the code.
    6.png
  7. In “Projects” expand the “Settings” options and select “mcuxpresso-tools.json.” Here you will find a JSON file with different parameters. Defines the device that will be used to connect with the J-Link Plus.
    Code:
    “segger”: {
    	“device”: “MIMX8MN6_M7”
    }
    7.png
  8. Expand the section “Debug Probes” and verify that your J-Link Plus debug probe appears.
    8.png
  9. Start SEGGER J-Link GDB Server.
    9.png
  10. On section “Target Device” select MIMX8MN6_M7 and click “OK”.
    hector_delgado_11-1697749448118.png
  11. You will see the following window.
    hector_delgado_13-1697749479981.png

Run and debug your SDK Application with MCUXpresso for VS Code

  1. Click on “Debug” located in the project folder, to start with the debugging session.
    10.png
  2. In the Panel click on “Serial Monitor,” set it to the serial debug port with the lowest numbered port with the following settings:
    • Baud rate: 115200
    • Line ending: None
    Click on "Start Monitoring"
    11.png
  3. Use the debug controls to run the code.
    12.png
  4. Verify your code output in the “Serial Monitor.”
    13.png
100% helpful (1/1)
Version history
Last update:
‎09-05-2024 10:36 AM
Updated by: