LPC2368 uIP Rowleey demo crash

Hi. I used this LPC2368 uIP Rowley demo for the LPC2478 part. I changed project setup and init to match new mcu. At first, everything seems to work just fine but while running for some time system just crashed. I opened RTOS statistic page in web browser which is refreshed every 2 seconds. Crash happens in few minutes but it’s not deterministic. I found out that I got undefined instruction exception. If I make jump to the instruction after the one that caused exception with mov pc, lr I always end in emac.c part. I run in Thumb flash debug mode. I noticed that cpsr shows that micro is not in Thumb mode as it should be. If I change emac.c to be compiled in ARM mode everything works fine without crashing for hours until I stopped the test manualy. So… can someone confirm that LPC2368 uIP Rowley demo will work seamlessly in Thumb debug mode for more than few minutes (let’s say two horus with five web browsers opened and ping -t option)??? I don’t have LPC2368 Keil board to test it for myself. Any ideas what is causing undef exception? Maybe someone will ask me the right question and I’ll find out that I missed something. :)

LPC2368 uIP Rowleey demo crash

before anybody else gets a chance to ask, did you check your stacks are not overflowing? If it runs in ARM mode then it would seem the code logic is ok. A corrupt value on the stack could cause an unexpected switch of mode.

LPC2368 uIP Rowleey demo crash

I increased minimal stack size from 120 to 256 and no changes. I observed memory and all tasks had plenty of free stack space (stack space was filled with 0xAA), water mark in task statistic web page were also high enough.

LPC2368 uIP Rowleey demo crash

I changed omit frame pointer to yes (aka -fomit-frame-pointer) and I everything works fine even with Thumb Flash Debug setting. I stoped the test after one hour (six web browsers trying to open web page and ping with -t option). Interesting thing is, that LPC2368 demo for Rowley doesn’t have -fomit-frame-pointer but Eclipse does. (gcc version 4.1.1)