I am using platformio to develop for an NXP imx rt 1020. Since I use freertos+lwip+pppos I choose to not make use of zephyr, but to copy all the necessary NXP files into my hand crafted “nxp library”. I had some help setting up my project from this forum. It works fine, until I pressed the “upload” button instead of pressing F5 (debug).
So, running the project in debug works like a charm. Still, when I press the upload button I get this error:
Building .pio\build\mimxrt1020_evk\firmware.bin
Configuring upload protocol…
AVAILABLE: blackmagic, jlink, mbed
CURRENT: upload_protocol = mbed
Looking for upload disk…
Error: Please specify upload_port for environment or use global --upload-port option.
For some development platforms it can be a USB flash drive (i.e. /media//)
It seems to default to mbed upload protocol. I use the “segger jlink” when I press F5.
So I thought, lets specify upload_protocol = jlink, but that gives me this error:
Building .pio\build\mimxrt1020_evk\firmware.bin
Configuring upload protocol…
AVAILABLE: blackmagic, jlink, mbed
CURRENT: upload_protocol = jlink
Uploading .pio\build\mimxrt1020_evk\firmware.bin
*** [upload] Error 3221225477
========================================================================== [FAILED] Took 17.11 seconds ==========================================================================
The terminal process “C:\Users\baprins.platformio\penv\Scripts\platformio.exe ‘run’, ‘–target’, ‘upload’, ‘–environment’, ‘mimxrt1020_evk’” terminated with exit code: 1.
The JLink.exe program has just died with error code 0xc0000005, which is a generic “access violation” error (source).
Either:
JLink.exe is completelly corrupted
there is a bug in JLink.exe causing it to crash
Can you remove the tool-jlink package folder so that PIO redownloads a fresh version? It should be C:\Users\<user>\.platformio\packages\tool-jlink. Then retry uploading.
If this is does not help, please manually open a terminal in the project directory and execute the two commands
But he has a JLink driver. I don’t. My NXP imx RT1020 should have a JLink probe, right? I noticed the SEGGER J-Link popup many times when uploading to my board in debug mode…
I get to that screen to without having a JLink connected so that is actually a bad test. Can you try and connect to the chip within JFlash, not JFlashLite?
CMSIS-DAP can be supported, the latest platform code has a case for that
but the board manifest does not list cmsis-dap, so you would need to add it in that array
locally (<user home>/.platformio/platforms/nxpimxrt/boards/mimxrt1020_evk.json), then upload_protocol = cmsis-dap should trigger starting OpenOCD with the interface/cmsis-dap.cfg file.
But is that really a CMSIS-DAP, did you not say there is a JLink connected?
How can I tell ? I have no idea how to see which onboard debug probe sits on an imx rt 1020 EVK board. All I can see is what’s in my screen. When I hit ‘start debug’ in MCUXpresso, it shows that it finds one probe: CMSIS-DAP. In the selection boxes below, I unchecked all except MCUXpresso IDE LinkServer. It finds the CMSIS-DAP probe.
On the other hand… in platformio, I’ve been using JLink. Where I could see the SEGGER J-Link popup appear when I hit ‘start debug’ (which shows erase/program status).
Can this board have both then?
I my attempts to get platformio working again, I also used Zadig to enforce certain DLLs, ultimately removing my COM port (which I think was used by SEGGER J Link). Weirdly enough, without this COM port, Xpresso IDE was still able to upload programs.
After reinstalling SEGGER JLink once more, I revived the COM port, but still the same result. JLink won’t upload anymore since it claims it can’t find a device and opens the emulator dialog.