This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Program works correctly in debugger only when i have a breakpoint set?!?!?!

Im using the RTX51 Tiny RTOS
Ok, here is my problem. Ive been pulling my fair out trying to figure this out. I have a program that recieves 2 bytes from the uart, and sends a 5 byte word back as a responce.
The software recieves a command terminated with 0x0d. The command bytes are stuffed into a ring buffer, then copied to a temp buffer from the ring buffer. In the buffer two bytes are converted into a single 1 byte command terminated with a 'CR', ie '0' '2' "CR" becomes 0x02, 0x0d.

Everything seems to work fine if i set a breakpoint in the program. Every time i send '0''2''CR' i get an answer. If i clear the breakpoint, and let the program free run, it responds the first time. The second time nothing. Stoping the program shows my temp buffer filled with 0xFF. In my ascii conversion routiene i use toint(), i know this will give a FF for a value it dose not like. I have no idea why it will work with a breakpoint every time, but allowed to run free only once.

0