diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-10 22:42:46 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-08-10 22:42:46 +0000 |
commit | 850df30e06d5384081371d6b291cbadec2e2fd48 (patch) | |
tree | 9f21f0c9f78be5db32da4ccaf0f931dfe15b8f16 /nuttx | |
parent | 7189150b33612e4c91f6d9ec08a00fdfe0eece65 (diff) | |
download | px4-firmware-850df30e06d5384081371d6b291cbadec2e2fd48.tar.gz px4-firmware-850df30e06d5384081371d6b291cbadec2e2fd48.tar.bz2 px4-firmware-850df30e06d5384081371d6b291cbadec2e2fd48.zip |
Drop STM32 F2/4 SDIO clock from 24 to 16 MHz. Seems to fix SD accesses on STM3240G-EVAL
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5020 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/ChangeLog | 4 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c | 1 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c | 1 | ||||
-rw-r--r-- | nuttx/configs/stm3220g-eval/include/board.h | 4 | ||||
-rwxr-xr-x | nuttx/configs/stm3240g-eval/include/board.h | 4 |
5 files changed, 10 insertions, 4 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index a5da942f3..3889dcd22 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3147,3 +3147,7 @@ * arch/arm/src/stm32/stm32f2xx_dma.c, stm32f4xx_dma.c, stm32_serial.c, and stm32_spic.c: DMA priority was getting zeroed by STM32 F2/F4 DMA drivers so that all DMAs ran at the lowest priority. + * configs/stm3240g-eval/include/board.h and configs/stm3220: Drop SD card + frequency from 24 to 16 MHz. Apparently 24 MHz is too fast for the board. + This (plus the change to the STM32 DMA (above) fixes SDIO DMA on the + STM3240G-EVAL (and probably STM3220G-EVAL -- untested). diff --git a/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c b/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c index e69f6d329..f0d6bb4cd 100644 --- a/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c +++ b/nuttx/arch/arm/src/stm32/stm32f20xxx_dma.c @@ -783,6 +783,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg, bool * mode to determine when the buffer is half-full, or in double-buffered * mode to determine when one of the two buffers is full. */ + scr |= (half ? DMA_SCR_HTIE : 0) | DMA_SCR_TCIE | DMA_SCR_TEIE; } diff --git a/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c b/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c index dce340ff9..907650b1d 100644 --- a/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c +++ b/nuttx/arch/arm/src/stm32/stm32f40xxx_dma.c @@ -783,6 +783,7 @@ void stm32_dmastart(DMA_HANDLE handle, dma_callback_t callback, void *arg, bool * mode to determine when the buffer is half-full, or in double-buffered * mode to determine when one of the two buffers is full. */ + scr |= (half ? DMA_SCR_HTIE : 0) | DMA_SCR_TCIE | DMA_SCR_TEIE; } diff --git a/nuttx/configs/stm3220g-eval/include/board.h b/nuttx/configs/stm3220g-eval/include/board.h index be9bb886d..dc2f04b9e 100644 --- a/nuttx/configs/stm3220g-eval/include/board.h +++ b/nuttx/configs/stm3220g-eval/include/board.h @@ -185,12 +185,12 @@ # define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) #endif -/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(0+2)= 24 MHz +/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)= 16 MHz * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)= 12 MHz */ #ifdef CONFIG_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (0 << SDIO_CLKCR_CLKDIV_SHIFT) +# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) #else # define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) #endif diff --git a/nuttx/configs/stm3240g-eval/include/board.h b/nuttx/configs/stm3240g-eval/include/board.h index a438dcc1b..658355263 100755 --- a/nuttx/configs/stm3240g-eval/include/board.h +++ b/nuttx/configs/stm3240g-eval/include/board.h @@ -182,12 +182,12 @@ # define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) #endif -/* DMA ON: HSDIOCLK=48MHz, SDIO_CK=SDIOCLK/(0+2)=24 MHz +/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz * DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz */ #ifdef CONFIG_SDIO_DMA -# define SDIO_SDXFR_CLKDIV (0 << SDIO_CLKCR_CLKDIV_SHIFT) +# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT) #else # define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT) #endif |