Online compile - but offline debug --?

Hey! I’m doing some work with KL05 boards - yes, I know they’re old; I’ve had them sitting aside for quite a while, and now I have a useful task for them. I can get the online compiler to compile something for mbed OS 2.0 and download it to the board and get it to work - minimally. But debugging isn’t working as well as I’d like: the web-based Device Manager doesn’t see the board, even though I can drag-and-drop a binary onto the KL05 target. The local host version mbed Studio Device Manager correctly sees the device, but it won’t compile for mbed OS 2, or KL05 hardware, so that’s not useful.

I’m on a Mac / ARM M2 platform, if it makes a difference.

I want to use my Segger J-Link probe and gdb to debug the downloaded binary from the Mac. I have an SWD plug soldered onto the KL05, and I can connect to it and download binaries as needed.

What files do I need to copy from the web-based Studio so I can run gdb from the Mac and connect to the KL05? Obviously, the .bin and source file / files. Do I need a .map file? If so, where do I get that within the mbed studio output?

Hi,

You can use an .elf file for debugging.

Spoiler: see the link near the bottom. Darn.

Thank you! Ok, so according to this -

https://os.mbed.com/questions/5966/Is-it-possible-to-get-ELF-file/

  • I need to compile locally using the GCC ARM compiler to get the ELF file. Is that correct? I see -
  • will allow you to create an ELF file in the post-build stage, but there’s no tools/targets/init.py in the online system - at least for Mbed OS 2.0. The document header says “Mbed OS 6,” and I see the init.py file in my localhost Mbed Studio file system, so I’m not sure if that’s an Mbed 2.0 vs Mbed 5.0+ above thing.

Oh, crud. I see here -

https://developer.arm.com/documentation/102497/1-5/Monitor-and-debug/Debug-a-project-with-Keil-Studio/Introduction

  • that it says, " Debugging features are not available for Mbed 2 projects. Arm recommends that you upgrade to Mbed OS 5 or 6 to benefit from all the features. " So, I guess there’s no Mbed debugging for this board. Well, that’s less than optimal, but life goes on.