Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32F0/F3 DMA not usable on specific channels which need remapping #3643

Open
fwolter opened this issue Dec 13, 2024 · 0 comments · May be fixed by embassy-rs/stm32-data#548 or #3653
Open

STM32F0/F3 DMA not usable on specific channels which need remapping #3643

fwolter opened this issue Dec 13, 2024 · 0 comments · May be fixed by embassy-rs/stm32-data#548 or #3653

Comments

@fwolter
Copy link
Contributor

fwolter commented Dec 13, 2024

According to the reference manual RM0091 Rev 10 "Table 30. DMA requests for each channel on STM32F07x devices", Note 2:

DMA request mapped on this DMA channel only if the corresponding remapping bit is set in SYSCFG configuration register 1 (SYSCFG_CFGR1).

This bit is not set. After setting SYSCFG_CFGR1.I2C1_DMA_RMP = 1 it works.

Tested with embassy-stm32 0.1.0.

EDIT: This seems to be an issue for all STM32 devices which need remapping bits set or cleared in SYSCFG_CFGR1 to work with specific DMA channels. This affects at least STM32F0 and STM32F3.

I made this quick workaround for STM32F072 in my code:

const SYSCFG_CFGR1: *mut u32 = 0x40010000 as *mut u32; // address from datasheet Table 12 "Peripheral register boundary addresses"
...
unsafe {
    // remap I2C1 DMA to channel 6 and 7
    SYSCFG_CFGR1.write_volatile(SYSCFG_CFGR1.read_volatile() | 1 << 27);
}
@fwolter fwolter changed the title STM32F07x I2C1 broken on DMA CH6+7 STM32F0/F3 DMA not usable on specific channels which need remapping Dec 14, 2024
fwolter added a commit to fwolter/stm32-data that referenced this issue Dec 15, 2024
fwolter added a commit to fwolter/embassy that referenced this issue Dec 15, 2024
@fwolter fwolter linked a pull request Dec 15, 2024 that will close this issue
fwolter added a commit to fwolter/stm32-data that referenced this issue Dec 15, 2024
fwolter added a commit to fwolter/embassy that referenced this issue Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant