embassy/embassy-stm32/src
bors[bot] 9d388d357a
Merge #866
866: F4 flash fixes r=Dirbaio a=chemicstry

This discontinuous flash sector layout is too cursed and I left some mistakes in last PR. Erasing last sector did not work and it wasn't possible to erase between memory banks for 1MB dual-bank devices. So I changed the erase function to iterate over memory addresses (which is continuous) instead of sector numbers.

It should also be possible to implement erase across memory banks for H7, but it requires special handling for write too. I don't have an H7 to test now so left it as is.

I wasn't sure how to add tests to `embassy-stm32` and it seems that there are none, except for `subghz`, but no test runner? Anyway, I tested the `get_sector` on playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=13b59339fe6c70a3249e6183e81f869e

Also fixed erase alignment requirements on `Flash::blocking_erase()`, as it previously only checked alignment on size, but not on offsets.

P.S. the diff is a bit messed up, I recommend looking at files directly

Co-authored-by: chemicstry <chemicstry@gmail.com>
2022-07-15 06:19:05 +00:00
..
adc embassy-stm32: Simplify time 2022-07-10 21:46:45 -05:00
can Run rustfmt. 2022-06-12 22:22:31 +02:00
crc Run rustfmt. 2022-06-12 22:22:31 +02:00
dac Run rustfmt. 2022-06-12 22:22:31 +02:00
dma Run rustfmt. 2022-06-12 22:22:31 +02:00
eth Run rustfmt. 2022-06-12 22:22:31 +02:00
flash Require erase address to be aligned to page size 2022-07-14 21:21:46 +03:00
fmc Run rustfmt. 2022-06-12 22:22:31 +02:00
i2c embassy-stm32: Simplify time 2022-07-10 21:46:45 -05:00
pwm Revert "Make advanced timer trait not require general purpose timer trait as the timers are too different." 2022-07-12 15:11:57 +03:00
rcc embassy-stm32: Simplify time 2022-07-10 21:46:45 -05:00
sdmmc embassy-stm32: Simplify time 2022-07-10 21:46:45 -05:00
spi embassy-stm32: Simplify time 2022-07-10 21:46:45 -05:00
subghz Fix doc comments for BpskPacketParams 2022-06-16 07:34:59 +02:00
timer Revert "Make advanced timer trait not require general purpose timer trait as the timers are too different." 2022-07-12 15:11:57 +03:00
usart Run rustfmt. 2022-06-12 22:22:31 +02:00
usb Puts in the machinery to handle power detected/removed 2022-07-07 10:08:57 +10:00
wdg Use u32 instead of Duration for IWDG 2022-07-11 00:00:33 +03:00
dcmi.rs Run rustfmt. 2022-06-12 22:22:31 +02:00
exti.rs have adapted access to pin() and port() methods of Sealed::Pin in exti.rs according to previous changes on Input struct 2022-07-10 20:55:04 +02:00
fmt.rs fmt: Add dunmy use to avoid "unused variable" errors when no log is enabled. 2021-06-07 03:21:37 +02:00
gpio.rs Move all gpio logic to Flex 2022-07-13 02:45:37 +03:00
interrupt.rs Add embassy-cortex-m crate. 2022-06-12 21:45:38 +02:00
lib.rs Add F4 flash driver 2022-07-11 03:57:46 +03:00
rng.rs Run rustfmt. 2022-06-12 22:22:31 +02:00
time.rs embassy-stm32: Simplify time 2022-07-10 21:46:45 -05:00
time_driver.rs Run rustfmt. 2022-06-12 22:22:31 +02:00
traits.rs stm32: add stm32u5 GPDMA, SPIv4 support, add HIL tests. 2022-04-27 01:16:14 +02:00
usb_otg.rs Run rustfmt. 2022-06-12 22:22:31 +02:00