J
@kjm The firmware is mostly C, with a dusting of a variety of other things (C++, Assembly, Python).
The initial setup is (or at least was) a little finicky, you need to have the right versions of ESP-IDF, cross-compiler, etc. Read the docs, most of it is actually well documented. Once it's all set up, it's really quite easy to make changes and recompile if it comes to just changing the behaviour of existing functions. I've never tried adding new Python functions in the firmware, though I suppose this shouldn't be too hard.
The only tricky part is when the code you're interested in is in an interrupt handler, you need to take special care, you can't just do anything you want in those, so you sometimes have to defer some stuff from the interrupt handler to the "main" code.
IIRC, there are already lots of facilities in the code to trace all that is exchanged with the modem, it's just a matter of enabling those, so you may not even have to write any code, if you're just interested in seeing (i.e. dumping on the console) the relevant info rather being able to process it in your own code.