ARM Cortex-M chips are very common in embedded devices nowadays. Accessing their debug interface allows to recover their firmware, so you might think this interface is disabled on production devices. Turns out this is rarely the case for whatever reason. As a firmware developper, is there a way to detect and/or prevent a debug access to the software ?During this talk, we will present how the ARM Debug Interface (ADI) works in details, and use that knowledge to build detection routines allowing the firmware to self-defend itself against unauthorized debug access. We will also present some lesser-known features of the ADI that can be leveraged to prevent firmware disassembly, and even allow the target device to counterattack.Nicolas Oberli works as a security engineer for Kudelski IoT in Switzerland. His research focuses on embedded devices and communication protocols. In his spare time, he now spends more time designing CTF challenges than solving them. He is also one of the main developers of the Hydrabus hardware hacking tool and part of the BlackAlps security conference committee.