mitxela.com forum
Welcome. Please log in or register.

kiloboot
addermild Posted: 15 Apr 2018, 06:51 PM
Avatar


Member
Posts: 1
Joined: 15-April 18
Hi, I was having great success with the kiloboot bootloader, which not only taught me a lot about low level networking but also made me think in assembler again, thanks!

However I may have found a bug with the writing limiting:

The way I see it, if the last packet is less than 512 bytes in size, still the full 512 bytes are compared with the program memory.

QUOTE
Similarly, if the application length isn't a multiple of 512, the last packet won't have completely overwritten the packet buffer in SRAM. So there may be some junk data written to the last page, after the end of the program, but it's completely harmless.

But if this junk data is different, the last for pages may be rewritten every time.

I discovered this when looking at the timings in Wireshark, where it takes 0.038 seconds when updating the flash, and 0.0028 when no content is written. For the last TFTP packet, it always takes 0.038 seconds.

Can anyone confirm this suspicion?



-------------
[top]
mit Posted: 16 Apr 2018, 01:06 AM
Avatar
yeah whatever

Admin
Posts: 532
Joined: 4-May 16
Well spotted. Very interesting observation.

I will take a look into this when I have some spare time, but my first reaction is that the junk data at the end of the block should be the same each time, which would avoid re-writing it, but maybe not. One fix would be to fill it with zeros or 0xFF.

-------------
[top]

Sign in to post a reply.