Compiler: Internal Error: Cannog generate code around origin directive follows specifier. Please contact Rabbit

I have a project in Dynamic C which has recently started giving me problems. One function, with a very long switch statement gives the compiler error:
Internal Error: Cannog generate code around origin directive follows specifier. Please contact Rabbit

If I remove one of my case statements, the above error goes away. If I add the case statement back in but remove several other case statements, the above error also goes away. I’m wondering if I’m running up against a maximum switch statement limit or maximum function size limit.

The funny thing is, this code used to compile. I was modifying some other areas of the code when I ran into this compiler error. If I compile directly to a .bin file the code compiles correctly??? The error only occurs if I am connected to the rabbit and am downloading through the usb connection.

It looks like you are running up against some sort of memory size issue here but I’m not sure exactly what is the culprit.

The difference between compiling to bin and compiling to the attached target is that the debugging info and the debug kernel is not present when compiling to bin. This results in a smaller code size, both overall size and within functions as every line of code that is compiled with debug enabled has an RST 0x28 instruction added to allow single stepping (you can disable this on a function level basis to see if for example the function with the big switch will compile without debugging info included by preceding it with nodebug).

Regards,
Peter