mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-28 16:14:20 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -9,6 +9,7 @@ STM32 系列 BSP 目前支持情况如下表所示:
|
||||
| [stm32f407-atk-explorer](stm32f407-atk-explorer/) | 正点原子 F407 探索者开发板 |
|
||||
| [stm32f429-atk-apollo](stm32f429-atk-apollo/) | 正点原子 F429 阿波罗开发板 |
|
||||
| [stm32f429-fire-challenger](stm32f429-fire-challenger/) | 野火 F429 挑战者开发板 |
|
||||
| [stm32l475-atk-pandora](stm32l475-atk-pandora/) | 正点原子 L475 潘多拉 IoT 开发板 |
|
||||
| [stm32f767-fire-challenger](stm32f767-fire-challenger/) | 野火 F767 挑战者开发板 |
|
||||
|
||||
了解每个 BSP 的详细情况可以阅读该 BSP 下的 readme 文件,如需使用 BSP 更多功能可参考 docs 文件夹下提供的说明文档:
|
||||
|
||||
@@ -130,6 +130,8 @@ STM32 BSP 由三部分组成,分别是 (1) 通用库、(2) BSP 模板和 (3)
|
||||
|
||||

|
||||
|
||||
注意:如果在文件夹中找不到相应系列的 .s 文件,可能是多个系列的芯片重用了相同的启动文件,此时可以在 CubeMX 中生成目标芯片的工程,查看使用了哪个启动文件,然后再修改启动文件名。
|
||||
|
||||
#### 修改工程模板
|
||||
|
||||
**template** 文件是生成 MDK/IAR 工程的模板文件,通过修改该文件可以设置工程中使用的芯片型号以及下载方式。MDK4/MDK5/IAR 的工程模板文件,如下图所示:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@@ -13,7 +13,13 @@ if GetDepend(['RT_USING_PIN']):
|
||||
|
||||
if GetDepend(['RT_USING_SERIAL']):
|
||||
src += ['drv_usart.c']
|
||||
|
||||
|
||||
if GetDepend(['RT_USING_HWTIMER']):
|
||||
src += ['drv_hwtimer.c']
|
||||
|
||||
if GetDepend(['RT_USING_PWM']):
|
||||
src += ['drv_pwm.c']
|
||||
|
||||
if GetDepend(['RT_USING_SPI']):
|
||||
src += ['drv_spi.c']
|
||||
|
||||
@@ -22,10 +28,7 @@ if GetDepend(['RT_USING_QSPI']):
|
||||
|
||||
if GetDepend(['RT_USING_USB_DEVICE']):
|
||||
src += ['drv_usb.c']
|
||||
|
||||
if GetDepend(['RT_USING_SDCARD']):
|
||||
src += ['drv_sdcard.c']
|
||||
|
||||
|
||||
if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
|
||||
src += ['drv_soft_i2c.c']
|
||||
|
||||
@@ -56,6 +59,9 @@ if GetDepend(['BSP_USING_ON_CHIP_FLASH', 'SOC_SERIES_STM32L4']):
|
||||
if GetDepend(['BSP_USING_WDT']):
|
||||
src += ['drv_wdt.c']
|
||||
|
||||
if GetDepend(['BSP_USING_SDIO']):
|
||||
src += ['drv_sdio.c']
|
||||
|
||||
src += ['drv_common.c']
|
||||
|
||||
path = [cwd]
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 zylx first version
|
||||
*/
|
||||
|
||||
#ifndef __PWM_CONFIG_H__
|
||||
#define __PWM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef BSP_USING_PWM2
|
||||
#ifndef PWM2_CONFIG
|
||||
#define PWM2_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM2, \
|
||||
.name = "pwm2", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM2_CONFIG */
|
||||
#endif /* BSP_USING_PWM2 */
|
||||
|
||||
#ifdef BSP_USING_PWM3
|
||||
#ifndef PWM3_CONFIG
|
||||
#define PWM3_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM3, \
|
||||
.name = "pwm3", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM3_CONFIG */
|
||||
#endif /* BSP_USING_PWM3 */
|
||||
|
||||
#ifdef BSP_USING_PWM4
|
||||
#ifndef PWM4_CONFIG
|
||||
#define PWM4_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM4, \
|
||||
.name = "pwm4", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM4_CONFIG */
|
||||
#endif /* BSP_USING_PWM4 */
|
||||
|
||||
#ifdef BSP_USING_PWM5
|
||||
#ifndef PWM5_CONFIG
|
||||
#define PWM5_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM5, \
|
||||
.name = "pwm5", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM5_CONFIG */
|
||||
#endif /* BSP_USING_PWM5 */
|
||||
|
||||
#endif /* __PWM_CONFIG_H__ */
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 BalanceTWK first version
|
||||
*/
|
||||
|
||||
#ifndef __SDIO_CONFIG_H__
|
||||
#define __SDIO_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "stm32f1xx_hal.h"
|
||||
|
||||
#ifdef BSP_USING_SDIO
|
||||
#define SDIO_BUS_CONFIG \
|
||||
{ \
|
||||
.Instance = SDIO, \
|
||||
.dma_rx.dma_rcc = RCC_AHBENR_DMA2EN, \
|
||||
.dma_tx.dma_rcc = RCC_AHBENR_DMA2EN, \
|
||||
.dma_rx.Instance = DMA2_Channel4, \
|
||||
.dma_rx.dma_irq = DMA2_Channel4_IRQn, \
|
||||
.dma_tx.Instance = DMA2_Channel4, \
|
||||
.dma_tx.dma_irq = DMA2_Channel4_IRQn, \
|
||||
}
|
||||
|
||||
#define SPI1_DMA_RX_IRQHandler DMA2_Channel4_IRQHandler
|
||||
#define SPI1_DMA_TX_IRQHandler DMA2_Channel4_IRQHandler
|
||||
#endif
|
||||
|
||||
#endif /*__SDIO_CONFIG_H__ */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-11 zylx first version
|
||||
*/
|
||||
|
||||
#ifndef __TIM_CONFIG_H__
|
||||
#define __TIM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifndef TIM_DEV_INFO_CONFIG
|
||||
#define TIM_DEV_INFO_CONFIG \
|
||||
{ \
|
||||
.maxfreq = 1000000, \
|
||||
.minfreq = 2000, \
|
||||
.maxcnt = 0xFFFF, \
|
||||
.cntmode = HWTIMER_CNTMODE_UP, \
|
||||
}
|
||||
#endif /* TIM_DEV_INFO_CONFIG */
|
||||
|
||||
#ifdef BSP_USING_TIM2
|
||||
#ifndef TIM2_CONFIG
|
||||
#define TIM2_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM2, \
|
||||
.tim_irqn = TIM2_IRQn, \
|
||||
.name = "timer2", \
|
||||
}
|
||||
#endif /* TIM2_CONFIG */
|
||||
#endif /* BSP_USING_TIM2 */
|
||||
|
||||
#ifdef BSP_USING_TIM3
|
||||
#ifndef TIM3_CONFIG
|
||||
#define TIM3_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM3, \
|
||||
.tim_irqn = TIM3_IRQn, \
|
||||
.name = "timer3", \
|
||||
}
|
||||
#endif /* TIM3_CONFIG */
|
||||
#endif /* BSP_USING_TIM3 */
|
||||
|
||||
#ifdef BSP_USING_TIM4
|
||||
#ifndef TIM4_CONFIG
|
||||
#define TIM4_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM4, \
|
||||
.tim_irqn = TIM4_IRQn, \
|
||||
.name = "timer4", \
|
||||
}
|
||||
#endif /* TIM4_CONFIG */
|
||||
#endif /* BSP_USING_TIM4 */
|
||||
|
||||
#ifdef BSP_USING_TIM5
|
||||
#ifndef TIM5_CONFIG
|
||||
#define TIM5_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM5, \
|
||||
.tim_irqn = TIM5_IRQn, \
|
||||
.name = "timer5", \
|
||||
}
|
||||
#endif /* TIM5_CONFIG */
|
||||
#endif /* BSP_USING_TIM5 */
|
||||
|
||||
#endif /* __TIM_CONFIG_H__ */
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 zylx first version
|
||||
*/
|
||||
|
||||
#ifndef __PWM_CONFIG_H__
|
||||
#define __PWM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef BSP_USING_PWM2
|
||||
#ifndef PWM2_CONFIG
|
||||
#define PWM2_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM2, \
|
||||
.name = "pwm2", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM2_CONFIG */
|
||||
#endif /* BSP_USING_PWM2 */
|
||||
|
||||
#ifdef BSP_USING_PWM3
|
||||
#ifndef PWM3_CONFIG
|
||||
#define PWM3_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM3, \
|
||||
.name = "pwm3", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM3_CONFIG */
|
||||
#endif /* BSP_USING_PWM3 */
|
||||
|
||||
#ifdef BSP_USING_PWM4
|
||||
#ifndef PWM4_CONFIG
|
||||
#define PWM4_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM4, \
|
||||
.name = "pwm4", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM4_CONFIG */
|
||||
#endif /* BSP_USING_PWM4 */
|
||||
|
||||
#ifdef BSP_USING_PWM5
|
||||
#ifndef PWM5_CONFIG
|
||||
#define PWM5_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM5, \
|
||||
.name = "pwm5", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM5_CONFIG */
|
||||
#endif /* BSP_USING_PWM5 */
|
||||
|
||||
#endif /* __PWM_CONFIG_H__ */
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 BalanceTWK first version
|
||||
*/
|
||||
|
||||
#ifndef __SDIO_CONFIG_H__
|
||||
#define __SDIO_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
#ifdef BSP_USING_SDIO
|
||||
#define SDIO_BUS_CONFIG \
|
||||
{ \
|
||||
.Instance = SDIO, \
|
||||
.dma_rx.dma_rcc = RCC_AHB1ENR_DMA2EN, \
|
||||
.dma_tx.dma_rcc = RCC_AHB1ENR_DMA2EN, \
|
||||
.dma_rx.Instance = DMA2_Stream3, \
|
||||
.dma_rx.channel = DMA_CHANNEL_4, \
|
||||
.dma_rx.dma_irq = DMA2_Stream3_IRQn, \
|
||||
.dma_tx.Instance = DMA2_Stream6, \
|
||||
.dma_tx.channel = DMA_CHANNEL_4, \
|
||||
.dma_tx.dma_irq = DMA2_Stream6_IRQn, \
|
||||
}
|
||||
|
||||
#define SPI1_DMA_RX_IRQHandler DMA2_Stream3_IRQHandler
|
||||
#define SPI1_DMA_TX_IRQHandler DMA2_Stream6_IRQHandler
|
||||
#endif
|
||||
|
||||
#endif /*__SDIO_CONFIG_H__ */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-11 zylx first version
|
||||
*/
|
||||
|
||||
#ifndef __TIM_CONFIG_H__
|
||||
#define __TIM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifndef TIM_DEV_INFO_CONFIG
|
||||
#define TIM_DEV_INFO_CONFIG \
|
||||
{ \
|
||||
.maxfreq = 1000000, \
|
||||
.minfreq = 3000, \
|
||||
.maxcnt = 0xFFFF, \
|
||||
.cntmode = HWTIMER_CNTMODE_UP, \
|
||||
}
|
||||
#endif /* TIM_DEV_INFO_CONFIG */
|
||||
|
||||
#ifdef BSP_USING_TIM11
|
||||
#ifndef TIM11_CONFIG
|
||||
#define TIM11_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM11, \
|
||||
.tim_irqn = TIM1_TRG_COM_TIM11_IRQn, \
|
||||
.name = "timer11", \
|
||||
}
|
||||
#endif /* TIM11_CONFIG */
|
||||
#endif /* BSP_USING_TIM11 */
|
||||
|
||||
#ifdef BSP_USING_TIM13
|
||||
#ifndef TIM13_CONFIG
|
||||
#define TIM13_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM13, \
|
||||
.tim_irqn = TIM8_UP_TIM13_IRQn, \
|
||||
.name = "timer13", \
|
||||
}
|
||||
#endif /* TIM13_CONFIG */
|
||||
#endif /* BSP_USING_TIM13 */
|
||||
|
||||
#ifdef BSP_USING_TIM14
|
||||
#ifndef TIM14_CONFIG
|
||||
#define TIM14_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM14, \
|
||||
.tim_irqn = TIM8_TRG_COM_TIM14_IRQn, \
|
||||
.name = "timer14", \
|
||||
}
|
||||
#endif /* TIM14_CONFIG */
|
||||
#endif /* BSP_USING_TIM14 */
|
||||
|
||||
#endif /* __TIM_CONFIG_H__ */
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 zylx first version
|
||||
*/
|
||||
|
||||
#ifndef __PWM_CONFIG_H__
|
||||
#define __PWM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef BSP_USING_PWM2
|
||||
#ifndef PWM2_CONFIG
|
||||
#define PWM2_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM2, \
|
||||
.name = "pwm2", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM2_CONFIG */
|
||||
#endif /* BSP_USING_PWM2 */
|
||||
|
||||
#ifdef BSP_USING_PWM3
|
||||
#ifndef PWM3_CONFIG
|
||||
#define PWM3_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM3, \
|
||||
.name = "pwm3", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM3_CONFIG */
|
||||
#endif /* BSP_USING_PWM3 */
|
||||
|
||||
#ifdef BSP_USING_PWM4
|
||||
#ifndef PWM4_CONFIG
|
||||
#define PWM4_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM4, \
|
||||
.name = "pwm4", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM4_CONFIG */
|
||||
#endif /* BSP_USING_PWM4 */
|
||||
|
||||
#ifdef BSP_USING_PWM5
|
||||
#ifndef PWM5_CONFIG
|
||||
#define PWM5_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM5, \
|
||||
.name = "pwm5", \
|
||||
.channel = 0 \
|
||||
}
|
||||
#endif /* PWM5_CONFIG */
|
||||
#endif /* BSP_USING_PWM5 */
|
||||
|
||||
#endif /* __PWM_CONFIG_H__ */
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-12 zylx first version
|
||||
*/
|
||||
|
||||
#ifndef __TIM_CONFIG_H__
|
||||
#define __TIM_CONFIG_H__
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifndef TIM_DEV_INFO_CONFIG
|
||||
#define TIM_DEV_INFO_CONFIG \
|
||||
{ \
|
||||
.maxfreq = 1000000, \
|
||||
.minfreq = 2000, \
|
||||
.maxcnt = 0xFFFF, \
|
||||
.cntmode = HWTIMER_CNTMODE_UP, \
|
||||
}
|
||||
#endif /* TIM_DEV_INFO_CONFIG */
|
||||
|
||||
#ifdef BSP_USING_TIM15
|
||||
#ifndef TIM15_CONFIG
|
||||
#define TIM15_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM15, \
|
||||
.tim_irqn = TIM1_BRK_TIM15_IRQn, \
|
||||
.name = "timer15", \
|
||||
}
|
||||
#endif /* TIM15_CONFIG */
|
||||
#endif /* BSP_USING_TIM15 */
|
||||
|
||||
#ifdef BSP_USING_TIM16
|
||||
#ifndef TIM16_CONFIG
|
||||
#define TIM16_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM16, \
|
||||
.tim_irqn = TIM1_UP_TIM16_IRQn, \
|
||||
.name = "timer16", \
|
||||
}
|
||||
#endif /* TIM16_CONFIG */
|
||||
#endif /* BSP_USING_TIM16 */
|
||||
|
||||
#ifdef BSP_USING_TIM17
|
||||
#ifndef TIM17_CONFIG
|
||||
#define TIM17_CONFIG \
|
||||
{ \
|
||||
.tim_handle.Instance = TIM17, \
|
||||
.tim_irqn = TIM1_TRG_COM_TIM17_IRQn, \
|
||||
.name = "timer17", \
|
||||
}
|
||||
#endif /* TIM17_CONFIG */
|
||||
#endif /* BSP_USING_TIM17 */
|
||||
|
||||
#endif /* __TIM_CONFIG_H__ */
|
||||
@@ -91,22 +91,30 @@ static rt_uint32_t GetSector(rt_uint32_t Address)
|
||||
{
|
||||
sector = FLASH_SECTOR_7;
|
||||
}
|
||||
#if defined(FLASH_SECTOR_8)
|
||||
else if((Address < ADDR_FLASH_SECTOR_9) && (Address >= ADDR_FLASH_SECTOR_8))
|
||||
{
|
||||
sector = FLASH_SECTOR_8;
|
||||
}
|
||||
#endif
|
||||
#if defined(FLASH_SECTOR_9)
|
||||
else if((Address < ADDR_FLASH_SECTOR_10) && (Address >= ADDR_FLASH_SECTOR_9))
|
||||
{
|
||||
sector = FLASH_SECTOR_9;
|
||||
}
|
||||
#endif
|
||||
#if defined(FLASH_SECTOR_10)
|
||||
else if((Address < ADDR_FLASH_SECTOR_11) && (Address >= ADDR_FLASH_SECTOR_10))
|
||||
{
|
||||
sector = FLASH_SECTOR_10;
|
||||
}
|
||||
#endif
|
||||
#if defined(FLASH_SECTOR_11)
|
||||
else if((Address < ADDR_FLASH_SECTOR_12) && (Address >= ADDR_FLASH_SECTOR_11))
|
||||
{
|
||||
sector = FLASH_SECTOR_11;
|
||||
}
|
||||
#endif
|
||||
#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx)
|
||||
else if((Address < ADDR_FLASH_SECTOR_13) && (Address >= ADDR_FLASH_SECTOR_12))
|
||||
{
|
||||
@@ -219,7 +227,7 @@ int stm32_flash_write(long offset, const rt_uint8_t *buf, size_t size)
|
||||
|
||||
HAL_FLASH_Unlock();
|
||||
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGSERR);
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
|
||||
|
||||
for (size_t i = 0; i < size; i++, addr++, buf++)
|
||||
{
|
||||
@@ -278,17 +286,19 @@ int stm32_flash_erase(long offset, size_t size)
|
||||
/* Unlock the Flash to enable the flash control register access */
|
||||
HAL_FLASH_Unlock();
|
||||
|
||||
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR);
|
||||
|
||||
/* Get the 1st sector to erase */
|
||||
FirstSector = GetSector(addr);
|
||||
/* Get the number of sector to erase from 1st sector*/
|
||||
NbOfSectors = GetSector(addr + size) - FirstSector + 1;
|
||||
NbOfSectors = GetSector(addr + size - 1) - FirstSector + 1;
|
||||
/* Fill EraseInit structure*/
|
||||
EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;
|
||||
EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3;
|
||||
EraseInitStruct.Sector = FirstSector;
|
||||
EraseInitStruct.NbSectors = NbOfSectors;
|
||||
|
||||
if (HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError) != HAL_OK)
|
||||
if (HAL_FLASHEx_Erase(&EraseInitStruct, (uint32_t *)&SECTORError) != HAL_OK)
|
||||
{
|
||||
result = -RT_ERROR;
|
||||
goto __exit;
|
||||
|
||||
@@ -244,7 +244,7 @@ int stm32_flash_erase(long offset, size_t size)
|
||||
/* Get the 1st page to erase */
|
||||
FirstPage = GetPage(addr);
|
||||
/* Get the number of pages to erase from 1st page */
|
||||
NbOfPages = GetPage(addr + size) - FirstPage + 1;
|
||||
NbOfPages = GetPage(addr + size - 1) - FirstPage + 1;
|
||||
/* Get the bank */
|
||||
BankNumber = GetBank(addr);
|
||||
/* Fill EraseInit structure*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 BalanceTWK first version
|
||||
*/
|
||||
|
||||
#ifndef _DRV_SDIO_H
|
||||
#define _DRV_SDIO_H
|
||||
#include <rtthread.h>
|
||||
#include "rtdevice.h"
|
||||
#include <rthw.h>
|
||||
#include <drv_common.h>
|
||||
#include "drv_dma.h"
|
||||
#include <string.h>
|
||||
#include <drivers/mmcsd_core.h>
|
||||
#include <drivers/sdio.h>
|
||||
|
||||
#define SDIO_BUFF_SIZE 4096
|
||||
#define SDIO_MAX_FREQ 2000000
|
||||
#define SDIO_ALIGN_LEN 32
|
||||
|
||||
#ifndef SDIO_BASE_ADDRESS
|
||||
#define SDIO_BASE_ADDRESS (0x40012800U)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_CLOCK_FREQ
|
||||
#define SDIO_CLOCK_FREQ (48U * 1000 * 1000)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_BUFF_SIZE
|
||||
#define SDIO_BUFF_SIZE (4096)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_ALIGN_LEN
|
||||
#define SDIO_ALIGN_LEN (32)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_MAX_FREQ
|
||||
#define SDIO_MAX_FREQ (24 * 1000 * 1000)
|
||||
#endif
|
||||
|
||||
#define HW_SDIO_IT_CCRCFAIL (0x01U << 0)
|
||||
#define HW_SDIO_IT_DCRCFAIL (0x01U << 1)
|
||||
#define HW_SDIO_IT_CTIMEOUT (0x01U << 2)
|
||||
#define HW_SDIO_IT_DTIMEOUT (0x01U << 3)
|
||||
#define HW_SDIO_IT_TXUNDERR (0x01U << 4)
|
||||
#define HW_SDIO_IT_RXOVERR (0x01U << 5)
|
||||
#define HW_SDIO_IT_CMDREND (0x01U << 6)
|
||||
#define HW_SDIO_IT_CMDSENT (0x01U << 7)
|
||||
#define HW_SDIO_IT_DATAEND (0x01U << 8)
|
||||
#define HW_SDIO_IT_STBITERR (0x01U << 9)
|
||||
#define HW_SDIO_IT_DBCKEND (0x01U << 10)
|
||||
#define HW_SDIO_IT_CMDACT (0x01U << 11)
|
||||
#define HW_SDIO_IT_TXACT (0x01U << 12)
|
||||
#define HW_SDIO_IT_RXACT (0x01U << 13)
|
||||
#define HW_SDIO_IT_TXFIFOHE (0x01U << 14)
|
||||
#define HW_SDIO_IT_RXFIFOHF (0x01U << 15)
|
||||
#define HW_SDIO_IT_TXFIFOF (0x01U << 16)
|
||||
#define HW_SDIO_IT_RXFIFOF (0x01U << 17)
|
||||
#define HW_SDIO_IT_TXFIFOE (0x01U << 18)
|
||||
#define HW_SDIO_IT_RXFIFOE (0x01U << 19)
|
||||
#define HW_SDIO_IT_TXDAVL (0x01U << 20)
|
||||
#define HW_SDIO_IT_RXDAVL (0x01U << 21)
|
||||
#define HW_SDIO_IT_SDIOIT (0x01U << 22)
|
||||
|
||||
#define HW_SDIO_ERRORS \
|
||||
(HW_SDIO_IT_CCRCFAIL | HW_SDIO_IT_CTIMEOUT | \
|
||||
HW_SDIO_IT_DCRCFAIL | HW_SDIO_IT_DTIMEOUT | \
|
||||
HW_SDIO_IT_RXOVERR | HW_SDIO_IT_TXUNDERR)
|
||||
|
||||
#define HW_SDIO_POWER_OFF (0x00U)
|
||||
#define HW_SDIO_POWER_UP (0x02U)
|
||||
#define HW_SDIO_POWER_ON (0x03U)
|
||||
|
||||
#define HW_SDIO_FLOW_ENABLE (0x01U << 14)
|
||||
#define HW_SDIO_BUSWIDE_1B (0x00U << 11)
|
||||
#define HW_SDIO_BUSWIDE_4B (0x01U << 11)
|
||||
#define HW_SDIO_BUSWIDE_8B (0x02U << 11)
|
||||
#define HW_SDIO_BYPASS_ENABLE (0x01U << 10)
|
||||
#define HW_SDIO_IDLE_ENABLE (0x01U << 9)
|
||||
#define HW_SDIO_CLK_ENABLE (0x01U << 8)
|
||||
|
||||
#define HW_SDIO_SUSPEND_CMD (0x01U << 11)
|
||||
#define HW_SDIO_CPSM_ENABLE (0x01U << 10)
|
||||
#define HW_SDIO_WAIT_END (0x01U << 9)
|
||||
#define HW_SDIO_WAIT_INT (0x01U << 8)
|
||||
#define HW_SDIO_RESPONSE_NO (0x00U << 6)
|
||||
#define HW_SDIO_RESPONSE_SHORT (0x01U << 6)
|
||||
#define HW_SDIO_RESPONSE_LONG (0x03U << 6)
|
||||
|
||||
#define HW_SDIO_DATA_LEN_MASK (0x01FFFFFFU)
|
||||
|
||||
#define HW_SDIO_IO_ENABLE (0x01U << 11)
|
||||
#define HW_SDIO_RWMOD_CK (0x01U << 10)
|
||||
#define HW_SDIO_RWSTOP_ENABLE (0x01U << 9)
|
||||
#define HW_SDIO_RWSTART_ENABLE (0x01U << 8)
|
||||
#define HW_SDIO_DBLOCKSIZE_1 (0x00U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_2 (0x01U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_4 (0x02U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_8 (0x03U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_16 (0x04U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_32 (0x05U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_64 (0x06U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_128 (0x07U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_256 (0x08U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_512 (0x09U << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_1024 (0x0AU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_2048 (0x0BU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_4096 (0x0CU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_8192 (0x0DU << 4)
|
||||
#define HW_SDIO_DBLOCKSIZE_16384 (0x0EU << 4)
|
||||
#define HW_SDIO_DMA_ENABLE (0x01U << 3)
|
||||
#define HW_SDIO_STREAM_ENABLE (0x01U << 2)
|
||||
#define HW_SDIO_TO_HOST (0x01U << 1)
|
||||
#define HW_SDIO_DPSM_ENABLE (0x01U << 0)
|
||||
|
||||
#define HW_SDIO_DATATIMEOUT (0xF0000000U)
|
||||
|
||||
struct stm32_sdio
|
||||
{
|
||||
volatile rt_uint32_t power;
|
||||
volatile rt_uint32_t clkcr;
|
||||
volatile rt_uint32_t arg;
|
||||
volatile rt_uint32_t cmd;
|
||||
volatile rt_uint32_t respcmd;
|
||||
volatile rt_uint32_t resp1;
|
||||
volatile rt_uint32_t resp2;
|
||||
volatile rt_uint32_t resp3;
|
||||
volatile rt_uint32_t resp4;
|
||||
volatile rt_uint32_t dtimer;
|
||||
volatile rt_uint32_t dlen;
|
||||
volatile rt_uint32_t dctrl;
|
||||
volatile rt_uint32_t dcount;
|
||||
volatile rt_uint32_t sta;
|
||||
volatile rt_uint32_t icr;
|
||||
volatile rt_uint32_t mask;
|
||||
volatile rt_uint32_t reserved0[2];
|
||||
volatile rt_uint32_t fifocnt;
|
||||
volatile rt_uint32_t reserved1[13];
|
||||
volatile rt_uint32_t fifo;
|
||||
};
|
||||
|
||||
typedef rt_err_t (*dma_txconfig)(rt_uint32_t *src, rt_uint32_t *dst, int size);
|
||||
typedef rt_err_t (*dma_rxconfig)(rt_uint32_t *src, rt_uint32_t *dst, int size);
|
||||
typedef rt_uint32_t (*sdio_clk_get)(struct stm32_sdio *hw_sdio);
|
||||
|
||||
struct stm32_sdio_des
|
||||
{
|
||||
struct stm32_sdio *hw_sdio;
|
||||
dma_txconfig txconfig;
|
||||
dma_rxconfig rxconfig;
|
||||
sdio_clk_get clk_get;
|
||||
};
|
||||
|
||||
struct stm32_sdio_config
|
||||
{
|
||||
SDIO_TypeDef *Instance;
|
||||
struct dma_config dma_rx, dma_tx;
|
||||
};
|
||||
|
||||
/* stm32 sdio dirver class */
|
||||
struct stm32_sdio_class
|
||||
{
|
||||
struct stm32_sdio_des *des;
|
||||
const struct stm32_sdio_config *cfg;
|
||||
struct rt_mmcsd_host host;
|
||||
struct
|
||||
{
|
||||
DMA_HandleTypeDef handle_rx;
|
||||
DMA_HandleTypeDef handle_tx;
|
||||
} dma;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -8,69 +8,80 @@ cwd = GetCurrentDir()
|
||||
# The set of source files associated with this SConscript file.
|
||||
src = Split("""
|
||||
CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_crc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_irda.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_smartcard.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_usart.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_wwdg.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_adc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_crc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dac.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_fsmc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_i2c.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_pwr.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rtc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_sdmmc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_spi.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_tim.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cec.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac_ex.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_eth.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_hcd.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2s.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_mmc.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nand.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pccard.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nor.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c
|
||||
STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c
|
||||
""")
|
||||
#device options
|
||||
|
||||
if GetDepend(['RT_USING_PIN']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_SERIAL']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_usart.c']
|
||||
|
||||
if GetDepend(['RT_USING_I2C']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c']
|
||||
|
||||
if GetDepend(['RT_USING_SPI']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi_ex.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_spi.c']
|
||||
|
||||
if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_hcd.c']
|
||||
|
||||
if GetDepend(['RT_USING_CAN']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.c']
|
||||
|
||||
if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c']
|
||||
|
||||
if GetDepend(['BSP_USING_ETH']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_eth.c']
|
||||
|
||||
if GetDepend(['RT_USING_ADC']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_RTC']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_WDT']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_wwdg.c']
|
||||
|
||||
if GetDepend(['RT_USING_SDIO']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_mmc.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.c']
|
||||
|
||||
if GetDepend(['RT_USING_AUDIO']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2s.c']
|
||||
|
||||
if GetDepend(['RT_USING_MTD_NOR']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nor.c']
|
||||
|
||||
if GetDepend(['RT_USING_MTD_NAND']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nand.c']
|
||||
|
||||
if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c']
|
||||
src += ['STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c']
|
||||
|
||||
path = [cwd + '/CMSIS/Device/ST/STM32F1xx/Include',
|
||||
cwd + '/STM32F1xx_HAL_Driver/Inc',
|
||||
cwd + '/STM32F1xx_HAL_Driver/Inc',
|
||||
cwd + '/CMSIS/Include']
|
||||
|
||||
if GetDepend(['RT_USING_RTT_CMSIS']):
|
||||
|
||||
@@ -9,74 +9,92 @@ cwd = GetCurrentDir()
|
||||
src = Split('''
|
||||
CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cec.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_crc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dfsdm.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_fmpi2c_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hash_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_irda.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_lptim.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nand.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nor.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_smartcard.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spdifrx.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_wwdg.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c
|
||||
STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c
|
||||
''')
|
||||
|
||||
if GetDepend(['RT_USING_PIN']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c']
|
||||
|
||||
if GetDepend(['RT_USING_SERIAL']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c']
|
||||
|
||||
if GetDepend(['RT_USING_I2C']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_SPI']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c']
|
||||
|
||||
if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c']
|
||||
|
||||
if GetDepend(['RT_USING_CAN']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c']
|
||||
|
||||
if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_lptim.c']
|
||||
|
||||
if GetDepend(['BSP_USING_ETH']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c']
|
||||
|
||||
if GetDepend(['RT_USING_ADC']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_RTC']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_WDT']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_wwdg.c']
|
||||
|
||||
if GetDepend(['RT_USING_SDIO']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c']
|
||||
|
||||
if GetDepend(['RT_USING_AUDIO']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_MTD_NOR']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nor.c']
|
||||
|
||||
if GetDepend(['RT_USING_MTD_NAND']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nand.c']
|
||||
|
||||
if GetDepend(['BSP_USING_SDRAM']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c']
|
||||
|
||||
if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c']
|
||||
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c']
|
||||
|
||||
path = [cwd + '/STM32F4xx_HAL_Driver/Inc',
|
||||
cwd + '/CMSIS/Device/ST/STM32F4xx/Include',
|
||||
cwd + '/CMSIS/Include']
|
||||
|
||||
@@ -9,103 +9,86 @@ cwd = GetCurrentDir()
|
||||
src = Split('''
|
||||
CMSIS/Device/ST/STM32L4xx/Source/Templates/system_stm32l4xx.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_can.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_comp.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_crc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_crc_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cryp.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cryp_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dac_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dcmi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dfsdm.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dfsdm_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma2d.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dsi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_firewall.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gfxmmu.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_hash.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_hash_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_hcd.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_irda.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_iwdg.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_lcd.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_lptim.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_ltdc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_ltdc_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_nand.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_nor.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_opamp.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_opamp_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_ospi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pcd.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pcd_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rng.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sai.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sai_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_smartcard.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_smartcard_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_smbus.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sram.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_swpmi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tsc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_usart.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_usart_ex.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_wwdg.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_adc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_comp.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_crc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_crs.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_dac.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_dma.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_dma2d.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_exti.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_fmc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_gpio.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_i2c.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_lptim.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_lpuart.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_opamp.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_pwr.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rcc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rng.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_rtc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_sdmmc.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_spi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_swpmi.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_tim.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_usart.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_usb.c
|
||||
STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_utils.c
|
||||
''')
|
||||
|
||||
if GetDepend(['RT_USING_PIN']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c']
|
||||
|
||||
if GetDepend(['RT_USING_SERIAL']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_usart.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_usart_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_I2C']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_SPI']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_spi_ex.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c']
|
||||
|
||||
if GetDepend(['RT_USING_USB_HOST']) or GetDepend(['RT_USING_USB_DEVICE']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_hcd.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pcd.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pcd_ex.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_ll_usb.c']
|
||||
|
||||
if GetDepend(['RT_USING_CAN']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_can.c']
|
||||
|
||||
if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_lptim.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_ADC']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_adc_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_RTC']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rtc_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_WDT']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_iwdg.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_wwdg.c']
|
||||
|
||||
if GetDepend(['RT_USING_SDIO']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sd_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_AUDIO']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sai.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_sai_ex.c']
|
||||
|
||||
if GetDepend(['RT_USING_MTD_NOR']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_nor.c']
|
||||
|
||||
if GetDepend(['RT_USING_MTD_NAND']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_nand.c']
|
||||
|
||||
if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c']
|
||||
src += ['STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c']
|
||||
|
||||
path = [cwd + '/STM32L4xx_HAL_Driver/Inc',
|
||||
cwd + '/CMSIS/Device/ST/STM32L4xx/Include',
|
||||
cwd + '/CMSIS/Include']
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M3=y
|
||||
@@ -180,12 +181,14 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -278,6 +281,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -340,7 +344,6 @@ CONFIG_SOC_STM32F103RB=y
|
||||
#
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
|
||||
@@ -11,14 +11,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PB1 */
|
||||
#define LED0_PIN GET_PIN(B, 1)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
// rt_pin_write(LED0_PIN, !rt_pin_read(LED0_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SERIAL
|
||||
default y
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default n
|
||||
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
select RT_USING_SPI
|
||||
|
||||
@@ -51,12 +51,3 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
|
||||
}
|
||||
|
||||
#ifdef RT_USING_PIN
|
||||
// int board_pin_init(void)
|
||||
// {
|
||||
// rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
// return 0;
|
||||
// }
|
||||
// INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
#include <stm32f1xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
/* Board Pin definitions */
|
||||
// #define LED0_PIN GET_PIN(C, 0)
|
||||
#endif
|
||||
|
||||
/* Internal SRAM memory size[Kbytes] <8-64>, Default: 64*/
|
||||
#define STM32_SRAM_SIZE 20
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M3
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M4=y
|
||||
@@ -180,12 +181,14 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -279,6 +282,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -341,7 +345,6 @@ CONFIG_SOC_STM32F407ZG=y
|
||||
#
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
|
||||
@@ -11,14 +11,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PB1 */
|
||||
#define LED0_PIN GET_PIN(B, 1)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
// rt_pin_write(LED0_PIN, !rt_pin_read(LED0_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SERIAL
|
||||
default y
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default n
|
||||
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
select RT_USING_SPI
|
||||
|
||||
@@ -56,12 +56,3 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
|
||||
}
|
||||
|
||||
#ifdef RT_USING_PIN
|
||||
// int board_pin_init(void)
|
||||
// {
|
||||
// rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
// return 0;
|
||||
// }
|
||||
// INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
#include <stm32f4xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
/* Board Pin definitions */
|
||||
// #define LED0_PIN GET_PIN(C, 0)
|
||||
#endif
|
||||
|
||||
#define STM32_SRAM_SIZE 128
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M4
|
||||
|
||||
@@ -62,9 +62,10 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M4=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M7=y
|
||||
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
|
||||
|
||||
#
|
||||
@@ -110,6 +111,7 @@ CONFIG_FINSH_ARG_MAX=10
|
||||
CONFIG_RT_USING_DEVICE_IPC=y
|
||||
CONFIG_RT_PIPE_BUFSZ=512
|
||||
CONFIG_RT_USING_SERIAL=y
|
||||
CONFIG_RT_SERIAL_USING_DMA=y
|
||||
# CONFIG_RT_USING_CAN is not set
|
||||
# CONFIG_RT_USING_HWTIMER is not set
|
||||
# CONFIG_RT_USING_CPUTIME is not set
|
||||
@@ -179,12 +181,14 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -278,6 +282,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -324,12 +329,12 @@ CONFIG_RT_USING_PIN=y
|
||||
#
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
CONFIG_SOC_FAMILY_STM32=y
|
||||
CONFIG_SOC_SERIES_STM32F4=y
|
||||
CONFIG_SOC_SERIES_STM32F7=y
|
||||
|
||||
#
|
||||
# Hardware Drivers Config
|
||||
#
|
||||
CONFIG_SOC_STM32F407ZG=y
|
||||
CONFIG_SOC_STM32F767IG=y
|
||||
|
||||
#
|
||||
# Onboard Peripheral Drivers
|
||||
@@ -340,7 +345,6 @@ CONFIG_SOC_STM32F407ZG=y
|
||||
#
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
|
||||
@@ -21,10 +21,6 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SERIAL
|
||||
default y
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default n
|
||||
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
select RT_USING_SPI
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M7
|
||||
|
||||
/* RT-Thread Components */
|
||||
|
||||
@@ -74,6 +77,7 @@
|
||||
#define RT_USING_DEVICE_IPC
|
||||
#define RT_PIPE_BUFSZ 512
|
||||
#define RT_USING_SERIAL
|
||||
#define RT_SERIAL_USING_DMA
|
||||
#define RT_USING_PIN
|
||||
|
||||
/* Using WiFi */
|
||||
@@ -105,6 +109,9 @@
|
||||
/* Utilities */
|
||||
|
||||
|
||||
/* ARM CMSIS */
|
||||
|
||||
|
||||
/* RT-Thread online packages */
|
||||
|
||||
/* IoT - internet of things */
|
||||
@@ -149,6 +156,8 @@
|
||||
|
||||
/* example package: hello */
|
||||
|
||||
#define SOC_FAMILY_STM32
|
||||
#define SOC_SERIES_STM32F7
|
||||
|
||||
/* Hardware Drivers Config */
|
||||
|
||||
@@ -156,8 +165,6 @@
|
||||
|
||||
/* Onboard Peripheral Drivers */
|
||||
|
||||
#define BSP_USING_USB_TO_USART
|
||||
|
||||
/* On-chip Peripheral Drivers */
|
||||
|
||||
#define BSP_USING_GPIO
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=256
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M4=y
|
||||
@@ -180,12 +181,14 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -279,6 +282,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -341,7 +345,6 @@ CONFIG_SOC_STM32L475VE=y
|
||||
#
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
|
||||
@@ -11,14 +11,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PB1 */
|
||||
#define LED0_PIN GET_PIN(B, 1)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
// rt_pin_write(LED0_PIN, !rt_pin_read(LED0_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,6 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SERIAL
|
||||
default y
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default n
|
||||
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
select RT_USING_SPI
|
||||
|
||||
@@ -66,12 +66,3 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
|
||||
}
|
||||
|
||||
#ifdef RT_USING_PIN
|
||||
// int board_pin_init(void)
|
||||
// {
|
||||
// rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
// return 0;
|
||||
// }
|
||||
// INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
#include <stm32l4xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
/* Board Pin definitions */
|
||||
// #define LED0_PIN GET_PIN(C, 0)
|
||||
#endif
|
||||
|
||||
#define STM32_SRAM_SIZE 96
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 256
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M4
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
# RT-Thread Kernel
|
||||
#
|
||||
CONFIG_RT_NAME_MAX=8
|
||||
# CONFIG_RT_USING_SMP is not set
|
||||
CONFIG_RT_ALIGN_SIZE=4
|
||||
# CONFIG_RT_THREAD_PRIORITY_8 is not set
|
||||
CONFIG_RT_THREAD_PRIORITY_32=y
|
||||
@@ -15,6 +16,7 @@ CONFIG_RT_THREAD_PRIORITY_MAX=32
|
||||
CONFIG_RT_TICK_PER_SECOND=1000
|
||||
CONFIG_RT_USING_OVERFLOW_CHECK=y
|
||||
CONFIG_RT_USING_HOOK=y
|
||||
CONFIG_RT_USING_IDLE_HOOK=y
|
||||
CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
|
||||
CONFIG_IDLE_THREAD_STACK_SIZE=256
|
||||
# CONFIG_RT_USING_TIMER_SOFT is not set
|
||||
@@ -61,9 +63,11 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M3=y
|
||||
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
|
||||
|
||||
#
|
||||
# RT-Thread Components
|
||||
@@ -114,10 +118,12 @@ CONFIG_RT_SERIAL_USING_DMA=y
|
||||
# CONFIG_RT_USING_CPUTIME is not set
|
||||
# CONFIG_RT_USING_I2C is not set
|
||||
CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_ADC is not set
|
||||
# CONFIG_RT_USING_PWM is not set
|
||||
# CONFIG_RT_USING_MTD_NOR is not set
|
||||
# CONFIG_RT_USING_MTD_NAND is not set
|
||||
# CONFIG_RT_USING_MTD is not set
|
||||
# CONFIG_RT_USING_PM is not set
|
||||
# CONFIG_RT_USING_RTC is not set
|
||||
# CONFIG_RT_USING_SDIO is not set
|
||||
# CONFIG_RT_USING_SPI is not set
|
||||
@@ -175,12 +181,15 @@ CONFIG_RT_USING_PIN=y
|
||||
#
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -247,7 +256,6 @@ CONFIG_RT_USING_PIN=y
|
||||
#
|
||||
# CONFIG_PKG_USING_OPENMV is not set
|
||||
# CONFIG_PKG_USING_MUPDF is not set
|
||||
# CONFIG_PKG_USING_BEEPPLAYER is not set
|
||||
|
||||
#
|
||||
# tools packages
|
||||
@@ -274,6 +282,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -288,6 +297,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_BUTTON is not set
|
||||
# CONFIG_PKG_USING_MPU6XXX is not set
|
||||
# CONFIG_PKG_USING_PCF8574 is not set
|
||||
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
@@ -303,10 +313,6 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_DSTR is not set
|
||||
# CONFIG_PKG_USING_TINYFRAME is not set
|
||||
|
||||
#
|
||||
# sample package
|
||||
#
|
||||
|
||||
#
|
||||
# samples: kernel and components samples
|
||||
#
|
||||
@@ -314,10 +320,6 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
|
||||
|
||||
#
|
||||
# example package: hello
|
||||
#
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
CONFIG_SOC_FAMILY_STM32=y
|
||||
CONFIG_SOC_SERIES_STM32F1=y
|
||||
@@ -330,10 +332,10 @@ CONFIG_SOC_STM32F103RB=y
|
||||
#
|
||||
# Onboard Peripheral Drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Offboard Peripheral Drivers
|
||||
#
|
||||
CONFIG_BSP_USING_USB_TO_USART=y
|
||||
# CONFIG_BSP_USING_EEPROM is not set
|
||||
# CONFIG_BSP_USING_SPI_FLASH is not set
|
||||
# CONFIG_BSP_USING_POT is not set
|
||||
|
||||
#
|
||||
# On-chip Peripheral Drivers
|
||||
@@ -343,7 +345,16 @@ CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_USING_UART2 is not set
|
||||
# CONFIG_BSP_USING_UART3 is not set
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_TIM is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_USING_SPI2 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
# CONFIG_BSP_USING_ADC is not set
|
||||
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
|
||||
# CONFIG_BSP_USING_ONCHIP_RTC is not set
|
||||
# CONFIG_BSP_USING_WDT is not set
|
||||
|
||||
#
|
||||
# Board extended module Drivers
|
||||
#
|
||||
|
||||
@@ -11,14 +11,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PC0 */
|
||||
#define LED0_PIN GET_PIN(C, 0)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED0_PIN, !rt_pin_read(LED0_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,8 @@ extern "C" {
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||
/*#define HAL_TIM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
/*#define HAL_USART_MODULE_ENABLED */
|
||||
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
@@ -70,6 +70,10 @@ RTC_HandleTypeDef hrtc;
|
||||
|
||||
SPI_HandleTypeDef hspi2;
|
||||
|
||||
TIM_HandleTypeDef htim2;
|
||||
TIM_HandleTypeDef htim3;
|
||||
TIM_HandleTypeDef htim4;
|
||||
|
||||
UART_HandleTypeDef huart1;
|
||||
|
||||
/* USER CODE BEGIN PV */
|
||||
@@ -85,6 +89,9 @@ static void MX_SPI2_Init(void);
|
||||
static void MX_RTC_Init(void);
|
||||
static void MX_IWDG_Init(void);
|
||||
static void MX_ADC1_Init(void);
|
||||
static void MX_TIM2_Init(void);
|
||||
static void MX_TIM3_Init(void);
|
||||
static void MX_TIM4_Init(void);
|
||||
/* USER CODE BEGIN PFP */
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
|
||||
@@ -128,6 +135,9 @@ int main(void)
|
||||
MX_RTC_Init();
|
||||
MX_IWDG_Init();
|
||||
MX_ADC1_Init();
|
||||
MX_TIM2_Init();
|
||||
MX_TIM3_Init();
|
||||
MX_TIM4_Init();
|
||||
/* USER CODE BEGIN 2 */
|
||||
|
||||
/* USER CODE END 2 */
|
||||
@@ -186,7 +196,7 @@ void SystemClock_Config(void)
|
||||
}
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_ADC;
|
||||
PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV2;
|
||||
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
@@ -334,6 +344,159 @@ static void MX_SPI2_Init(void)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM2 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_TIM2_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM2_Init 0 */
|
||||
|
||||
/* USER CODE END TIM2_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM2_Init 1 */
|
||||
|
||||
/* USER CODE END TIM2_Init 1 */
|
||||
htim2.Instance = TIM2;
|
||||
htim2.Init.Prescaler = 0;
|
||||
htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim2.Init.Period = 0;
|
||||
htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM2_Init 2 */
|
||||
|
||||
/* USER CODE END TIM2_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM3 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_TIM3_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM3_Init 0 */
|
||||
|
||||
/* USER CODE END TIM3_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
TIM_OC_InitTypeDef sConfigOC = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM3_Init 1 */
|
||||
|
||||
/* USER CODE END TIM3_Init 1 */
|
||||
htim3.Instance = TIM3;
|
||||
htim3.Init.Prescaler = 0;
|
||||
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim3.Init.Period = 0;
|
||||
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
if (HAL_TIM_PWM_Init(&htim3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sConfigOC.OCMode = TIM_OCMODE_PWM1;
|
||||
sConfigOC.Pulse = 0;
|
||||
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
|
||||
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim3, &sConfigOC, TIM_CHANNEL_1) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim3, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM3_Init 2 */
|
||||
|
||||
/* USER CODE END TIM3_Init 2 */
|
||||
HAL_TIM_MspPostInit(&htim3);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM4 Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static void MX_TIM4_Init(void)
|
||||
{
|
||||
|
||||
/* USER CODE BEGIN TIM4_Init 0 */
|
||||
|
||||
/* USER CODE END TIM4_Init 0 */
|
||||
|
||||
TIM_ClockConfigTypeDef sClockSourceConfig = {0};
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
|
||||
/* USER CODE BEGIN TIM4_Init 1 */
|
||||
|
||||
/* USER CODE END TIM4_Init 1 */
|
||||
htim4.Instance = TIM4;
|
||||
htim4.Init.Prescaler = 0;
|
||||
htim4.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim4.Init.Period = 0;
|
||||
htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim4.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_Base_Init(&htim4) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
|
||||
if (HAL_TIM_ConfigClockSource(&htim4, &sClockSourceConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim4, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/* USER CODE BEGIN TIM4_Init 2 */
|
||||
|
||||
/* USER CODE END TIM4_Init 2 */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief USART1 Initialization Function
|
||||
* @param None
|
||||
|
||||
@@ -78,7 +78,9 @@
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
/**
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
/**
|
||||
* Initializes the Global MSP.
|
||||
*/
|
||||
void HAL_MspInit(void)
|
||||
@@ -287,6 +289,125 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM_Base MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
* @param htim_base: TIM_Base handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
|
||||
{
|
||||
|
||||
if(htim_base->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM2_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM3_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 0 */
|
||||
/* Peripheral clock enable */
|
||||
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||
/* USER CODE BEGIN TIM4_MspInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
|
||||
{
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
if(htim->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspPostInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspPostInit 0 */
|
||||
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
/**TIM3 GPIO Configuration
|
||||
PC6 ------> TIM3_CH1
|
||||
PC7 ------> TIM3_CH2
|
||||
*/
|
||||
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||
|
||||
__HAL_AFIO_REMAP_TIM3_ENABLE();
|
||||
|
||||
/* USER CODE BEGIN TIM3_MspPostInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspPostInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief TIM_Base MSP De-Initialization
|
||||
* This function freeze the hardware resources used in this example
|
||||
* @param htim_base: TIM_Base handle pointer
|
||||
* @retval None
|
||||
*/
|
||||
|
||||
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||
{
|
||||
|
||||
if(htim_base->Instance==TIM2)
|
||||
{
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM2_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM2_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM3)
|
||||
{
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM3_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM3_MspDeInit 1 */
|
||||
}
|
||||
else if(htim_base->Instance==TIM4)
|
||||
{
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 0 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 0 */
|
||||
/* Peripheral clock disable */
|
||||
__HAL_RCC_TIM4_CLK_DISABLE();
|
||||
/* USER CODE BEGIN TIM4_MspDeInit 1 */
|
||||
|
||||
/* USER CODE END TIM4_MspDeInit 1 */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UART MSP Initialization
|
||||
* This function configures the hardware resources used in this example
|
||||
|
||||
@@ -10,31 +10,39 @@ KeepUserPlacement=false
|
||||
Mcu.Family=STM32F1
|
||||
Mcu.IP0=ADC1
|
||||
Mcu.IP1=IWDG
|
||||
Mcu.IP10=USART1
|
||||
Mcu.IP2=NVIC
|
||||
Mcu.IP3=RCC
|
||||
Mcu.IP4=RTC
|
||||
Mcu.IP5=SPI2
|
||||
Mcu.IP6=SYS
|
||||
Mcu.IP7=USART1
|
||||
Mcu.IPNb=8
|
||||
Mcu.IP7=TIM2
|
||||
Mcu.IP8=TIM3
|
||||
Mcu.IP9=TIM4
|
||||
Mcu.IPNb=11
|
||||
Mcu.Name=STM32F103R(8-B)Tx
|
||||
Mcu.Package=LQFP64
|
||||
Mcu.Pin0=PC14-OSC32_IN
|
||||
Mcu.Pin1=PC15-OSC32_OUT
|
||||
Mcu.Pin10=PA13
|
||||
Mcu.Pin11=PA14
|
||||
Mcu.Pin12=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin13=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin14=VP_SYS_VS_Systick
|
||||
Mcu.Pin10=PA9
|
||||
Mcu.Pin11=PA10
|
||||
Mcu.Pin12=PA13
|
||||
Mcu.Pin13=PA14
|
||||
Mcu.Pin14=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin15=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin16=VP_SYS_VS_Systick
|
||||
Mcu.Pin17=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin18=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin19=VP_TIM4_VS_ClockSourceINT
|
||||
Mcu.Pin2=PD0-OSC_IN
|
||||
Mcu.Pin3=PD1-OSC_OUT
|
||||
Mcu.Pin4=PB1
|
||||
Mcu.Pin5=PB13
|
||||
Mcu.Pin6=PB14
|
||||
Mcu.Pin7=PB15
|
||||
Mcu.Pin8=PA9
|
||||
Mcu.Pin9=PA10
|
||||
Mcu.PinsNb=15
|
||||
Mcu.Pin8=PC6
|
||||
Mcu.Pin9=PC7
|
||||
Mcu.PinsNb=20
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F103RBTx
|
||||
@@ -70,6 +78,10 @@ PC14-OSC32_IN.Mode=LSE-External-Oscillator
|
||||
PC14-OSC32_IN.Signal=RCC_OSC32_IN
|
||||
PC15-OSC32_OUT.Mode=LSE-External-Oscillator
|
||||
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
|
||||
PC6.Locked=true
|
||||
PC6.Signal=S_TIM3_CH1
|
||||
PC7.Locked=true
|
||||
PC7.Signal=S_TIM3_CH2
|
||||
PCC.Checker=false
|
||||
PCC.Line=STM32F103
|
||||
PCC.MCU=STM32F103R(8-B)Tx
|
||||
@@ -109,8 +121,9 @@ ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=MDK-ARM V5
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_SPI2_Init-SPI2-false-HAL-true,5-MX_RTC_Init-RTC-false-HAL-true,6-MX_IWDG_Init-IWDG-false-HAL-true,7-MX_ADC1_Init-ADC1-false-HAL-true
|
||||
RCC.ADCFreqValue=36000000
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_SPI2_Init-SPI2-false-HAL-true,5-MX_RTC_Init-RTC-false-HAL-true,6-MX_IWDG_Init-IWDG-false-HAL-true,7-MX_ADC1_Init-ADC1-false-HAL-true,8-MX_TIM2_Init-TIM2-false-HAL-true,9-MX_TIM3_Init-TIM3-false-HAL-true,10-MX_TIM4_Init-TIM4-false-HAL-true
|
||||
RCC.ADCFreqValue=12000000
|
||||
RCC.ADCPresc=RCC_ADCPCLK2_DIV6
|
||||
RCC.AHBFreq_Value=72000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV2
|
||||
RCC.APB1Freq_Value=36000000
|
||||
@@ -120,7 +133,7 @@ RCC.APB2TimFreq_Value=72000000
|
||||
RCC.FCLKCortexFreq_Value=72000000
|
||||
RCC.FamilyName=M
|
||||
RCC.HCLKFreq_Value=72000000
|
||||
RCC.IPParameters=ADCFreqValue,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtual,RTCClockSelection,RTCFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value
|
||||
RCC.IPParameters=ADCFreqValue,ADCPresc,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtual,RTCClockSelection,RTCFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value
|
||||
RCC.MCOFreq_Value=72000000
|
||||
RCC.PLLCLKFreq_Value=72000000
|
||||
RCC.PLLMCOFreq_Value=36000000
|
||||
@@ -135,11 +148,18 @@ RCC.USBFreq_Value=72000000
|
||||
RCC.VCOOutput2Freq_Value=8000000
|
||||
SH.ADCx_IN9.0=ADC1_IN9,IN9
|
||||
SH.ADCx_IN9.ConfNb=1
|
||||
SH.S_TIM3_CH1.0=TIM3_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM3_CH1.ConfNb=1
|
||||
SH.S_TIM3_CH2.0=TIM3_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM3_CH2.ConfNb=1
|
||||
SPI2.CalculateBaudRate=18.0 MBits/s
|
||||
SPI2.Direction=SPI_DIRECTION_2LINES
|
||||
SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
SPI2.Mode=SPI_MODE_MASTER
|
||||
SPI2.VirtualType=VM_MASTER
|
||||
TIM3.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||
TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM3.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2
|
||||
USART1.IPParameters=VirtualMode
|
||||
USART1.VirtualMode=VM_ASYNC
|
||||
VP_IWDG_VS_IWDG.Mode=IWDG_Activate
|
||||
@@ -148,4 +168,10 @@ VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
|
||||
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM2_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
|
||||
VP_TIM3_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
|
||||
VP_TIM4_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT
|
||||
board=custom
|
||||
|
||||
@@ -54,9 +54,42 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SERIAL
|
||||
default n
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
select RT_USING_HWTIMER
|
||||
if BSP_USING_TIM
|
||||
config BSP_USING_TIM2
|
||||
bool "Enable TIM2"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM3
|
||||
bool "Enable TIM3"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM4
|
||||
bool "Enable TIM4"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable pwm"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM3
|
||||
bool "Enable timer3 output pwm"
|
||||
default n
|
||||
if BSP_USING_PWM3
|
||||
config BSP_USING_PWM3_CH1
|
||||
bool "Enable PWM3 channel1"
|
||||
default n
|
||||
|
||||
config BSP_USING_PWM3_CH2
|
||||
bool "Enable PWM3 channel2"
|
||||
default n
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
@@ -101,7 +134,6 @@ menu "On-chip Peripheral Drivers"
|
||||
config BSP_USING_ADC2
|
||||
bool "Enable ADC2"
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
config BSP_USING_ON_CHIP_FLASH
|
||||
|
||||
@@ -14,13 +14,17 @@ void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE
|
||||
|RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
|
||||
@@ -41,6 +45,13 @@ void SystemClock_Config(void)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_ADC;
|
||||
PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
void MX_GPIO_Init(void)
|
||||
@@ -51,11 +62,4 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||
|
||||
}
|
||||
#ifdef RT_USING_PIN
|
||||
int board_pin_init(void)
|
||||
{
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
return 0;
|
||||
}
|
||||
INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
||||
|
||||
@@ -15,13 +15,6 @@
|
||||
#include <stm32f1xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
/* Board Pin definitions */
|
||||
#define LED0_PIN GET_PIN(C, 0)
|
||||
#define LED1_PIN GET_PIN(C, 1)
|
||||
#endif
|
||||
|
||||
#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
|
||||
#define STM32_FLASH_SIZE (128 * 1024)
|
||||
#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE))
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define RT_TICK_PER_SECOND 1000
|
||||
#define RT_USING_OVERFLOW_CHECK
|
||||
#define RT_USING_HOOK
|
||||
#define RT_USING_IDLE_HOOK
|
||||
#define RT_IDEL_HOOK_LIST_SIZE 4
|
||||
#define IDLE_THREAD_STACK_SIZE 256
|
||||
#define RT_DEBUG
|
||||
@@ -38,6 +39,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M3
|
||||
@@ -148,13 +150,8 @@
|
||||
/* miscellaneous packages */
|
||||
|
||||
|
||||
/* sample package */
|
||||
|
||||
/* samples: kernel and components samples */
|
||||
|
||||
|
||||
/* example package: hello */
|
||||
|
||||
#define SOC_FAMILY_STM32
|
||||
#define SOC_SERIES_STM32F1
|
||||
|
||||
@@ -164,11 +161,14 @@
|
||||
|
||||
/* Onboard Peripheral Drivers */
|
||||
|
||||
/* Offboard Peripheral Drivers */
|
||||
#define BSP_USING_USB_TO_USART
|
||||
|
||||
/* On-chip Peripheral Drivers */
|
||||
|
||||
#define BSP_USING_GPIO
|
||||
#define BSP_USING_UART1
|
||||
|
||||
/* Board extended module Drivers */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
# RT-Thread Kernel
|
||||
#
|
||||
CONFIG_RT_NAME_MAX=8
|
||||
# CONFIG_RT_USING_SMP is not set
|
||||
CONFIG_RT_ALIGN_SIZE=4
|
||||
# CONFIG_RT_THREAD_PRIORITY_8 is not set
|
||||
CONFIG_RT_THREAD_PRIORITY_32=y
|
||||
@@ -15,6 +16,7 @@ CONFIG_RT_THREAD_PRIORITY_MAX=32
|
||||
CONFIG_RT_TICK_PER_SECOND=1000
|
||||
CONFIG_RT_USING_OVERFLOW_CHECK=y
|
||||
CONFIG_RT_USING_HOOK=y
|
||||
CONFIG_RT_USING_IDLE_HOOK=y
|
||||
CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
|
||||
CONFIG_IDLE_THREAD_STACK_SIZE=256
|
||||
# CONFIG_RT_USING_TIMER_SOFT is not set
|
||||
@@ -61,9 +63,11 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M3=y
|
||||
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
|
||||
|
||||
#
|
||||
# RT-Thread Components
|
||||
@@ -114,10 +118,12 @@ CONFIG_RT_SERIAL_USING_DMA=y
|
||||
# CONFIG_RT_USING_CPUTIME is not set
|
||||
# CONFIG_RT_USING_I2C is not set
|
||||
CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_ADC is not set
|
||||
# CONFIG_RT_USING_PWM is not set
|
||||
# CONFIG_RT_USING_MTD_NOR is not set
|
||||
# CONFIG_RT_USING_MTD_NAND is not set
|
||||
# CONFIG_RT_USING_MTD is not set
|
||||
# CONFIG_RT_USING_PM is not set
|
||||
# CONFIG_RT_USING_RTC is not set
|
||||
# CONFIG_RT_USING_SDIO is not set
|
||||
# CONFIG_RT_USING_SPI is not set
|
||||
@@ -175,12 +181,15 @@ CONFIG_RT_USING_LIBC=y
|
||||
#
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -247,7 +256,6 @@ CONFIG_RT_USING_LIBC=y
|
||||
#
|
||||
# CONFIG_PKG_USING_OPENMV is not set
|
||||
# CONFIG_PKG_USING_MUPDF is not set
|
||||
# CONFIG_PKG_USING_BEEPPLAYER is not set
|
||||
|
||||
#
|
||||
# tools packages
|
||||
@@ -274,6 +282,7 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -288,6 +297,7 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_BUTTON is not set
|
||||
# CONFIG_PKG_USING_MPU6XXX is not set
|
||||
# CONFIG_PKG_USING_PCF8574 is not set
|
||||
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
@@ -303,10 +313,6 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_DSTR is not set
|
||||
# CONFIG_PKG_USING_TINYFRAME is not set
|
||||
|
||||
#
|
||||
# sample package
|
||||
#
|
||||
|
||||
#
|
||||
# samples: kernel and components samples
|
||||
#
|
||||
@@ -314,10 +320,6 @@ CONFIG_RT_USING_LIBC=y
|
||||
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
|
||||
|
||||
#
|
||||
# example package: hello
|
||||
#
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
CONFIG_SOC_FAMILY_STM32=y
|
||||
CONFIG_SOC_SERIES_STM32F1=y
|
||||
@@ -330,10 +332,13 @@ CONFIG_SOC_STM32F103ZE=y
|
||||
#
|
||||
# Onboard Peripheral Drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Offboard Peripheral Drivers
|
||||
#
|
||||
CONFIG_BSP_USING_USB_TO_USART=y
|
||||
# CONFIG_BSP_USING_RS485_OR_RS232 is not set
|
||||
# CONFIG_BSP_USING_SPI_FLASH is not set
|
||||
# CONFIG_BSP_USING_POT is not set
|
||||
# CONFIG_BSP_USING_EEPROM is not set
|
||||
# CONFIG_BSP_USING_ETH is not set
|
||||
# CONFIG_BSP_USING_SDCARD is not set
|
||||
|
||||
#
|
||||
# On-chip Peripheral Drivers
|
||||
@@ -343,8 +348,18 @@ CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_USING_UART2 is not set
|
||||
# CONFIG_BSP_USING_UART3 is not set
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_USING_SPI2 is not set
|
||||
# CONFIG_BSP_USING_SPI3 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
# CONFIG_BSP_USING_TIM is not set
|
||||
# CONFIG_BSP_USING_ADC is not set
|
||||
# CONFIG_BSP_USING_ONCHIP_RTC is not set
|
||||
# CONFIG_BSP_USING_WDT is not set
|
||||
# CONFIG_BSP_USING_SDIO is not set
|
||||
|
||||
#
|
||||
# Board extended module Drivers
|
||||
#
|
||||
|
||||
@@ -11,14 +11,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PF7 */
|
||||
#define LED0_PIN GET_PIN(F, 7)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED0_PIN, !rt_pin_read(LED0_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -70,6 +70,8 @@ extern "C" {
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
|
||||
@@ -72,13 +72,13 @@
|
||||
/*#define HAL_PWR_MODULE_ENABLED */
|
||||
/*#define HAL_RCC_MODULE_ENABLED */
|
||||
#define HAL_RTC_MODULE_ENABLED
|
||||
/*#define HAL_SD_MODULE_ENABLED */
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
/*#define HAL_MMC_MODULE_ENABLED */
|
||||
/*#define HAL_SDRAM_MODULE_ENABLED */
|
||||
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||
/*#define HAL_TIM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
/*#define HAL_USART_MODULE_ENABLED */
|
||||
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -10,41 +10,59 @@ KeepUserPlacement=false
|
||||
Mcu.Family=STM32F1
|
||||
Mcu.IP0=ADC1
|
||||
Mcu.IP1=IWDG
|
||||
Mcu.IP10=USART3
|
||||
Mcu.IP10=TIM3
|
||||
Mcu.IP11=TIM4
|
||||
Mcu.IP12=TIM5
|
||||
Mcu.IP13=USART1
|
||||
Mcu.IP14=USART2
|
||||
Mcu.IP15=USART3
|
||||
Mcu.IP2=NVIC
|
||||
Mcu.IP3=RCC
|
||||
Mcu.IP4=RTC
|
||||
Mcu.IP5=SPI1
|
||||
Mcu.IP6=SPI2
|
||||
Mcu.IP7=SYS
|
||||
Mcu.IP8=USART1
|
||||
Mcu.IP9=USART2
|
||||
Mcu.IPNb=11
|
||||
Mcu.IP5=SDIO
|
||||
Mcu.IP6=SPI1
|
||||
Mcu.IP7=SPI2
|
||||
Mcu.IP8=SYS
|
||||
Mcu.IP9=TIM2
|
||||
Mcu.IPNb=16
|
||||
Mcu.Name=STM32F103Z(C-D-E)Tx
|
||||
Mcu.Package=LQFP144
|
||||
Mcu.Pin0=PC14-OSC32_IN
|
||||
Mcu.Pin1=PC15-OSC32_OUT
|
||||
Mcu.Pin10=PB10
|
||||
Mcu.Pin11=PB11
|
||||
Mcu.Pin12=PB13
|
||||
Mcu.Pin13=PB14
|
||||
Mcu.Pin14=PB15
|
||||
Mcu.Pin15=PA9
|
||||
Mcu.Pin16=PA10
|
||||
Mcu.Pin17=PA13
|
||||
Mcu.Pin18=PA14
|
||||
Mcu.Pin19=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin10=PB0
|
||||
Mcu.Pin11=PB1
|
||||
Mcu.Pin12=PB10
|
||||
Mcu.Pin13=PB11
|
||||
Mcu.Pin14=PB13
|
||||
Mcu.Pin15=PB14
|
||||
Mcu.Pin16=PB15
|
||||
Mcu.Pin17=PC8
|
||||
Mcu.Pin18=PC9
|
||||
Mcu.Pin19=PA9
|
||||
Mcu.Pin2=OSC_IN
|
||||
Mcu.Pin20=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin21=VP_SYS_VS_Systick
|
||||
Mcu.Pin20=PA10
|
||||
Mcu.Pin21=PA13
|
||||
Mcu.Pin22=PA14
|
||||
Mcu.Pin23=PC10
|
||||
Mcu.Pin24=PC11
|
||||
Mcu.Pin25=PC12
|
||||
Mcu.Pin26=PD2
|
||||
Mcu.Pin27=PB5
|
||||
Mcu.Pin28=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin29=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin3=OSC_OUT
|
||||
Mcu.Pin30=VP_SYS_VS_Systick
|
||||
Mcu.Pin31=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin32=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin33=VP_TIM4_VS_ClockSourceINT
|
||||
Mcu.Pin34=VP_TIM5_VS_ClockSourceINT
|
||||
Mcu.Pin4=PC1
|
||||
Mcu.Pin5=PA2
|
||||
Mcu.Pin6=PA3
|
||||
Mcu.Pin7=PA5
|
||||
Mcu.Pin8=PA6
|
||||
Mcu.Pin9=PA7
|
||||
Mcu.PinsNb=22
|
||||
Mcu.PinsNb=35
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F103ZETx
|
||||
@@ -83,6 +101,8 @@ PA7.Mode=Full_Duplex_Master
|
||||
PA7.Signal=SPI1_MOSI
|
||||
PA9.Mode=Asynchronous
|
||||
PA9.Signal=USART1_TX
|
||||
PB0.Signal=S_TIM3_CH3
|
||||
PB1.Signal=S_TIM3_CH4
|
||||
PB10.Mode=Asynchronous
|
||||
PB10.Signal=USART3_TX
|
||||
PB11.Mode=Asynchronous
|
||||
@@ -93,12 +113,23 @@ PB14.Mode=Full_Duplex_Master
|
||||
PB14.Signal=SPI2_MISO
|
||||
PB15.Mode=Full_Duplex_Master
|
||||
PB15.Signal=SPI2_MOSI
|
||||
PB5.Signal=S_TIM3_CH2
|
||||
PC1.Locked=true
|
||||
PC1.Signal=ADCx_IN11
|
||||
PC10.Mode=SD_4_bits_Wide_bus
|
||||
PC10.Signal=SDIO_D2
|
||||
PC11.Mode=SD_4_bits_Wide_bus
|
||||
PC11.Signal=SDIO_D3
|
||||
PC12.Mode=SD_4_bits_Wide_bus
|
||||
PC12.Signal=SDIO_CK
|
||||
PC14-OSC32_IN.Mode=LSE-External-Oscillator
|
||||
PC14-OSC32_IN.Signal=RCC_OSC32_IN
|
||||
PC15-OSC32_OUT.Mode=LSE-External-Oscillator
|
||||
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
|
||||
PC8.Mode=SD_4_bits_Wide_bus
|
||||
PC8.Signal=SDIO_D0
|
||||
PC9.Mode=SD_4_bits_Wide_bus
|
||||
PC9.Signal=SDIO_D1
|
||||
PCC.Checker=false
|
||||
PCC.Line=STM32F103
|
||||
PCC.MCU=STM32F103Z(C-D-E)Tx
|
||||
@@ -107,6 +138,8 @@ PCC.Seq0=0
|
||||
PCC.Series=STM32F1
|
||||
PCC.Temperature=25
|
||||
PCC.Vdd=3.3
|
||||
PD2.Mode=SD_4_bits_Wide_bus
|
||||
PD2.Signal=SDIO_CMD
|
||||
PinOutPanel.RotationAngle=0
|
||||
ProjectManager.AskForMigrate=true
|
||||
ProjectManager.BackupPrevious=false
|
||||
@@ -134,7 +167,7 @@ ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=MDK-ARM V5
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_SPI2_Init-SPI2-false-HAL-true,5-MX_USART2_UART_Init-USART2-false-HAL-true,6-MX_SPI1_Init-SPI1-false-HAL-true,7-MX_USART3_UART_Init-USART3-false-HAL-true,8-MX_ADC1_Init-ADC1-false-HAL-true,9-MX_RTC_Init-RTC-false-HAL-true,10-MX_IWDG_Init-IWDG-false-HAL-true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_SPI2_Init-SPI2-false-HAL-true,5-MX_USART2_UART_Init-USART2-false-HAL-true,6-MX_SPI1_Init-SPI1-false-HAL-true,7-MX_USART3_UART_Init-USART3-false-HAL-true,8-MX_ADC1_Init-ADC1-false-HAL-true,9-MX_RTC_Init-RTC-false-HAL-true,10-MX_IWDG_Init-IWDG-false-HAL-true,11-MX_TIM2_Init-TIM2-false-HAL-true,12-MX_TIM3_Init-TIM3-false-HAL-true,13-MX_TIM4_Init-TIM4-false-HAL-true,14-MX_TIM5_Init-TIM5-false-HAL-true,15-MX_SDIO_SD_Init-SDIO-false-HAL-true
|
||||
RCC.ADCFreqValue=12000000
|
||||
RCC.ADCPresc=RCC_ADCPCLK2_DIV6
|
||||
RCC.AHBFreq_Value=72000000
|
||||
@@ -166,6 +199,12 @@ RCC.USBFreq_Value=72000000
|
||||
RCC.VCOOutput2Freq_Value=8000000
|
||||
SH.ADCx_IN11.0=ADC1_IN11,IN11
|
||||
SH.ADCx_IN11.ConfNb=1
|
||||
SH.S_TIM3_CH2.0=TIM3_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM3_CH2.ConfNb=1
|
||||
SH.S_TIM3_CH3.0=TIM3_CH3,PWM Generation3 CH3
|
||||
SH.S_TIM3_CH3.ConfNb=1
|
||||
SH.S_TIM3_CH4.0=TIM3_CH4,PWM Generation4 CH4
|
||||
SH.S_TIM3_CH4.ConfNb=1
|
||||
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
|
||||
SPI1.CalculateBaudRate=18.0 MBits/s
|
||||
SPI1.Direction=SPI_DIRECTION_2LINES
|
||||
@@ -177,6 +216,10 @@ SPI2.Direction=SPI_DIRECTION_2LINES
|
||||
SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
SPI2.Mode=SPI_MODE_MASTER
|
||||
SPI2.VirtualType=VM_MASTER
|
||||
TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM3.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||
TIM3.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
|
||||
TIM3.IPParameters=Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4
|
||||
USART1.IPParameters=VirtualMode
|
||||
USART1.VirtualMode=VM_ASYNC
|
||||
USART2.IPParameters=VirtualMode
|
||||
@@ -189,4 +232,12 @@ VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
|
||||
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM2_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
|
||||
VP_TIM3_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
|
||||
VP_TIM4_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT
|
||||
VP_TIM5_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM5_VS_ClockSourceINT.Signal=TIM5_VS_ClockSourceINT
|
||||
board=custom
|
||||
|
||||
@@ -24,6 +24,16 @@ menu "Onboard Peripheral Drivers"
|
||||
select RT_SFUD_USING_SFDP
|
||||
default n
|
||||
|
||||
config BSP_USING_RGB
|
||||
bool "Enable RGB LED (timer3 channel2 - 4)"
|
||||
select RT_USING_PWM
|
||||
select BSP_USING_PWM
|
||||
select BSP_USING_PWM3
|
||||
select BSP_USING_PWM3_CH2
|
||||
select BSP_USING_PWM3_CH3
|
||||
select BSP_USING_PWM3_CH4
|
||||
default n
|
||||
|
||||
config BSP_USING_POT
|
||||
bool "Enable potentiometer"
|
||||
select BSP_USING_ADC
|
||||
@@ -63,6 +73,13 @@ menu "Onboard Peripheral Drivers"
|
||||
|
||||
endif
|
||||
|
||||
config BSP_USING_SDCARD
|
||||
bool "Enable SDCARD (sdio)"
|
||||
select BSP_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
select RT_USING_DFS_ELMFAT
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
@@ -86,10 +103,6 @@ menu "On-chip Peripheral Drivers"
|
||||
bool "Enable UART3"
|
||||
select RT_USING_SERIAL
|
||||
default n
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default n
|
||||
|
||||
config BSP_USING_ON_CHIP_FLASH
|
||||
bool "Enable on-chip FLASH"
|
||||
@@ -131,6 +144,51 @@ menu "On-chip Peripheral Drivers"
|
||||
default 23
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
select RT_USING_HWTIMER
|
||||
if BSP_USING_TIM
|
||||
config BSP_USING_TIM2
|
||||
bool "Enable TIM2"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM3
|
||||
bool "Enable TIM3"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM4
|
||||
bool "Enable TIM4"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM5
|
||||
bool "Enable TIM5"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable pwm"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM3
|
||||
bool "Enable timer3 output pwm"
|
||||
default n
|
||||
if BSP_USING_PWM3
|
||||
config BSP_USING_PWM3_CH2
|
||||
bool "Enable PWM3 channel2"
|
||||
default n
|
||||
|
||||
config BSP_USING_PWM3_CH3
|
||||
bool "Enable PWM3 channel3"
|
||||
default n
|
||||
|
||||
config BSP_USING_PWM3_CH4
|
||||
bool "Enable PWM3 channel4"
|
||||
default n
|
||||
endif
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ADC
|
||||
bool "Enable ADC"
|
||||
default n
|
||||
@@ -160,6 +218,12 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_WDT
|
||||
default n
|
||||
|
||||
config BSP_USING_SDIO
|
||||
bool "Enable SDIO"
|
||||
select RT_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
@@ -18,6 +18,9 @@ if GetDepend(['BSP_USING_ETH']):
|
||||
if GetDepend(['BSP_USING_SPI_FLASH']):
|
||||
src += Glob('ports/spi_flash_init.c')
|
||||
|
||||
if GetDepend(['BSP_USING_SDCARD']):
|
||||
src += Glob('ports/sdcard_port.c')
|
||||
|
||||
path = [cwd]
|
||||
path += [cwd + '/CubeMX_Config/Inc']
|
||||
path += [cwd + '/ports']
|
||||
|
||||
@@ -13,31 +13,46 @@
|
||||
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
rt_err_t ret = RT_EOK;
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = 16;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16;
|
||||
ret = HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||
RT_ASSERT(ret == HAL_OK);
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE
|
||||
|RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |
|
||||
RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||
ret = HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);
|
||||
RT_ASSERT(ret == HAL_OK);
|
||||
|
||||
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/RT_TICK_PER_SECOND);
|
||||
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
|
||||
HAL_NVIC_SetPriority(SysTick_IRQn, 15, 0);
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_ADC;
|
||||
PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
||||
|
||||
void MX_GPIO_Init(void)
|
||||
@@ -48,14 +63,3 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
}
|
||||
|
||||
#ifdef RT_USING_PIN
|
||||
int board_pin_init(void)
|
||||
{
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
||||
@@ -15,13 +15,6 @@
|
||||
#include <stm32f1xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
/* Board Pin definitions */
|
||||
#define LED0_PIN GET_PIN(F, 7)
|
||||
#define LED1_PIN GET_PIN(F, 8)
|
||||
#endif
|
||||
|
||||
/* Internal SRAM memory size[Kbytes] <8-64>, Default: 64*/
|
||||
#define STM32_SRAM_SIZE 64
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 balanceTWK add sdcard port file
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef BSP_USING_SDCARD
|
||||
|
||||
#include <dfs_elm.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_posix.h>
|
||||
|
||||
#define DBG_ENABLE
|
||||
#define DBG_SECTION_NAME "app.card"
|
||||
#define DBG_COLOR
|
||||
|
||||
#define DBG_LEVEL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
void sd_mount(void *parameter)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
rt_thread_mdelay(500);
|
||||
if(rt_device_find("sd0") != RT_NULL)
|
||||
{
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
|
||||
{
|
||||
LOG_I("sd card mount to '/'");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_W("sd card mount to '/' failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int stm32_sdcard_mount(void)
|
||||
{
|
||||
rt_thread_t tid;
|
||||
|
||||
tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
|
||||
1024, RT_THREAD_PRIORITY_MAX - 2, 20);
|
||||
if (tid != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(tid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("create sd_mount thread err!");
|
||||
}
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_APP_EXPORT(stm32_sdcard_mount);
|
||||
|
||||
#endif /* BSP_USING_SDCARD */
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define RT_TICK_PER_SECOND 1000
|
||||
#define RT_USING_OVERFLOW_CHECK
|
||||
#define RT_USING_HOOK
|
||||
#define RT_USING_IDLE_HOOK
|
||||
#define RT_IDEL_HOOK_LIST_SIZE 4
|
||||
#define IDLE_THREAD_STACK_SIZE 256
|
||||
#define RT_DEBUG
|
||||
@@ -38,6 +39,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M3
|
||||
@@ -149,13 +151,8 @@
|
||||
/* miscellaneous packages */
|
||||
|
||||
|
||||
/* sample package */
|
||||
|
||||
/* samples: kernel and components samples */
|
||||
|
||||
|
||||
/* example package: hello */
|
||||
|
||||
#define SOC_FAMILY_STM32
|
||||
#define SOC_SERIES_STM32F1
|
||||
|
||||
@@ -165,11 +162,14 @@
|
||||
|
||||
/* Onboard Peripheral Drivers */
|
||||
|
||||
/* Offboard Peripheral Drivers */
|
||||
#define BSP_USING_USB_TO_USART
|
||||
|
||||
/* On-chip Peripheral Drivers */
|
||||
|
||||
#define BSP_USING_GPIO
|
||||
#define BSP_USING_UART1
|
||||
|
||||
/* Board extended module Drivers */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M4=y
|
||||
@@ -180,12 +181,14 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -294,6 +297,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_BUTTON is not set
|
||||
# CONFIG_PKG_USING_MPU6XXX is not set
|
||||
# CONFIG_PKG_USING_PCF8574 is not set
|
||||
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
@@ -309,10 +313,6 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_DSTR is not set
|
||||
# CONFIG_PKG_USING_TINYFRAME is not set
|
||||
|
||||
#
|
||||
# sample package
|
||||
#
|
||||
|
||||
#
|
||||
# samples: kernel and components samples
|
||||
#
|
||||
@@ -320,10 +320,6 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
|
||||
|
||||
#
|
||||
# example package: hello
|
||||
#
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
CONFIG_SOC_FAMILY_STM32=y
|
||||
CONFIG_SOC_SERIES_STM32F4=y
|
||||
@@ -342,6 +338,7 @@ CONFIG_BSP_USING_USB_TO_USART=y
|
||||
# CONFIG_BSP_USING_EEPROM is not set
|
||||
# CONFIG_BSP_USING_ETH is not set
|
||||
# CONFIG_BSP_USING_MPU6050 is not set
|
||||
# CONFIG_BSP_USING_SDCARD is not set
|
||||
|
||||
#
|
||||
# On-chip Peripheral Drivers
|
||||
@@ -351,12 +348,18 @@ CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_USING_UART2 is not set
|
||||
# CONFIG_BSP_USING_UART3 is not set
|
||||
# CONFIG_BSP_USING_UART6 is not set
|
||||
# CONFIG_BSP_USING_TIM is not set
|
||||
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_USING_SPI2 is not set
|
||||
# CONFIG_BSP_USING_SPI3 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_ADC is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
# CONFIG_BSP_USING_ONCHIP_RTC is not set
|
||||
# CONFIG_BSP_USING_WDT is not set
|
||||
# CONFIG_BSP_USING_SDIO is not set
|
||||
|
||||
#
|
||||
# Board extended module Drivers
|
||||
|
||||
@@ -12,14 +12,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PF9 */
|
||||
#define LED0_PIN GET_PIN(F, 9)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED1_PIN, !rt_pin_read(LED1_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -70,6 +70,8 @@ extern "C" {
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
/* #define HAL_RNG_MODULE_ENABLED */
|
||||
#define HAL_RTC_MODULE_ENABLED
|
||||
/* #define HAL_SAI_MODULE_ENABLED */
|
||||
/* #define HAL_SD_MODULE_ENABLED */
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
/* #define HAL_MMC_MODULE_ENABLED */
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
/* #define HAL_TIM_MODULE_ENABLED */
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
/* #define HAL_USART_MODULE_ENABLED */
|
||||
/* #define HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -45,6 +45,13 @@ menu "Onboard Peripheral Drivers"
|
||||
select BSP_USING_I2C1
|
||||
select PKG_USING_MPU6XXX
|
||||
|
||||
config BSP_USING_SDCARD
|
||||
bool "Enable SDCARD (sdio)"
|
||||
select BSP_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
select RT_USING_DFS_ELMFAT
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
@@ -73,15 +80,44 @@ menu "On-chip Peripheral Drivers"
|
||||
bool "Enable UART6"
|
||||
select RT_USING_SERIAL
|
||||
default n
|
||||
|
||||
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
select RT_USING_HWTIMER
|
||||
if BSP_USING_TIM
|
||||
config BSP_USING_TIM11
|
||||
bool "Enable TIM11"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM13
|
||||
bool "Enable TIM13"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM14
|
||||
bool "Enable TIM14"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable pwm"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM2
|
||||
bool "Enable timer2 output pwm"
|
||||
default n
|
||||
if BSP_USING_PWM2
|
||||
config BSP_USING_PWM2_CH4
|
||||
bool "Enable PWM2 channel4"
|
||||
default n
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_ON_CHIP_FLASH
|
||||
bool "Enable on-chip FLASH"
|
||||
default n
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default n
|
||||
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
select RT_USING_SPI
|
||||
@@ -92,11 +128,6 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SPI
|
||||
default n
|
||||
|
||||
config BSP_USING_SPI3
|
||||
bool "Enable SPI3 BUS"
|
||||
select RT_USING_SPI
|
||||
default n
|
||||
|
||||
config BSP_SPI_USING_DMA
|
||||
bool "Enable SPI DMA support"
|
||||
default n
|
||||
@@ -147,6 +178,12 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_WDT
|
||||
default n
|
||||
|
||||
config BSP_USING_SDIO
|
||||
bool "Enable SDIO"
|
||||
select RT_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
@@ -18,6 +18,9 @@ if GetDepend(['BSP_USING_ETH']):
|
||||
if GetDepend(['BSP_USING_SPI_FLASH']):
|
||||
src += Glob('ports/spi_flash_init.c')
|
||||
|
||||
if GetDepend(['BSP_USING_SDCARD']):
|
||||
src += Glob('ports/sdcard_port.c')
|
||||
|
||||
path = [cwd]
|
||||
path += [cwd + '/CubeMX_Config/Inc']
|
||||
path += [cwd + '/ports']
|
||||
|
||||
@@ -12,34 +12,33 @@
|
||||
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
|
||||
/**Configure the main internal regulator output voltage
|
||||
*/
|
||||
/**Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||
RCC_OscInitStruct.HSICalibrationValue = 16;
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE
|
||||
|RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = 8;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
RCC_OscInitStruct.PLL.PLLN = 168;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 4;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 7;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
_Error_Handler(__FILE__, __LINE__);
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
@@ -49,19 +48,14 @@ void SystemClock_Config(void)
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
|
||||
{
|
||||
_Error_Handler(__FILE__, __LINE__);
|
||||
Error_Handler();
|
||||
}
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/**Configure the Systick interrupt time
|
||||
*/
|
||||
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);
|
||||
|
||||
/**Configure the Systick
|
||||
*/
|
||||
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
|
||||
|
||||
/* SysTick_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
|
||||
}
|
||||
void MX_GPIO_Init(void)
|
||||
{
|
||||
@@ -73,14 +67,3 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||
|
||||
}
|
||||
|
||||
#ifdef RT_USING_PIN
|
||||
int board_pin_init(void)
|
||||
{
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
||||
@@ -15,13 +15,6 @@
|
||||
#include <stm32f4xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
/* Board Pin definitions */
|
||||
#define LED0_PIN GET_PIN(F, 9)
|
||||
#define LED1_PIN GET_PIN(F, 10)
|
||||
#endif
|
||||
|
||||
#define STM32_SRAM_SIZE (128)
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 balanceTWK add sdcard port file
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef BSP_USING_SDCARD
|
||||
|
||||
#include <dfs_elm.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_posix.h>
|
||||
|
||||
#define DBG_ENABLE
|
||||
#define DBG_SECTION_NAME "app.card"
|
||||
#define DBG_COLOR
|
||||
|
||||
#define DBG_LEVEL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
void sd_mount(void *parameter)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
rt_thread_mdelay(500);
|
||||
if(rt_device_find("sd0") != RT_NULL)
|
||||
{
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
|
||||
{
|
||||
LOG_I("sd card mount to '/'");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_W("sd card mount to '/' failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int stm32_sdcard_mount(void)
|
||||
{
|
||||
rt_thread_t tid;
|
||||
|
||||
tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
|
||||
1024, RT_THREAD_PRIORITY_MAX - 2, 20);
|
||||
if (tid != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(tid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("create sd_mount thread err!");
|
||||
}
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_APP_EXPORT(stm32_sdcard_mount);
|
||||
|
||||
#endif /* BSP_USING_SDCARD */
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M4
|
||||
@@ -148,16 +149,8 @@
|
||||
/* miscellaneous packages */
|
||||
|
||||
|
||||
/* sample package */
|
||||
|
||||
/* samples: kernel and components samples */
|
||||
|
||||
|
||||
/* example package: hello */
|
||||
|
||||
|
||||
/* rtpkgs online packages */
|
||||
|
||||
#define SOC_FAMILY_STM32
|
||||
#define SOC_SERIES_STM32F4
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M4=y
|
||||
@@ -180,12 +181,14 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -279,6 +282,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -293,6 +297,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_BUTTON is not set
|
||||
# CONFIG_PKG_USING_MPU6XXX is not set
|
||||
# CONFIG_PKG_USING_PCF8574 is not set
|
||||
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
@@ -308,10 +313,6 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_DSTR is not set
|
||||
# CONFIG_PKG_USING_TINYFRAME is not set
|
||||
|
||||
#
|
||||
# sample package
|
||||
#
|
||||
|
||||
#
|
||||
# samples: kernel and components samples
|
||||
#
|
||||
@@ -319,30 +320,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
|
||||
|
||||
#
|
||||
# example package: hello
|
||||
#
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
|
||||
#
|
||||
# Privated Packages of RealThread
|
||||
#
|
||||
# CONFIG_PKG_USING_CODEC is not set
|
||||
# CONFIG_PKG_USING_PLAYER is not set
|
||||
# CONFIG_PKG_USING_PERSIMMON_SRC is not set
|
||||
|
||||
#
|
||||
# Network Utilities
|
||||
#
|
||||
# CONFIG_PKG_USING_WICED is not set
|
||||
# CONFIG_PKG_USING_CLOUDSDK is not set
|
||||
# CONFIG_PKG_USING_COREMARK is not set
|
||||
# CONFIG_PKG_USING_POWER_MANAGER is not set
|
||||
# CONFIG_PKG_USING_RT_OTA is not set
|
||||
# CONFIG_PKG_USING_RDBD_SRC is not set
|
||||
# CONFIG_PKG_USING_RTINSIGHT is not set
|
||||
# CONFIG_PKG_USING_SMARTCONFIG is not set
|
||||
CONFIG_SOC_FAMILY_STM32=y
|
||||
CONFIG_SOC_SERIES_STM32F4=y
|
||||
|
||||
@@ -361,6 +339,7 @@ CONFIG_BSP_USING_USB_TO_USART=y
|
||||
# CONFIG_BSP_USING_SPI_FLASH is not set
|
||||
# CONFIG_BSP_USING_MPU9250 is not set
|
||||
# CONFIG_BSP_USING_ETH is not set
|
||||
# CONFIG_BSP_USING_SDCARD is not set
|
||||
|
||||
#
|
||||
# On-chip Peripheral Drivers
|
||||
@@ -370,11 +349,17 @@ CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_USING_UART2 is not set
|
||||
# CONFIG_BSP_USING_UART3 is not set
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_USING_SPI2 is not set
|
||||
# CONFIG_BSP_USING_SPI5 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
# CONFIG_BSP_USING_TIM is not set
|
||||
# CONFIG_BSP_USING_ADC is not set
|
||||
# CONFIG_BSP_USING_ONCHIP_RTC is not set
|
||||
# CONFIG_BSP_USING_WDT is not set
|
||||
# CONFIG_BSP_USING_SDIO is not set
|
||||
|
||||
#
|
||||
# Board extended module Drivers
|
||||
|
||||
@@ -11,14 +11,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PB1 */
|
||||
#define LED0_PIN GET_PIN(B, 1)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED1_PIN, !rt_pin_read(LED1_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -70,6 +70,8 @@ extern "C" {
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
/* #define HAL_RNG_MODULE_ENABLED */
|
||||
#define HAL_RTC_MODULE_ENABLED
|
||||
/* #define HAL_SAI_MODULE_ENABLED */
|
||||
/* #define HAL_SD_MODULE_ENABLED */
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
/* #define HAL_MMC_MODULE_ENABLED */
|
||||
/* #define HAL_SPI_MODULE_ENABLED */
|
||||
/* #define HAL_TIM_MODULE_ENABLED */
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
/* #define HAL_USART_MODULE_ENABLED */
|
||||
/* #define HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@ menu "Onboard Peripheral Drivers"
|
||||
bool "Enable COM2 (uart2 pin conflict with Ethernet)"
|
||||
select BSP_USING_UART2
|
||||
default n
|
||||
|
||||
|
||||
config BSP_USING_COM3
|
||||
bool "Enable COM3 (uart3)"
|
||||
select BSP_USING_UART3
|
||||
@@ -32,7 +32,7 @@ menu "Onboard Peripheral Drivers"
|
||||
select RT_USING_SFUD
|
||||
select RT_SFUD_USING_SFDP
|
||||
default n
|
||||
|
||||
|
||||
config BSP_USING_MPU9250
|
||||
bool "Enable MPU 9250 (i2c1)"
|
||||
select BSP_USING_I2C1
|
||||
@@ -50,7 +50,14 @@ menu "Onboard Peripheral Drivers"
|
||||
hex
|
||||
default 0x00
|
||||
endif
|
||||
|
||||
|
||||
config BSP_USING_SDCARD
|
||||
bool "Enable SDCARD (sdio)"
|
||||
select BSP_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
select RT_USING_DFS_ELMFAT
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
@@ -75,10 +82,6 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_SERIAL
|
||||
default n
|
||||
|
||||
config BSP_UART_USING_DMA_RX
|
||||
bool "Enable UART RX DMA support"
|
||||
default y
|
||||
|
||||
config BSP_USING_ON_CHIP_FLASH
|
||||
bool "Enable on-chip FLASH"
|
||||
default n
|
||||
@@ -120,6 +123,39 @@ menu "On-chip Peripheral Drivers"
|
||||
default 117
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
select RT_USING_HWTIMER
|
||||
if BSP_USING_TIM
|
||||
config BSP_USING_TIM11
|
||||
bool "Enable TIM11"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM13
|
||||
bool "Enable TIM13"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM14
|
||||
bool "Enable TIM14"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable pwm"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM2
|
||||
bool "Enable timer2 output pwm"
|
||||
default n
|
||||
if BSP_USING_PWM2
|
||||
config BSP_USING_PWM2_CH4
|
||||
bool "Enable PWM2 channel4"
|
||||
default n
|
||||
endif
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ADC
|
||||
bool "Enable ADC"
|
||||
default n
|
||||
@@ -149,6 +185,12 @@ menu "On-chip Peripheral Drivers"
|
||||
select RT_USING_WDT
|
||||
default n
|
||||
|
||||
config BSP_USING_SDIO
|
||||
bool "Enable SDIO"
|
||||
select RT_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
@@ -18,6 +18,9 @@ if GetDepend(['BSP_USING_ETH']):
|
||||
if GetDepend(['BSP_USING_SPI_FLASH']):
|
||||
src += Glob('ports/spi_flash_init.c')
|
||||
|
||||
if GetDepend(['BSP_USING_SDCARD']):
|
||||
src += Glob('ports/sdcard_port.c')
|
||||
|
||||
path = [cwd]
|
||||
path += [cwd + '/CubeMX_Config/Inc']
|
||||
path += [cwd + '/ports']
|
||||
|
||||
@@ -14,54 +14,56 @@
|
||||
*/
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
||||
|
||||
/**Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE
|
||||
|RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 25;
|
||||
RCC_OscInitStruct.PLL.PLLN = 360;
|
||||
RCC_OscInitStruct.PLL.PLLM = 15;
|
||||
RCC_OscInitStruct.PLL.PLLN = 216;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 8;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
/**Activate the Over-Drive mode
|
||||
*/
|
||||
if (HAL_PWREx_EnableOverDrive() != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIN = 260;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
|
||||
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/RT_TICK_PER_SECOND);
|
||||
|
||||
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
|
||||
|
||||
/* SysTick_IRQn interrupt configuration */
|
||||
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
|
||||
}
|
||||
|
||||
/** Pinout Configuration
|
||||
@@ -75,14 +77,3 @@ void MX_GPIO_Init(void)
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
__HAL_RCC_GPIOG_CLK_ENABLE();
|
||||
}
|
||||
|
||||
#ifdef RT_USING_PIN
|
||||
int board_pin_init(void)
|
||||
{
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_BOARD_EXPORT(board_pin_init);
|
||||
#endif /* RT_USING_PIN */
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
#include <stm32f4xx.h>
|
||||
#include "drv_common.h"
|
||||
|
||||
#ifdef BSP_USING_GPIO
|
||||
#include "drv_gpio.h"
|
||||
#endif
|
||||
|
||||
#define STM32_SRAM_SIZE (192)
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
@@ -39,12 +35,7 @@ extern int __bss_end;
|
||||
|
||||
#define HEAP_END STM32_SRAM_END
|
||||
|
||||
/* Board Pin definitions */
|
||||
#define LED0_PIN GET_PIN(B, 1)
|
||||
#define LED1_PIN GET_PIN(B, 0)
|
||||
|
||||
void SystemClock_Config(void);
|
||||
void MX_GPIO_Init(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 balanceTWK add sdcard port file
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef BSP_USING_SDCARD
|
||||
|
||||
#include <dfs_elm.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_posix.h>
|
||||
|
||||
#define DBG_ENABLE
|
||||
#define DBG_SECTION_NAME "app.card"
|
||||
#define DBG_COLOR
|
||||
|
||||
#define DBG_LEVEL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
void sd_mount(void *parameter)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
rt_thread_mdelay(500);
|
||||
if(rt_device_find("sd0") != RT_NULL)
|
||||
{
|
||||
if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
|
||||
{
|
||||
LOG_I("sd card mount to '/'");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_W("sd card mount to '/' failed!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int stm32_sdcard_mount(void)
|
||||
{
|
||||
rt_thread_t tid;
|
||||
|
||||
tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
|
||||
1024, RT_THREAD_PRIORITY_MAX - 2, 20);
|
||||
if (tid != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(tid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("create sd_mount thread err!");
|
||||
}
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_APP_EXPORT(stm32_sdcard_mount);
|
||||
|
||||
#endif /* BSP_USING_SDCARD */
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x40000
|
||||
#define ARCH_ARM
|
||||
#define ARCH_ARM_CORTEX_M
|
||||
#define ARCH_ARM_CORTEX_M4
|
||||
@@ -148,19 +149,8 @@
|
||||
/* miscellaneous packages */
|
||||
|
||||
|
||||
/* sample package */
|
||||
|
||||
/* samples: kernel and components samples */
|
||||
|
||||
|
||||
/* example package: hello */
|
||||
|
||||
|
||||
/* Privated Packages of RealThread */
|
||||
|
||||
|
||||
/* Network Utilities */
|
||||
|
||||
#define SOC_FAMILY_STM32
|
||||
#define SOC_SERIES_STM32F4
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ CONFIG_RT_USING_DEVICE=y
|
||||
CONFIG_RT_USING_CONSOLE=y
|
||||
CONFIG_RT_CONSOLEBUF_SIZE=128
|
||||
CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
|
||||
CONFIG_RT_VER_NUM=0x40000
|
||||
CONFIG_ARCH_ARM=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M=y
|
||||
CONFIG_ARCH_ARM_CORTEX_M4=y
|
||||
@@ -180,12 +181,14 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_RT_USING_LOGTRACE is not set
|
||||
# CONFIG_RT_USING_RYM is not set
|
||||
# CONFIG_RT_USING_ULOG is not set
|
||||
# CONFIG_RT_USING_UTEST is not set
|
||||
|
||||
#
|
||||
# ARM CMSIS
|
||||
#
|
||||
# CONFIG_RT_USING_CMSIS_OS is not set
|
||||
# CONFIG_RT_USING_RTT_CMSIS is not set
|
||||
# CONFIG_RT_USING_LWP is not set
|
||||
|
||||
#
|
||||
# RT-Thread online packages
|
||||
@@ -279,6 +282,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
|
||||
# CONFIG_PKG_USING_CMSIS is not set
|
||||
# CONFIG_PKG_USING_DFS_YAFFS is not set
|
||||
# CONFIG_PKG_USING_LITTLEFS is not set
|
||||
|
||||
#
|
||||
# peripheral libraries and drivers
|
||||
@@ -293,6 +297,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_BUTTON is not set
|
||||
# CONFIG_PKG_USING_MPU6XXX is not set
|
||||
# CONFIG_PKG_USING_PCF8574 is not set
|
||||
# CONFIG_PKG_USING_KENDRYTE_SDK is not set
|
||||
|
||||
#
|
||||
# miscellaneous packages
|
||||
@@ -308,10 +313,6 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_DSTR is not set
|
||||
# CONFIG_PKG_USING_TINYFRAME is not set
|
||||
|
||||
#
|
||||
# sample package
|
||||
#
|
||||
|
||||
#
|
||||
# samples: kernel and components samples
|
||||
#
|
||||
@@ -319,30 +320,7 @@ CONFIG_RT_USING_PIN=y
|
||||
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
|
||||
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
|
||||
|
||||
#
|
||||
# example package: hello
|
||||
#
|
||||
# CONFIG_PKG_USING_HELLO is not set
|
||||
|
||||
#
|
||||
# Privated Packages of RealThread
|
||||
#
|
||||
# CONFIG_PKG_USING_CODEC is not set
|
||||
# CONFIG_PKG_USING_PLAYER is not set
|
||||
# CONFIG_PKG_USING_PERSIMMON_SRC is not set
|
||||
|
||||
#
|
||||
# Network Utilities
|
||||
#
|
||||
# CONFIG_PKG_USING_WICED is not set
|
||||
# CONFIG_PKG_USING_CLOUDSDK is not set
|
||||
# CONFIG_PKG_USING_COREMARK is not set
|
||||
# CONFIG_PKG_USING_POWER_MANAGER is not set
|
||||
# CONFIG_PKG_USING_RT_OTA is not set
|
||||
# CONFIG_PKG_USING_RDBD_SRC is not set
|
||||
# CONFIG_PKG_USING_RTINSIGHT is not set
|
||||
# CONFIG_PKG_USING_SMARTCONFIG is not set
|
||||
CONFIG_SOC_FAMILY_STM32=y
|
||||
CONFIG_SOC_SERIES_STM32F4=y
|
||||
|
||||
@@ -360,6 +338,8 @@ CONFIG_BSP_USING_USB_TO_USART=y
|
||||
# CONFIG_BSP_USING_SPI_FLASH is not set
|
||||
# CONFIG_BSP_USING_MPU6050 is not set
|
||||
# CONFIG_BSP_USING_ETH is not set
|
||||
# CONFIG_BSP_USING_POT is not set
|
||||
# CONFIG_BSP_USING_SDCARD is not set
|
||||
|
||||
#
|
||||
# On-chip Peripheral Drivers
|
||||
@@ -369,11 +349,17 @@ CONFIG_BSP_USING_UART1=y
|
||||
# CONFIG_BSP_USING_UART2 is not set
|
||||
# CONFIG_BSP_USING_UART3 is not set
|
||||
# CONFIG_BSP_UART_USING_DMA_RX is not set
|
||||
# CONFIG_BSP_USING_ON_CHIP_FLASH is not set
|
||||
# CONFIG_BSP_USING_SPI1 is not set
|
||||
# CONFIG_BSP_USING_SPI2 is not set
|
||||
# CONFIG_BSP_USING_SPI5 is not set
|
||||
# CONFIG_BSP_SPI_USING_DMA is not set
|
||||
# CONFIG_BSP_USING_TIM is not set
|
||||
# CONFIG_BSP_USING_ADC is not set
|
||||
# CONFIG_BSP_USING_I2C1 is not set
|
||||
# CONFIG_BSP_USING_ONCHIP_RTC is not set
|
||||
# CONFIG_BSP_USING_WDT is not set
|
||||
# CONFIG_BSP_USING_SDIO is not set
|
||||
|
||||
#
|
||||
# Board extended module Drivers
|
||||
|
||||
@@ -12,14 +12,23 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_gpio.h"
|
||||
/* defined the LED0 pin: PH10 */
|
||||
#define LED0_PIN GET_PIN(H, 10)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int count = 1;
|
||||
/* set LED0 pin mode to output */
|
||||
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
|
||||
|
||||
while (count++)
|
||||
{
|
||||
rt_pin_write(LED1_PIN, !rt_pin_read(LED1_PIN));
|
||||
rt_pin_write(LED0_PIN, PIN_HIGH);
|
||||
rt_thread_mdelay(500);
|
||||
rt_pin_write(LED0_PIN, PIN_LOW);
|
||||
rt_thread_mdelay(500);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -12,15 +12,20 @@ KeepUserPlacement=false
|
||||
Mcu.Family=STM32F4
|
||||
Mcu.IP0=ADC1
|
||||
Mcu.IP1=ETH
|
||||
Mcu.IP10=TIM5
|
||||
Mcu.IP11=TIM11
|
||||
Mcu.IP12=TIM13
|
||||
Mcu.IP13=TIM14
|
||||
Mcu.IP14=USART1
|
||||
Mcu.IP2=FMC
|
||||
Mcu.IP3=IWDG
|
||||
Mcu.IP4=NVIC
|
||||
Mcu.IP5=RCC
|
||||
Mcu.IP6=RTC
|
||||
Mcu.IP7=SPI5
|
||||
Mcu.IP8=SYS
|
||||
Mcu.IP9=USART1
|
||||
Mcu.IPNb=10
|
||||
Mcu.IP7=SDIO
|
||||
Mcu.IP8=SPI5
|
||||
Mcu.IP9=SYS
|
||||
Mcu.IPNb=15
|
||||
Mcu.Name=STM32F429I(E-G)Tx
|
||||
Mcu.Package=LQFP176
|
||||
Mcu.Pin0=PC14/OSC32_IN
|
||||
@@ -58,34 +63,47 @@ Mcu.Pin37=PB11
|
||||
Mcu.Pin38=PH6
|
||||
Mcu.Pin39=PH7
|
||||
Mcu.Pin4=PF2
|
||||
Mcu.Pin40=PD8
|
||||
Mcu.Pin41=PD9
|
||||
Mcu.Pin42=PD10
|
||||
Mcu.Pin43=PD14
|
||||
Mcu.Pin44=PD15
|
||||
Mcu.Pin45=PG4
|
||||
Mcu.Pin46=PG5
|
||||
Mcu.Pin47=PG8
|
||||
Mcu.Pin48=PA9
|
||||
Mcu.Pin49=PA10
|
||||
Mcu.Pin40=PH10
|
||||
Mcu.Pin41=PH11
|
||||
Mcu.Pin42=PH12
|
||||
Mcu.Pin43=PD8
|
||||
Mcu.Pin44=PD9
|
||||
Mcu.Pin45=PD10
|
||||
Mcu.Pin46=PD14
|
||||
Mcu.Pin47=PD15
|
||||
Mcu.Pin48=PG4
|
||||
Mcu.Pin49=PG5
|
||||
Mcu.Pin5=PF3
|
||||
Mcu.Pin50=PA13
|
||||
Mcu.Pin51=PA14
|
||||
Mcu.Pin52=PD0
|
||||
Mcu.Pin53=PD1
|
||||
Mcu.Pin54=PG13
|
||||
Mcu.Pin55=PG14
|
||||
Mcu.Pin56=PG15
|
||||
Mcu.Pin57=PE0
|
||||
Mcu.Pin58=PE1
|
||||
Mcu.Pin59=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin50=PG8
|
||||
Mcu.Pin51=PC8
|
||||
Mcu.Pin52=PC9
|
||||
Mcu.Pin53=PA9
|
||||
Mcu.Pin54=PA10
|
||||
Mcu.Pin55=PA13
|
||||
Mcu.Pin56=PA14
|
||||
Mcu.Pin57=PC10
|
||||
Mcu.Pin58=PC11
|
||||
Mcu.Pin59=PC12
|
||||
Mcu.Pin6=PF4
|
||||
Mcu.Pin60=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin61=VP_SYS_VS_Systick
|
||||
Mcu.Pin60=PD0
|
||||
Mcu.Pin61=PD1
|
||||
Mcu.Pin62=PD2
|
||||
Mcu.Pin63=PG13
|
||||
Mcu.Pin64=PG14
|
||||
Mcu.Pin65=PG15
|
||||
Mcu.Pin66=PE0
|
||||
Mcu.Pin67=PE1
|
||||
Mcu.Pin68=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin69=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin7=PF5
|
||||
Mcu.Pin70=VP_SYS_VS_Systick
|
||||
Mcu.Pin71=VP_TIM5_VS_ClockSourceINT
|
||||
Mcu.Pin72=VP_TIM11_VS_ClockSourceINT
|
||||
Mcu.Pin73=VP_TIM13_VS_ClockSourceINT
|
||||
Mcu.Pin74=VP_TIM14_VS_ClockSourceINT
|
||||
Mcu.Pin8=PF7
|
||||
Mcu.Pin9=PF8
|
||||
Mcu.PinsNb=62
|
||||
Mcu.PinsNb=75
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F429IGTx
|
||||
@@ -121,6 +139,12 @@ PB11.Signal=ETH_TX_EN
|
||||
PC0.Signal=FMC_SDNWE
|
||||
PC1.Mode=RMII
|
||||
PC1.Signal=ETH_MDC
|
||||
PC10.Mode=SD_4_bits_Wide_bus
|
||||
PC10.Signal=SDIO_D2
|
||||
PC11.Mode=SD_4_bits_Wide_bus
|
||||
PC11.Signal=SDIO_D3
|
||||
PC12.Mode=SD_4_bits_Wide_bus
|
||||
PC12.Signal=SDIO_CK
|
||||
PC14/OSC32_IN.Mode=LSE-External-Oscillator
|
||||
PC14/OSC32_IN.Signal=RCC_OSC32_IN
|
||||
PC15/OSC32_OUT.Mode=LSE-External-Oscillator
|
||||
@@ -131,6 +155,10 @@ PC4.Mode=RMII
|
||||
PC4.Signal=ETH_RXD0
|
||||
PC5.Mode=RMII
|
||||
PC5.Signal=ETH_RXD1
|
||||
PC8.Mode=SD_4_bits_Wide_bus
|
||||
PC8.Signal=SDIO_D0
|
||||
PC9.Mode=SD_4_bits_Wide_bus
|
||||
PC9.Signal=SDIO_D1
|
||||
PCC.Checker=false
|
||||
PCC.Line=STM32F429/439
|
||||
PCC.MCU=STM32F429I(E-G)Tx
|
||||
@@ -144,6 +172,8 @@ PD1.Signal=FMC_D3_DA3
|
||||
PD10.Signal=FMC_D15_DA15
|
||||
PD14.Signal=FMC_D0_DA0
|
||||
PD15.Signal=FMC_D1_DA1
|
||||
PD2.Mode=SD_4_bits_Wide_bus
|
||||
PD2.Signal=SDIO_CMD
|
||||
PD8.Signal=FMC_D13_DA13
|
||||
PD9.Signal=FMC_D14_DA14
|
||||
PE0.Signal=FMC_NBL0
|
||||
@@ -192,6 +222,10 @@ PH0/OSC_IN.Mode=HSE-External-Oscillator
|
||||
PH0/OSC_IN.Signal=RCC_OSC_IN
|
||||
PH1/OSC_OUT.Mode=HSE-External-Oscillator
|
||||
PH1/OSC_OUT.Signal=RCC_OSC_OUT
|
||||
PH10.Locked=true
|
||||
PH10.Signal=S_TIM5_CH1
|
||||
PH11.Signal=S_TIM5_CH2
|
||||
PH12.Signal=S_TIM5_CH3
|
||||
PH6.Mode=SdramChipSelect2_1
|
||||
PH6.Signal=FMC_SDNE1
|
||||
PH7.Mode=SdramChipSelect2_1
|
||||
@@ -223,8 +257,8 @@ ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=MDK-ARM V5
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_ETH_Init-ETH-false-HAL-true,5-MX_SPI5_Init-SPI5-false-HAL-true,6-MX_FMC_Init-FMC-false-HAL-true,7-MX_ADC1_Init-ADC1-false-HAL-true,8-MX_RTC_Init-RTC-false-HAL-true,9-MX_IWDG_Init-IWDG-false-HAL-true
|
||||
RCC.48MHZClocksFreq_Value=90000000
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_ETH_Init-ETH-false-HAL-true,5-MX_SPI5_Init-SPI5-false-HAL-true,6-MX_FMC_Init-FMC-false-HAL-true,7-MX_ADC1_Init-ADC1-false-HAL-true,8-MX_RTC_Init-RTC-false-HAL-true,9-MX_IWDG_Init-IWDG-false-HAL-true,10-MX_TIM14_Init-TIM14-false-HAL-true,11-MX_TIM13_Init-TIM13-false-HAL-true,12-MX_TIM11_Init-TIM11-false-HAL-true,13-MX_SDIO_SD_Init-SDIO-false-HAL-true,14-MX_TIM5_Init-TIM5-false-HAL-true
|
||||
RCC.48MHZClocksFreq_Value=45000000
|
||||
RCC.AHBFreq_Value=180000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||
RCC.APB1Freq_Value=45000000
|
||||
@@ -240,16 +274,18 @@ RCC.HCLKFreq_Value=180000000
|
||||
RCC.HSE_VALUE=25000000
|
||||
RCC.HSI_VALUE=16000000
|
||||
RCC.I2SClocksFreq_Value=160000000
|
||||
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,PLLSourceVirtual,RCC_RTC_Clock_Source,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ
|
||||
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSourceVirtual,RCC_RTC_Clock_Source,RCC_RTC_Clock_SourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ
|
||||
RCC.LCDTFTFreq_Value=20416666.666666668
|
||||
RCC.LSI_VALUE=32000
|
||||
RCC.MCO2PinFreq_Value=180000000
|
||||
RCC.PLLCLKFreq_Value=180000000
|
||||
RCC.PLLM=15
|
||||
RCC.PLLN=216
|
||||
RCC.PLLQCLKFreq_Value=90000000
|
||||
RCC.PLLQ=8
|
||||
RCC.PLLQCLKFreq_Value=45000000
|
||||
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
|
||||
RCC.RCC_RTC_Clock_Source=RCC_RTCCLKSOURCE_LSE
|
||||
RCC.RCC_RTC_Clock_SourceVirtual=RCC_RTCCLKSOURCE_LSE
|
||||
RCC.RTCFreq_Value=32768
|
||||
RCC.RTCHSEDivFreq_Value=12500000
|
||||
RCC.SAI_AClocksFreq_Value=20416666.666666668
|
||||
@@ -338,11 +374,21 @@ SH.FMC_SDNRAS.0=FMC_SDNRAS,12b-sda1
|
||||
SH.FMC_SDNRAS.ConfNb=1
|
||||
SH.FMC_SDNWE.0=FMC_SDNWE,12b-sda1
|
||||
SH.FMC_SDNWE.ConfNb=1
|
||||
SH.S_TIM5_CH1.0=TIM5_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM5_CH1.ConfNb=1
|
||||
SH.S_TIM5_CH2.0=TIM5_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM5_CH2.ConfNb=1
|
||||
SH.S_TIM5_CH3.0=TIM5_CH3,PWM Generation3 CH3
|
||||
SH.S_TIM5_CH3.ConfNb=1
|
||||
SPI5.CalculateBaudRate=45.0 MBits/s
|
||||
SPI5.Direction=SPI_DIRECTION_2LINES
|
||||
SPI5.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
SPI5.Mode=SPI_MODE_MASTER
|
||||
SPI5.VirtualType=VM_MASTER
|
||||
TIM5.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||
TIM5.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM5.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||
TIM5.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3
|
||||
USART1.IPParameters=VirtualMode
|
||||
USART1.VirtualMode=VM_ASYNC
|
||||
VP_IWDG_VS_IWDG.Mode=IWDG_Activate
|
||||
@@ -351,4 +397,12 @@ VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
|
||||
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM11_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM11_VS_ClockSourceINT.Signal=TIM11_VS_ClockSourceINT
|
||||
VP_TIM13_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM13_VS_ClockSourceINT.Signal=TIM13_VS_ClockSourceINT
|
||||
VP_TIM14_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM14_VS_ClockSourceINT.Signal=TIM14_VS_ClockSourceINT
|
||||
VP_TIM5_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM5_VS_ClockSourceINT.Signal=TIM5_VS_ClockSourceINT
|
||||
board=custom
|
||||
|
||||
@@ -70,6 +70,8 @@ extern "C" {
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user