1 hour ago · Tech · hide · 0 comments

Now that the new bootloader shown that it can be fast to write to the CH32v3xx flash, time to revisit the swindle way of loading code.(Gemini was really helpful again. But as a smart assistant, no vibe coding here).Starting point:So we started around average speed of 3kB/S (including erase, download and write)Optim 1: use bigger blocksBefore, we were configuring the block size/erase size to be 256 bytes (same as the small hardware pages).Reconfiguring the description to be 4kB gave a small speed bump => 5 kB(internally it will call 256 bytes multiple times, it just reduces the overhead).Optim 2: Faster writing to RAMThe dominant slowdown is the amount of time needed to write to the CH32V3xx ram (then we call the flashstub to actually write it, that's pretty fast).Just the writing caps the overall speed to 9 kB/s , without even erasing or writing.So the optimisation is to use a fast_write_ram function there that is using abstract commands with auto exec to pipeline data write to ram.…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.