Flash module is preset for 1MB
David-OConnor opened this issue · comments
David O'Connor commented
flash.rs
is hardcoded for 1MB flash.
Eg:
0..=255 => {
self.cr.cr().modify(|_, w| unsafe {
w.bker()
.clear_bit()
.pnb()
.bits(page.0 as u8)
.per()
.set_bit()
});
}
256..=511 => {
self.cr.cr().modify(|_, w| unsafe {
w.bker()
.set_bit()
.pnb()
.bits((page.0 - 256) as u8)
.per()
.set_bit()
});
}
See Reference manual, Tables 8, 9, 10. The above code is hardcoded for Table 8. Can fix with an enum to select.
David O'Connor commented
Nvm; works fine as-is.