STM32 Debugging Record: Warning After Programming with JLINK in MDK

Today, while using MDK to program, a warning appeared. Initially, I didn’t pay attention to this issue because during actual testing, the program could be programmed normally and also debugged. However, later a colleague encountered this warning repeatedly during debugging, which affected normal testing, so I decided to investigate!

01
Error Phenomenon
The error message popped up by MDK is as follows:

STM32 Debugging Record: Warning After Programming with JLINK in MDK

The JLINK warning code roughly means memory misalignment:
**JLink Warning: Mis-aligned memory write: Address: 0x20000000, NumBytes: 2, Alignment: 2 (Halfword-aligned)
02
Operating Environment
Computer OS Version: Windows 11 Home Edition
MDK Environment Version:
STM32 Debugging Record: Warning After Programming with JLINK in MDK

Cause Analysis:Since both my colleague and I have newly replaced WIN11 system computers and used the same installation package, there are two possibilities: one is system or version compatibility issues, and the other is an installation problem. This includes but is not limited to issues such as version cracking, antivirus interference, missing installations, conflicts with other software, etc. Let’s continue investigating!

03
Searching for Solutions
STM32 Debugging Record: Warning After Programming with JLINK in MDK
STM32 Debugging Record: Warning After Programming with JLINK in MDK
STM32 Debugging Record: Warning After Programming with JLINK in MDK
Image source from the internet, if infringed, please delete.
I searched online for information and saw that several bloggers used similar methods. The first blogger had installed the JLINK driver twice, which caused the driver in MDK to be overwritten. The comparative phenomenon did not match our situation, but it was worth a try. The second blogger reinstalled the JLINK version and found that it might be due to repeated installations, which also did not match our situation, but reinstalling the driver could be worth a shot. The third blogger reinstalled the system, which might be somewhat close to our phenomenon, but their method was the same as the first blogger’s, so let’s try that together. However, after we went through all the operations, we found that none of them solved our problem, and at this point, we were wondering if we should switch to another search engine…
04
Solution

STM32 Debugging Record: Warning After Programming with JLINK in MDK

After trying various methods without success, it seems I can only resort to: reinstalling MDK!

STM32 Debugging Record: Warning After Programming with JLINK in MDK

Alright, this installation was completed quickly, and I didn’t even need to crack it. Huh, why wasn’t there a driver installation prompt? When we installed KEIL, we suddenly realized that during the first installation, there was a prompt to install the JLINK driver, and we had clicked ‘OK’ at that time… Let’s try it out, and indeed, that warning has disappeared now. We were troubled by such a small operation for so long…

Could it have been due to clicking that prompt? I searched online, but surprisingly, there were no conclusions, and I couldn’t find a screenshot of that page, nor could I replicate the operation. So I can only conclude that this time the MDK warning was due to clicking the installation of the JLINK driver during the installation of KEIL…

STM32 Debugging Record: Warning After Programming with JLINK in MDK

STM32 Debugging Record: Warning After Programming with JLINK in MDK

That’s all for this issue. Thank you for your attention and support. I will periodically update various useful content for us to exchange and learn together~
I wish you compile successfully on the first try and debug without errors!

Leave a Comment