mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Merge branch 'fmuv2_bringup' of github.com:cvg/Firmware_Private into fmuv2_bringup
This commit is contained in:
commit
59d12ee77f
@ -130,7 +130,7 @@ static struct stm32_dma_s g_dma[DMA_NSTREAMS] =
|
||||
.stream = 3,
|
||||
.irq = STM32_IRQ_DMA1S3,
|
||||
.shift = DMA_INT_STREAM3_SHIFT,
|
||||
.base = STM32_DMA1_BASE + STM32_DMA_OFFSET(4),
|
||||
.base = STM32_DMA1_BASE + STM32_DMA_OFFSET(3),
|
||||
},
|
||||
{
|
||||
.stream = 4,
|
||||
|
||||
@ -181,6 +181,17 @@
|
||||
# define SDIO_SDXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#endif
|
||||
|
||||
/* DMA Channl/Stream Selections *****************************************************/
|
||||
/* Stream selections are arbitrary for now but might become important in the future
|
||||
* is we set aside more DMA channels/streams.
|
||||
*
|
||||
* SDIO DMA
|
||||
* DMAMAP_SDIO_1 = Channel 4, Stream 3 <- may later be used by SPI DMA
|
||||
* DMAMAP_SDIO_2 = Channel 4, Stream 6
|
||||
*/
|
||||
|
||||
#define DMAMAP_SDIO DMAMAP_SDIO_1
|
||||
|
||||
/* High-resolution timer
|
||||
*/
|
||||
#ifdef CONFIG_HRT_TIMER
|
||||
|
||||
@ -118,6 +118,7 @@ CONFIG_STM32_JTAG_SW_ENABLE=y
|
||||
# to do this if DMA is enabled to prevent non-DMA-able CCM memory from
|
||||
# being a part of the stack.
|
||||
#
|
||||
CONFIG_STM32_CCMEXCLUDE=y
|
||||
|
||||
#
|
||||
# On-board FSMC SRAM configuration
|
||||
@ -192,7 +193,7 @@ CONFIG_STM32_USART6=y
|
||||
CONFIG_STM32_ADC1=y
|
||||
CONFIG_STM32_ADC2=n
|
||||
CONFIG_STM32_ADC3=n
|
||||
CONFIG_STM32_SDIO=n
|
||||
CONFIG_STM32_SDIO=y
|
||||
CONFIG_STM32_SPI1=y
|
||||
CONFIG_STM32_SYSCFG=y
|
||||
CONFIG_STM32_TIM9=y
|
||||
@ -784,13 +785,40 @@ CONFIG_FS_BINFS=y
|
||||
# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card.
|
||||
# Default is 20MHz, current setting 24 MHz
|
||||
#
|
||||
CONFIG_MMCSD=n
|
||||
#CONFIG_MMCSD=n
|
||||
# XXX need to rejig this for SDIO
|
||||
#CONFIG_MMCSD_SPI=y
|
||||
#CONFIG_MMCSD_NSLOTS=1
|
||||
#CONFIG_MMCSD_READONLY=n
|
||||
#CONFIG_MMCSD_SPICLOCK=24000000
|
||||
|
||||
#
|
||||
# Maintain legacy build behavior (revisit)
|
||||
#
|
||||
|
||||
CONFIG_MMCSD=y
|
||||
#CONFIG_MMCSD_SPI=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MTD=y
|
||||
|
||||
#
|
||||
# SPI-based MMC/SD driver
|
||||
#
|
||||
#CONFIG_MMCSD_NSLOTS=1
|
||||
#CONFIG_MMCSD_READONLY=n
|
||||
#CONFIG_MMCSD_SPICLOCK=12500000
|
||||
|
||||
#
|
||||
# STM32 SDIO-based MMC/SD driver
|
||||
#
|
||||
CONFIG_SDIO_DMA=y
|
||||
#CONFIG_SDIO_PRI=128
|
||||
#CONFIG_SDIO_DMAPRIO
|
||||
#CONFIG_SDIO_WIDTH_D1_ONLY
|
||||
CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
|
||||
CONFIG_MMCSD_MMCSUPPORT=n
|
||||
CONFIG_MMCSD_HAVECARDDETECT=n
|
||||
|
||||
#
|
||||
# Block driver buffering
|
||||
#
|
||||
@ -1008,8 +1036,8 @@ CONFIG_NSH_FATMOUNTPT=/tmp
|
||||
# Architecture-specific NSH options
|
||||
#
|
||||
#CONFIG_NSH_MMCSDSPIPORTNO=3
|
||||
#CONFIG_NSH_MMCSDSLOTNO=0
|
||||
#CONFIG_NSH_MMCSDMINOR=0
|
||||
CONFIG_NSH_MMCSDSLOTNO=0
|
||||
CONFIG_NSH_MMCSDMINOR=0
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -55,6 +55,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/spi.h>
|
||||
#include <nuttx/i2c.h>
|
||||
#include <nuttx/sdio.h>
|
||||
#include <nuttx/mmcsd.h>
|
||||
#include <nuttx/analog/adc.h>
|
||||
|
||||
@ -128,6 +129,7 @@ __EXPORT void stm32_boardinitialize(void)
|
||||
|
||||
static struct spi_dev_s *spi1;
|
||||
static struct spi_dev_s *spi2;
|
||||
static struct sdio_dev_s *sdio;
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@ -226,5 +228,28 @@ __EXPORT int nsh_archinitialize(void)
|
||||
|
||||
message("[boot] Successfully initialized SPI port 2\n");
|
||||
|
||||
#ifdef CONFIG_MMCSD
|
||||
/* First, get an instance of the SDIO interface */
|
||||
|
||||
sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO);
|
||||
if (!sdio) {
|
||||
message("nsh_archinitialize: Failed to initialize SDIO slot %d\n",
|
||||
CONFIG_NSH_MMCSDSLOTNO);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||
int ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
|
||||
if (ret != OK) {
|
||||
message("nsh_archinitialize: Failed to bind SDIO to the MMC/SD driver: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Then let's guess and say that there is a card in the slot. There is no card detect GPIO. */
|
||||
sdio_mediachange(sdio, true);
|
||||
|
||||
message("[boot] Initialized SDIO\n");
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user