Debugging approach, interrupts and connected hardware, stack frame modification

(deleted)

Set a flag in the interrupt routine. In loop You test the flag. If flag is set, perform the Serial.print and reset the flag.

(deleted)

Post the code, using code tags, the symbol up, to the left in this window.

(deleted)

Okey.
Then I think about putting together the data You want to Serial.print at any place You want in the code and then put Serial.print wherever You want. A kind of struct, a collection, to be printed.

(deleted)

I don't fully get it.
Next try. Checking the link You gave I would, for that question, suggest a digital output to be used for instant triggering. However, that will not transfer any data. In this topic the situation is a bit different, it looks like.

(deleted)

Serial.print() can't be used inside an interrupt

We noticed that too and had to come up with a creative solution to working around it since we wanted to basically be able to send commands through serial monitor in our case such that it always directed those manually entered commands downstream to other RS485 devices that are listening. Talking to CAN is similar.

Take a look at it and see if the code might be helpful to you. It may not be useful if you are using AVR style ATMega328P though, which looking at your other post seems to indicate might be the case.

We wound up moving to SAMD51 ARM hardware simply because the price is not terribly higher and the functionality (and memory and JTAG debugging and everything else) is so significantly higher or much more feature rich. Did require a bit of work to move things over but the code was both designed to be both fairly platform independent (except for a few specific board items that have to be custom) and also fairly flexible as it is being built out.