Bugs or Benefits ?

Unhandled interrupt 0000000X !

Printed over and over again in the terminal when you power up the board.

One possible reason is that the Flash memory contained other code when you loaded Mecrisp-Stellaris, and the flash method you used ‘automatically’ erased enough Flash memory for Mecrisp-Stellaris, but didn’t erase the previous code area. What needs to be done is a block erase od ALL FLASH before loading Mecrisp-Stellaris.

Old Words Remain After Upgrading Mecrisp-Stellaris!

I’ve just flashed a new version of Mecrisp-Stellaris and my old Words are still there !

Is this a bug or a feature ? Actually it has nothing to do with Mecrisp-Stellaris and the answer is exactly the same as in Q1) above. If you want to completely remove your old Words you need to do a block erase of the board Flash memory.

Unhandled interrupt 00000003

My new Word results in endless “Unhandled interrupt 00000003” messages and needs hard a reset to stop it.

interrupt 00000003 is a ‘catch all’ for any EXCEPTIONS that have been raised but not handled. A likely cause is your program caused the Program Counter to stray somewhere it’s not supposed to.

Q: How can I stop that “Unhandled Interrupt 00000003 !” message ?

If I for example read beyond RAM from $20008000 I would expect that it would report once and then carry on as normal or at least reset afterwards. At present I have to reset it from the debugger after it has scrolled up thousands of lines off the terminal.

Answer:

You can change the way fault interrupts are handled by hooking “irq-fault” which points to “unhandled” for default.

For example, load the calltrace utility (mecrisp-stellaris-2.5.4/common/calltrace.txt) and install its handler:

' ct-irq irq-fault !

This one traps on faults; you can replace “begin again” at the end of ct-irq with “reset” if you like.

A few notes and example of the calltrace tool

You can tap any interrupt by writing a ( – ) definition, tick it and place its address into any of the irq-* pointer variables. Forth will handle all housekeeping necessary for interrupt entry and return. The interrupts which do not have individual hooks launch through “irq-common”. Inside of your collection handler you can do something like “ipsr case”.

Fault interrupts are always active, for others, you have “eint” “dint” and “eint?” at your fingertips.

One more note: If you compile a definition called “init” into flash, it will be executed automatically on boot.

compiletoflash
load calltrace.txt
init ( -- ) ['] ct-irq irq-fault ! ;

This will install the calltrace utility permanently.

Matthias