Commit Graph

1221 Commits

Author SHA1 Message Date
fc8c83e00a Fix h7 compile error 2023-03-29 14:50:19 +02:00
87898501a2 feat(stm32:qspi): convert some u8 to enum variants 2023-03-29 14:28:25 +02:00
a0d089536a Merge branch 'flash-regions' of https://github.com/rmja/embassy into flash-regions 2023-03-29 14:10:33 +02:00
15e1747220 Fix build of not implemented family 2023-03-29 14:10:16 +02:00
0bbc3a3d81 Merge branch 'master' into flash-regions 2023-03-29 13:59:17 +02:00
5a12fd6c75 Add unimplemented family section 2023-03-29 13:57:33 +02:00
b7dfc8de10 Let flash module be conditionally included 2023-03-29 13:52:52 +02:00
ddbd509865 Move as much logic from families to shared module as possible 2023-03-29 13:37:45 +02:00
69944675a3 Expose get_sector in favor of is_eraseable_range 2023-03-29 12:49:13 +02:00
4ee3d15519 Keep peripheral lifetime when calling into_regions() 2023-03-29 12:10:24 +02:00
6806bb9692 Expose flash region settings as an array 2023-03-29 11:52:18 +02:00
d6ce1c4325 Support running tests in embassy-stm32 and move impl from common back to stm32 2023-03-29 11:31:45 +02:00
7a841b58d1 Merge #1307
1307: (embassy-stm32): add embedded-io blocking Read + Write for BufferedUart r=MathiasKoch a=MathiasKoch



Co-authored-by: Mathias <mk@blackbird.online>
2023-03-28 12:35:07 +00:00
14f6bc88ea Remove unnecessary lifetime 2023-03-28 14:34:36 +02:00
2d7f35cf57 Add embedded-io blocking Read + Write for BufferedUart 2023-03-28 14:28:44 +02:00
6a802c4708 feat(stm32:qspi): add support for QSPI in stm32
Implemented with help of Tomasz Grześ <tomasz.grzes@gmail.com>.
2023-03-27 13:20:00 +02:00
a33774ec51 Update stm32-metapac 2023-03-27 12:36:31 +02:00
e9a5b31fa8 Implement drop for FlashRegions 2023-03-25 17:00:52 +01:00
e8fc7a66a3 Ensure flash module and FlashRegion trait is always defined 2023-03-25 16:32:32 +01:00
bc69eb596e Add is_eraseable_range and split write into consecutive parts 2023-03-25 16:04:45 +01:00
73ccc04231 Change region type name 2023-03-25 13:47:28 +01:00
47d5f127bb Align L family 2023-03-25 13:30:24 +01:00
47e07584ca Align H7 family 2023-03-25 13:03:00 +01:00
c848bd9c9c Align with removal of MemoryRegionKind::Otp 2023-03-25 13:02:42 +01:00
a8567f0617 Align F7 family 2023-03-25 06:26:00 +01:00
7edd72f8f5 Align F3 family 2023-03-25 06:07:57 +01:00
6c73b23f38 Align F4 family 2023-03-25 05:59:40 +01:00
6b44027eab Add FlashRegion trait and implement embedded_storage traits for each region 2023-03-25 05:58:40 +01:00
cccceb88f2 Generate flash regions during build 2023-03-25 05:57:15 +01:00
0b49b588a2 stm32: use stm32-metapac from crates.io, remove stm32-data submodule. 2023-03-20 02:38:12 +01:00
13f0c64a8c Fix APB clock calculation for several STM32 families 2023-03-16 21:21:39 -06:00
43462947ed stm32: remove unused embedded-storage-async. 2023-03-14 17:27:40 +01:00
c0e40b887b Apply fix 2023-03-01 20:57:13 +00:00
351e4407ef Merge pull request #1252 from pattop/stm32_spi_fifo_fix
stm32/spi: fix occasional data corruption
2023-03-01 03:08:05 +01:00
aabc275186 stm32/spi: fix occasional data corruption
Need to clear the rx fifo before enabling rx dma.
2023-03-01 12:24:22 +11:00
3c601bf8d2 PacketQueue::init() does not need to be unsafe 2023-02-28 18:04:43 +00:00
485bb76e46 Implemented suggestions from @Dirbaio 2023-02-28 17:39:02 +00:00
c1e93c0904 PacketQueue::new() uses ::init() when in nightly 2023-02-28 14:34:26 +00:00
90f2939bf6 Added PacketQueue::init() 2023-02-28 14:22:54 +00:00
7be4337de9 Add #[must_use] to all futures 2023-02-24 13:01:41 -06:00
3255e0a172 Merge #1228
1228: stm32/sdmmc: Implement proper clock configuration r=chemicstry a=chemicstry

This implements proper clock configuration for sdmmc based on chip family, because `RccPeripheral::frequency()` is almost always incorrect. This can't be fixed in PAC, because sdmmc uses two clock domains, one for memory bus and one for sd card. `RccPeripheral::frequency()` usually returns the memory bus clock, but SDIO clock calculations need sd card domain clock. Moreover, chips have multiple clock source selection bits, which makes this even more complicated. I'm not sure if it's worth implementing all this logic in `RccPeripheral::frequency()` instead of cfg's in sdmmc.

Some chips (Lx, U5, H7) require RCC updates to expose required clocks. I didn't want to mash everything in a single PR so left a TODO comment. I also left a `T::frequency()` fallback, which seemed to work in H7 case even though the clock is most certainly incorrect.

In addition, added support for clock divider bypass for sdmmc_v1, which allows reaching a maximum clock of 48 MHz. The peripheral theoretically supports up to 50 MHz, but for that ST recommends setting pll48 frequency to 50 MHz 🤔

Co-authored-by: chemicstry <chemicstry@gmail.com>
2023-02-23 16:22:31 +00:00
73ef85b765 stm32/sdmmc: Fix compile errors 2023-02-23 18:00:55 +02:00
f0f92909c1 Merge #1227
1227: stm32/dma: fix spurious transfer complete interrupts r=Dirbaio a=pattop

DMA interrupts must be acknowledged by writing to the DMA_{L,H}IFCR
register.

Writing to the CR register is unnecessary as the channel (EN bit) is
disabled by hardware on completion of the transfer.


Co-authored-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
2023-02-23 15:44:43 +00:00
896764bb85 stm32/sdmmc: Refactor TypeId into a macro 2023-02-23 17:38:52 +02:00
42462681bd stm32/sdmmc: Implement proper clock configuration 2023-02-23 16:57:21 +02:00
4e884ee2d2 stm32/dma: fix spurious transfer complete interrupts
DMA interrupts must be acknowledged by writing to the DMA_{L,H}IFCR
register.

Writing to the CR register is unnecessary as the channel (EN bit) is
disabled by hardware on completion of the transfer.
2023-02-23 10:12:48 +11:00
a53f525f51 stm32/sdmmc: Fix SDIOv1 writes 2023-02-18 01:37:06 +02:00
5e74926907 feature-gate variants without vals defined 2023-02-13 15:46:49 +01:00
218b44652c Rebase on master 2023-02-13 14:55:15 +01:00
363054de98 stm32: doc all chips. 2023-02-13 03:02:12 +01:00