chore: Wrap link_section attribute with unsafe

This commit is contained in:
Hiroaki Yutani
2025-05-06 09:09:22 +09:00
parent 93ff90db04
commit 0460a924ac
29 changed files with 64 additions and 64 deletions

View File

@@ -268,7 +268,7 @@ General steps:
1. Find out which memory region BDMA has access to. You can get this information from the bus matrix and the memory mapping table in the STM32 datasheet.
2. Add the memory region to `memory.x`, you can modify the generated one from https://github.com/embassy-rs/stm32-data-generated/tree/main/data/chips.
3. You might need to modify `build.rs` to make cargo pick up the modified `memory.x`.
4. In your code, access the defined memory region using `#[link_section = ".xxx"]`
4. In your code, access the defined memory region using `#[unsafe(link_section = ".xxx")]`
5. Copy data to that region before using BDMA.
See link:https://github.com/embassy-rs/embassy/blob/main/examples/stm32h7/src/bin/spi_bdma.rs[SMT32H7 SPI BDMA example] for more details.