How to Use J-Link
When you use J-Link in CoIDE, the debug configuration and operation is different from other adapters'.
- CoIDE doesn't contain the software of J-Link, you may need to download from segger or get it through other ways.
- If you want to use J-Link in CoIDE, make sure that your J-Link has the license for GDB, Flash Breakpoint, Flash Download. If your J-Link only has the license for GDB, you can only use it to debug in RAM.
- When you select J-Link as the adapter, the download button and erase button cannot use. J-Link doesn't use the CooCox Flash algorithm, but when you click the debug button, it will execute the download operation then enter debug.
- Some chips, such as Nuvoton NuMicro series was not supported by the newest version of J-Link software, that means you cannot load the code to Flash. But you can select Debug in RAM in the Project Configuration then debug the project in RAM.
You need to set the debug configuration as follows:
Visit the website of J-Link, download the latest J-Link software, and install it on your PC. Then connect the J-Link to your computer and install the driver for it.
2. Click "Debug Configuration", to enter the configuration page:
3. Configure the Debugger page:
- Adapter: Select J-Link
- Port: J-Link supports SWD and JTAG debug mode.
- Reset Mode: There are 10 reset modes could be selected:
- Type 0: Normal
- Type 1: Core
- Type 2: ResetPin
- Type 3: Connect under reset
- Type 4: Reset Core & Peripherals, halt after bootloader
- Type 5: Reset Core & Peripherals, halt before bootloader
- Type 6: Reset for Freescale Kinetis devices
- Type 7: Reset for Analog Devices CPUs (ADI Halt after kernel)
- Type 8: Reset core and peripherals
- Type 9: Reset for LPC1200 devices
- Type 10: Reset for Samsung S3FN60D devices
- You can refer to J-Link ARM User Guide, 5.8.2: Strategies for Cortex-M devices to get the detail information for how to select reset mode.
- JLink Info
- GDBServer cmdline tool: Select the path of JLinkGDBServerCL.exe(provided in the J-Link software)
- Endianess of the target: The current version of CoIDE only support Cortex-M0&M3 series. So we only need to use Little endian.
4. Advance Function: Click "Edit script" button to open scripts edit window, you can edit the gdb script which you want to execute after the target reset.
CoIDE User Guide (for 1.5.1)