Reply by Kosta Kliakhandler●June 27, 20082008-06-27
Alright, after further investigation I have discovered that there are
lsl and lsr instructions, but only in thumb mode.
Right before the exception the proccessor mode is:
1100000000000000000000000011111 = 0x6000001f
which means the processor is in ARM mode. I also tested this code with
gcc-4.1.2 and with different -O settings - all the same. I doubted it
would help, since the needed code is precompiled afaik, but...
are the contents of registers prior to the exception relevant? (and
should I post it?)
Reply by Kosta Kliakhandler●June 27, 20082008-06-27
Hi,
I am developing code for an lpc2138 (currently using an olimex dev
board). Right now I'm using gcc-4.2.4 and newlib-1.16 with -O1 (-OO
makes assembly which is hard to debug and some instructions seem to be
executed incorrectly)
I need to use sprintf to format floating point values for sending via
uart, and the line in C produces an undefined instruction exception.
Investigating further, I found the exception to be caused by the
following code which is newlib generated:
Because of how instructions are fetched, then decoded, etc... Looking
up the instructions and not finding lsl or lsl used as the actual
instruction further leads me to believe it is one of those instructions.
Assuming I correctly identified the cause, what can I do about it? Or
what is the real cause?