Hi Oliver,
I assume that you are using default ARMC6 toolchain instead of GC_ARM. It is due to the default optimisation in ARMC6 (-O1 flag). Some lines are optimised and may not exist in optimised code. That’s why you can see debugger stopping at lines that seems wrong to you. You can disable optimisation by:
- Opening profile in your program
mbed-os/tools/profiles/debug.json - Finding an
-O1inARMC6/common:
-
Replacing it with
-O0:
-
Rebuilding the project
Thanks,
Arek - Studio team

