Hacker News new | ask | show | jobs
by redfast00 1230 days ago
I had also thought about this, but this is much harder to pull off, since

1. You need a lot of instructions in sequence to succeed, enough that the chance that all succeed is very very small (recall that there's only about a 5% chance we execute an instruction correctly, if for example there are 10 instructions you need to execute, the chance is 0.05*10). If you write to a wrong location because an instruction didn't execute, you lose a byte of the flash.

2. Before writing to flash, you need to stabilize the clock of the chip (this is also done with 8051 instructions). For this, you need to wait until a register value changes. This is feasible, but an additional hurdle.

1 comments

> if for example there are 10 instructions you need to execute, the chance is 0.05*10

0.05^10, surely?

There should be a double * there, but I think HN removed it
Ah, that makes sense, thanks.