Which exception? I assume you wrote different exception handlers for each interrupt so you'd know which one failed? If not, do that first.
What "debug mechanism" are you using to know that you have got an exception? Are you printing, flashing LEDs, putting something on a screen or what? I can't advise you of exactly what to do next as I don't know what tools and ports you have available. Please detail these. I'll assume you at least have a serial port you can print messages to. If you don't have one of those, BUILT one. Get someone to make a connection to a spare serial port and use that for debugging.
What are you using to develop this code? Are you using CodeWarrior, a GNU compiler set or something different? How are you loading the code into the device?
If you're using CodeWarrior with a debug pod, then it should show you exactly where your CPU is, why it failed and how it got there. IDEs (Integrated Development Environments) have been doing this for decades. If you're using one of these you should learn how to use it for this.
I'm "old school", not by choice, but by the choices of the companies I've worked for. That means compiling the code with a GNU tool chain and compiler, generating ELF then maybe HEX files, loading that into the thing I'm programming, then maybe using a debug pod and GDB to test and debug it. Many times I have to use print statements.
The whole point of exceptions is to let you write code so the device can do something sensible with the error. Maybe recover from it, maybe report it, maybe log it. Desktop computers get exceptions all the time. If you have a program on a desktop (or phone) that crashes, that causes an exception, the operating system catches that, cleans up, tells you about the problem then keeps working normally. Embedded systems usually don't do this, but they should do something with the exceptions to help with the problem you're currently having and ones like it.
So what to do when the CPU has had an exception? The designers of the CPU went to a lot of trouble to make this easy for us. The CPU saves details on what happened (on the stack), and they documented this. For this CPU you should find and read "M68000PM/AD Rev .1 Programmers Reference Manual (Includes CPU32 Instructions)". Search NXP for "M68000PM". You should also have "MC68332UM.pdf". The latter one is the obvious place to start, but that doesn't detail the exception frames. For that you're meant to be reading Section 6 in the CPU32 manual "CPU32RM.pdf".
This stuff dates from 1995, so you can't expect to find Youtube Videos, or for ChatGPT to tell you how to do this :-).
OK, so assuming you have a way to print to a serial port or something once your code has hit one of these exceptions, you want to "dump the stack frames". In the exception handler (that you're writing), print addresses and data (16 bit words) in hex from the current value of the stack pointer all the way back to where the stack was originally initialised. Also dump all the registers (8 data and 8 address) as they may contain pointers that are wrong (null pointer errors and so on).
With practice you should be able to "read that by eye": and recognise addresses for data and for the functions that the code was running. You need a MAP file from the compiler (giving function and data addresses) or preferably a complete annotated dump of the program. For Gnu that's "objdump -s", but you'll have to find the equivalent for what you're using.
First you find the "Format and Vector Offset" word in the stack dump, and then you decode the exception frame using the format code and the details in "M68000PM". That will tell you what the instruction was that blew up, and maybe how. That might be enough to show the mistake.
Then you can decode the rest of the calling stack. The format depends on your tool chain's "ABI". Different ones put different things (link registers and so on) in there. You should be able to recognise code addresses in there to find how the code got to where it failed.
The worst that can happen is that the stack pointer got corrupted and isn't pointing to where the stack was. You should write code to recognise that and tell you that's what happened. You can't "dump the stack from the stack pointer" if that happened, but you might be able to dump where the stack was meant to be.
You probably shouldn't call any existing "print" routines to dump the stack as the system may not be stable enough for that. Especially if you have interrupt driven serial port code, you can't reliably call that from an exception handler. You may have to write a small custom "dump memory in hex to the serial port a byte at a time" function for that. That's beginner-level programming, but Google can probably find you an example to save some time.
Have you read the "Engineering Bulletins" here, specifically "Generating Interrupts on the TPU" and the "Using Bus Error Stack Frames..." ones? The latter one shows how to read and understand Bus Error Exception Frames in order to find program faults. You should also read the Errata documents.
https://www.nxp.com/products/processors-and-microcontrollers/legacy-mpu-mcus/32-bit-coldfire-mcus-mp...
Tom