Segger J-Link and IAR for Verdin Mini

As we already discussed in this topic, OpenOCD and VSCode are apparently not a viable solution for Verdin right now. I finally got my hands on a Segger J-Link but I’m still having problems to connect with my board.

I want to use IAR IDE with it, following the “Getting Started with MCUXpresso SDK for EVK-MIMX8MM” pdf, chapter 4 “Run a demo application using IAR”. This should be a straight forward thing. But I have seen in many forum posts (e.g. here) that a certian patch is needed for the IAR to support the arm debugging and another patch for the segger as well. I tried with the SDK_2.3_MX8MQ_Beta_Patch (if I remember correctly).

When I try to flash the code from the IAR I get an error message "missing or malformed flash loader specification file " and when I try to connect directly through the JLink Commander I’m getting an error message “Error:Target voltage too low”

I think I’m probably messing up multiple things in this process so if someone managed to use this toolchain successfully on the Verdin Mini could give a short explanation, that would be lovely!
P.s. I would also rather do it with VSCode than IAR, but as discussed in the first topic linked above, VSCode has trouble finding the right executable. In this topic they seem to have solved this problem internaly through an email exchange. Maybe this secret solution will come to light too :slight_smile:

Thanks in advance!

Hi @swiss,

I’m sorry for the long delay. After seeing your question, I tried here and I could use the JLink with the VSCode to debug the Cortex-M4. So I decided to write a developer page about it, so others can check it as well.

Here are the pages: Getting started with Cortex M | Toradex Developer Center
Specifically these two:

Unfortunately, I couldn’t test it on a Windows Host machine yet. Could you please try it and see if it works for you? This guide uses the Cortex Debug extension from VSCode which is also available for Windows, so it shouldn’t be a problem. My host machine where I tested it is installed with Linux Ubuntu 22.04.

I still need to check the IAR that you mentioned. I will get back when I have more updates on the IAR software. For now, let me know if VSCode is enough for you.

Please, also feel free to ask any questions related to this guide that you might have.

(@AhmedMobarez I’m tagging you here as well since I think it is a good topic for you too).

Best Regards,

1 Like

Hi @hfranco.tx,

Thank you for the developer pages. It finally works with Segger and VSCode!
Just a few notes to the content itself:
-MCUXpresso SDK and Toolchain for Cortex-M development" in the prerequisities is not working for me.
-Links inside warning bubbles concerning external and on-board jtag are not working.
When it comes to testing the JTAG itself, I needed to add

"serverpath": "C:/Program Files/SEGGER/JLink/JLinkGDBServerCL.exe" 

Some other noteworthy changes that can maybe help others like toolchain path adjustment, and the target device (Verdin Mini in my case):

"device": "MIMX8MM6_M4",
"armToolchainPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin",


Hi @swiss,

I’m glad it’s working now :slight_smile:

Thank you for the input! I updated them, it should be online by the end of the day.

I’ve added the serverpath suggestion to the article. I should also be online by the end of the day. The device and armToolchainPath are in the article, I’ll make sure it is clearer.

Thank you! Good to know it’s working on Windows as well.

Feel free to ask any further questions you might have.

Best Regards,

Hi @hfranco.tx ,
I have one additional question:
How can I make the M4 autoboot with the .elf file that I debug and deploy through Segger? We already discussed here how to autoboot a binary file and that’s the technique I’m still using. But when I deploy the .elf file over Segger and restart the Verdin, the old binary file from the /var folder (of course) boots back again.
It that even an option or is J-Link debugger only to be used during debug phase?

Hi @swiss,

I don’t think it’s possible to do that. JLink copies the .elf file to the right memory address and when you reboot the module, this memory address is cleaned and used by uBoot/Linux Kernel.

Despite of that, I’ll try to research something that could do this reboot and still be in debug mode, I don’t have anything that I can think of right now.

Best Regards,

1 Like

Hello @swiss ,

I had the same problem as you and was solved by unchecking the box " Use Flashloader"

beside the patch I downloaded in the beginning to build the project, I didn’t do anything else for the debugger to work.
Also here is my debugger settings:

I hope that helped you.

Best of luck,

1 Like

Hi @AhmedMobarez ,
Thank you for your answer!
I will check this as soon as I can and inform you if it worked.

Hey @swiss ,

anytime, I forgot to mention I am using an Apalis Evaluation board with Apalis IMX8, hopefully that doesn’t affect you.

also, what I found to be working well for me is the Ozone debugger from segger, so even if you have issue with IAR you can just build and load the .out file into ozone and you would have a very good debugger :+1:

Best of luck,