Very weird bug has been happening lately. Recently I rewrote an asynchronous message-based RS485 driver to use DMA and whenever I try to send a message from ATxMega, the message is sent but 2 last characters are missing and third last character is corrupted (is received as zero all the time). This however happens only directly after flashing the ATxMega and leaving the bootloader. When I reset the ATxMega additionaly (that is I flash it, let it enter the program, and reset it again meaning it enters a bootloader for one second and then finally jumps to the program) this bug dissapers and I successfully receive full messages correctly. Do you guys have any idea where this bug could come from? After each reset a bootloader is executed, it waits one second for data on RS485 link (and if it receives messages with correct destination address, it rewrites flash memory with received data) and then when last frame is received it performs CRC check of the entire flash memory and enters the program with "jmp 0".
Joined: Fri. Jul 3, 2020
Posts: 22 View posts
Last Edited: Fri. Jul 10, 2020 - 09:38 AM