I'm getting random data aborts through my program. It appears that they always occur at random spot in my program and at random time. Sometimes it can work for minutes without any problems and sometimes it throws error after a few seconds. Here are some of them:
- Code: Select all
PC 0010547A
AASR 00650072
ASR 00020001
OPCODE ???
DEBUG1 00000000
DEBUG2 00000000
PC 0010547A
AASR 00560041
ASR 00020001
OPCODE ???
DEBUG1 00000000
DEBUG2 00000000
PC 00107A3A
AASR 00380036
ASR 00020202
OPCODE ???
DEBUG1 00000000
DEBUG2 00000000
PC 00107AB2
AASR 005A006A
ASR 00020001
OPCODE ???
DEBUG1 00000000
DEBUG2 00000000
Whole program is quite complex and big, so I don't think I can upload it completely. But I suspect that culprit is RS485, which I use to communicate with AVR slave (hsRead and hsWrite methods).
I have commented out most of the code from my program and this is what it currently does in forever loop:
- Start a new thread that runs RS485. Everything from now on happens in that thread. Main thread then sleeps forever (it does something in real program, but for testing purposes I commented it out).
- Send a byte via RS485
- Receive 15 bytes via RS485
- Clears RS485 buffer (read until there is nothing to read)
- Calculate CRC - if result is not correct, repeat above 3 steps
- Print result on the monitor
Any idea what could be causing these data aborts?
