Skip to content

Fix apollo429 #1495

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

Merged
merged 2 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bsp/stm32f429-apollo/drivers/drv_sdio_sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rt_uint8_t SD_Init(void)
SDCARD_Handler.Init.ClockPowerSave=SDIO_CLOCK_POWER_SAVE_DISABLE; //����ʱ���ر�ʱ�ӵ�Դ
SDCARD_Handler.Init.BusWide=SDIO_BUS_WIDE_1B; //1�����
SDCARD_Handler.Init.HardwareFlowControl=SDIO_HARDWARE_FLOW_CONTROL_DISABLE;//�ر�Ӳ������
SDCARD_Handler.Init.ClockDiv=SDIO_TRANSFER_CLK_DIV; //SD����ʱ��Ƶ�����25MHZ
SDCARD_Handler.Init.ClockDiv=SDIO_INIT_CLK_DIV; //��ʼ��ʱ��Ϊ400KHZ

SD_Error=HAL_SD_Init(&SDCARD_Handler,&SDCardInfo);
if(SD_Error!=SD_OK) return 1;
Expand Down
4 changes: 4 additions & 0 deletions bsp/stm32f429-apollo/drivers/drv_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ struct stm32f4_spi stm32f4_spi5 =
/* .spi_handle = */{
/* .Instance = */ SPI5,
},
#ifdef SPI_USE_DMA
/* .hdma_rx = */ {
DMA2_Stream3,
DMA_CHANNEL_2,
Expand All @@ -537,6 +538,7 @@ struct stm32f4_spi stm32f4_spi5 =
DMA_CHANNEL_2,
},
/* .hdma_tx_irq = */ DMA2_Stream4_IRQn,
#endif /* SPI_USE_DMA */
};

static struct rt_spi_bus spi5_bus;
Expand Down Expand Up @@ -703,6 +705,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI,
return RT_ENOSYS;
}

#ifdef SPI_USE_DMA
/* Configure the DMA handler for Transmission process */
p_spi_bus->hdma_tx.Init.Direction = DMA_MEMORY_TO_PERIPH;
p_spi_bus->hdma_tx.Init.PeriphInc = DMA_PINC_DISABLE;
Expand All @@ -727,6 +730,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI,
p_spi_bus->hdma_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
p_spi_bus->hdma_rx.Init.MemBurst = DMA_MBURST_INC4;
p_spi_bus->hdma_rx.Init.PeriphBurst = DMA_PBURST_INC4;
#endif /* SPI_USE_DMA */

spi_bus->parent.user_data = &stm32f4_spi5;

Expand Down
2 changes: 1 addition & 1 deletion bsp/stm32f429-apollo/drivers/drv_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "stm32f4xx_hal.h"

#define SPI_USE_DMA
//#define SPI_USE_DMA

struct stm32f4_spi
{
Expand Down