i solved the pattern dumping errors by a "retry" mechanism
if anything goes wrong when receiving a pattern - the app tryies up to 3 more times before quitting..
now, i'm trying to make the "upload firmware" function
but i have a problem.. guess what - after i flash a .hex - the x0x doesn't work
fortunately i didn't mess up the bootloader so far
i spoke to some avr guys, they explained me this and that about the "lockbits"
when i checked them on my x0x - wtf.. they are not set
it means - via serial port, it's possible to overwrite the bootloader
and the bootloader itself doesn't support setting the lockbits via serial (with the 'l' command)
anyway.. i've been looking at the source code for both the c0ntr0l app and the bootloader
i neither understand python, nor ASM (especially ASM..)
so by looking at c0ntr0l, i see it uses a "fast mode" for flashing the hex
'Z' command, which flashes a whole "page" (128 bytes) at once
great, but i don't understand what happens next
i figured "why don't i log the data between the c0ntr0l app and the x0x, then i'll be able to see the whole process of flashing a hex.."
great! so i found a decent "virtual serial port" thing, it creates 2 virtual ports, COM7 and COM8 (connected to one another like a pipe) .. then i connect c0ntr0l on COM8
on the other hand, i wrote a small app which connects to COM7 and COM3
on COM3 is my x0xb0x
the app also works as another pipe, passing the data between COM3 and COM7, and also logging it to a file
guess what - i run c0ntr0l, set it to COM8, chose "Upload firmware" ... it connects.. starts flashing.. aaand stops
pops up an error message either that the x0xb0x isn't in bootload mode, or another error about global name "serial" is not defined or something
when check the log file - c0ntr0l seems to send the first page 'Z' command followed by 128 bytes, then the x0x responds as usual with 0x0D
and that's where the log ends
banned, why doesn't c0ntr0l work thru a pipe..
i wanted to know what follows after the 'Z' command with the 128 bytes of data, apparently another 'Z' command, but does it set the address again before that, or does it send 'm' command