This has been functional on numerous Atmel microcontrollers, as well as the Intel XScale PXA255. The ARM compiler in uVision does not return any warnings or errors during compiling and linking. Currently the table is not being used. Just having the table in the .c file with NULL or functions prevents the controller from starting when I call something such as cmd_line();. I am unsure if this is a compiler problem (I have used GNU GCC up to this point). Any advice would be appreciated.

One guess is that you don't have any start-up code in your project or that the start up code is not being located at the start of the memory space correctly.

You calling the function means that the const table is being used. That would have the implication that the compiler cannot optimize it away. If this was being placed first in the read-only memory space then you would see the effect above.

A guess of course, so provide a small build able example rather than just the source files and I will be able to confirm.

Attachments

In fact, it is the inclusion of the printf that gets pulled in when this code is included that seems to trigger the issue, and you can replicate the issue by putting a printf() in main(). Therefore it is nothing to do with the cli.c code or the function pointers.

Ending up in the SWI handler in many cases indicates that you need to re-target the standard library in some way...some libraries will use semi-hosting default implementations which use this SWI exception as their hook.

I'm not familiar enough with the GCC compiler to tell you exactly what you need to do here, but hopefully this is a hint in the right direction.