Hi,
I've adopted some old code and I'll be the first to admit I have no idea what I'm doing. I'm working with LPC2129-based hardware running FreeRTOS
6.1. My code executed until I made a few small changes (defining and printing an array plus some basic mathematical operations). Now, when I read CAN values, "if" statements based on these values never trigger properly (almost as if the values change between printing and testing). My sample rate is slow, so I doubt this - but it is possible. I have also disabled interrupts.If I use DEBUG everything works perfectly. My DEBUG is defined as
#define DEBUG_puts UART0_puts #define DEBUG_putc UART0_putc void debug_printByte(uint8_t d) { if (((d & 0xF0) >> 4) < 0xA) debug_putc('0' + ((d & 0xF0) >> 4)); else debug_putc('A' + (((d & 0xF0) >> 4)-0xA)); if ((d & 0x0F) < 0xA) debug_putc('0' + (d & 0x0F)); else debug_putc('A' + ((d & 0x0F)-0xA)); }
When DEBUG is disabled, it's:
#define debug_printf(x) #define debug_putc(x) #define debug_printByte(x)
so nothing at all happens.
If the problem only happens when DEBUG is disabled, how can I troubleshoot using only UART, since there's no other headers on the board? I could potentially insert a delay... but why would I want to slow my code down, and isn't that the point of an RTOS?
The last time I had this issue, I increased the stack size for each task and this solved the problem. This time, even a substantial stack increase will not result in functioning code.
I'd be very appreciative of any help you can offer. I'm at a loss as to how to troubleshoot, and it is unlikely that shots in the dark as to the problem will help when dealing with 30+ files and thousands of lines of possible code.
Thanks!
--------------------------------------- Posted through