[修改]: stm32f429-apollo 3.0 修改。

This commit is contained in:
SummerGift 2017-10-20 12:53:18 +08:00
parent fbe3a4d1db
commit 6e4d1fae2a
6 changed files with 271 additions and 69 deletions

View File

@ -26,6 +26,7 @@ CONFIG_RT_USING_MUTEX=y
CONFIG_RT_USING_EVENT=y
CONFIG_RT_USING_MAILBOX=y
CONFIG_RT_USING_MESSAGEQUEUE=y
# CONFIG_RT_USING_SIGNALS is not set
#
# Memory Management
@ -60,33 +61,33 @@ CONFIG_RT_USING_COMPONENTS_INIT=y
# Command shell
#
CONFIG_RT_USING_FINSH=y
CONFIG_FINSH_USING_HISTORY=y
CONFIG_FINSH_USING_SYMTAB=y
CONFIG_FINSH_USING_DESCRIPTION=y
CONFIG_FINSH_THREAD_PRIORITY=20
CONFIG_FINSH_THREAD_STACK_SIZE=2048
CONFIG_FINSH_CMD_SIZE=80
# CONFIG_FINSH_USING_AUTH is not set
CONFIG_FINSH_DEFAULT_PASSWORD="rtthread"
# CONFIG_FINSH_USING_MSH is not set
# CONFIG_FINSH_USING_MSH_DEFAULT is not set
# CONFIG_FINSH_USING_MSH_ONLY is not set
#
# Device virtual file system
#
CONFIG_RT_USING_DFS=y
# CONFIG_DFS_USING_WORKDIR is not set
CONFIG_DFS_FILESYSTEMS_MAX=4
CONFIG_DFS_FD_MAX=16
CONFIG_DFS_USING_WORKDIR=y
CONFIG_DFS_FILESYSTEMS_MAX=2
CONFIG_DFS_FD_MAX=4
CONFIG_RT_USING_DFS_ELMFAT=y
CONFIG_RT_DFS_ELM_CODE_PAGE=437
CONFIG_RT_DFS_ELM_WORD_ACCESS=y
# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set
CONFIG_RT_DFS_ELM_USE_LFN_0=y
# CONFIG_RT_DFS_ELM_USE_LFN_1 is not set
# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set
CONFIG_RT_DFS_ELM_USE_LFN_3=y
CONFIG_RT_DFS_ELM_USE_LFN=3
# CONFIG_RT_DFS_ELM_USE_LFN_3 is not set
CONFIG_RT_DFS_ELM_USE_LFN=0
CONFIG_RT_DFS_ELM_MAX_LFN=255
CONFIG_RT_DFS_ELM_DRIVES=2
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=4096
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512
# CONFIG_RT_DFS_ELM_USE_ERASE is not set
CONFIG_RT_DFS_ELM_REENTRANT=y
CONFIG_RT_USING_DFS_DEVFS=y
@ -105,27 +106,20 @@ CONFIG_RT_USING_I2C_BITOPS=y
# CONFIG_RT_USING_PIN is not set
# CONFIG_RT_USING_MTD_NOR is not set
CONFIG_RT_USING_MTD_NAND=y
CONFIG_RT_MTD_NAND_DEBUG=y
# CONFIG_RT_MTD_NAND_DEBUG is not set
CONFIG_RT_USING_RTC=y
CONFIG_RT_USING_SDIO=y
CONFIG_RT_USING_SPI=y
CONFIG_RT_USING_SFUD=y
CONFIG_RT_SFUD_USING_SFDP=y
CONFIG_RT_SFUD_USING_FLASH_INFO_TABLE=y
CONFIG_RT_SFUD_DEBUG=y
# CONFIG_RT_USING_W25QXX is not set
# CONFIG_RT_USING_GD is not set
# CONFIG_RT_USING_ENC28J60 is not set
# CONFIG_RT_USING_SPI_WIFI is not set
# CONFIG_RT_USING_SDIO is not set
# CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_WDT is not set
# CONFIG_RT_USING_USB_HOST is not set
# CONFIG_RT_USING_USB_DEVICE is not set
#
# libc
# POSIX layer and C standard library
#
CONFIG_RT_USING_LIBC=y
# CONFIG_RT_USING_PTHREADS is not set
# CONFIG_RT_USING_POSIX is not set
#
# Network stack
@ -134,47 +128,99 @@ CONFIG_RT_USING_LIBC=y
#
# light weight TCP/IP stack
#
# CONFIG_RT_USING_LWIP is not set
CONFIG_RT_USING_LWIP=y
CONFIG_RT_USING_LWIP141=y
# CONFIG_RT_USING_LWIP202 is not set
# CONFIG_RT_LWIP_IGMP is not set
CONFIG_RT_LWIP_ICMP=y
# CONFIG_RT_LWIP_SNMP is not set
CONFIG_RT_LWIP_DNS=y
CONFIG_RT_LWIP_DHCP=y
CONFIG_IP_SOF_BROADCAST=1
CONFIG_IP_SOF_BROADCAST_RECV=1
CONFIG_LWIP_USING_DHCPD=y
CONFIG_RT_LWIP_UDP=y
CONFIG_RT_LWIP_TCP=y
# CONFIG_RT_LWIP_RAW is not set
# CONFIG_RT_LWIP_PPP is not set
# CONFIG_RT_LWIP_PPPOE is not set
# CONFIG_RT_LWIP_PPPOS is not set
CONFIG_RT_LWIP_PBUF_NUM=16
CONFIG_RT_LWIP_RAW_PCB_NUM=4
CONFIG_RT_LWIP_UDP_PCB_NUM=4
CONFIG_RT_LWIP_TCP_PCB_NUM=4
CONFIG_RT_LWIP_TCP_SEG_NUM=40
CONFIG_RT_LWIP_TCP_SND_BUF=8196
CONFIG_RT_LWIP_TCP_WND=8196
CONFIG_RT_LWIP_TCPTHREAD_PRIORITY=10
CONFIG_RT_LWIP_TCPTHREAD_MBOX_SIZE=8
CONFIG_RT_LWIP_TCPTHREAD_STACKSIZE=1024
CONFIG_RT_LWIP_ETHTHREAD_PRIORITY=12
CONFIG_RT_LWIP_ETHTHREAD_STACKSIZE=1024
CONFIG_RT_LWIP_ETHTHREAD_MBOX_SIZE=8
# CONFIG_RT_LWIP_REASSEMBLY_FRAG is not set
CONFIG_LWIP_NETIF_STATUS_CALLBACK=1
CONFIG_SO_REUSE=1
CONFIG_LWIP_SO_RCVTIMEO=1
CONFIG_LWIP_SO_SNDTIMEO=1
CONFIG_LWIP_SO_RCVBUF=1
#
# Modbus master and slave stack
#
# CONFIG_RT_USING_MODBUS is not set
# CONFIG_RT_USING_NETUTILS is not set
#
# RT-Thread UI Engine
#
# CONFIG_RT_USING_GUIENGINE is not set
#
# RT-Thread online packages
#
#
# system packages
#
# CONFIG_PKG_USING_PARTITION is not set
# CONFIG_PKG_USING_SQLITE is not set
#
# IoT - internet of things
#
# CONFIG_PKG_USING_CJSON is not set
# CONFIG_PKG_USING_PAHOMQTT is not set
CONFIG_PKG_USING_PAHOMQTT=y
CONFIG_PKG_PAHOMQTT_PATH="/packages/iot/pahomqtt"
CONFIG_PKG_PAHOMQTT_VER="v1.0.0"
# CONFIG_PKG_USING_WEBCLIENT is not set
# CONFIG_PKG_USING_MONGOOSE is not set
# CONFIG_PKG_USING_WEBTERMINAL is not set
#
# security packages
#
# CONFIG_PKG_USING_MBEDTLS is not set
#
# language packages
#
# CONFIG_PKG_USING_JERRYSCRIPT is not set
#
# miscellaneous packages
#
# CONFIG_PKG_USING_HELLO is not set
#
# multimedia packages
#
#
# security packages
#
#
# system packages
# tools packages
#
# CONFIG_PKG_USING_CMBACKTRACE is not set
# CONFIG_PKG_USING_PARTITION is not set
# CONFIG_PKG_USING_EASYLOGGER is not set
#
# miscellaneous packages
#
# CONFIG_PKG_USING_HELLO is not set
#
# BSP_SPECIAL CONFIG
@ -185,3 +231,22 @@ CONFIG_RT_USING_UART1=y
CONFIG_RT_USING_UART2=y
CONFIG_RT_USING_UART3=y
CONFIG_RT_USING_SPI5=y
#
# BSP_LWIP CONFIG
#
CONFIG_RT_LWIP_IPADDR0=192
CONFIG_RT_LWIP_IPADDR1=168
CONFIG_RT_LWIP_IPADDR2=1
CONFIG_RT_LWIP_IPADDR3=201
CONFIG_RT_LWIP_GWADDR0=192
CONFIG_RT_LWIP_GWADDR1=168
CONFIG_RT_LWIP_GWADDR2=1
CONFIG_RT_LWIP_GWADDR3=1
CONFIG_RT_LWIP_MSKADDR0=255
CONFIG_RT_LWIP_MSKADDR1=255
CONFIG_RT_LWIP_MSKADDR2=255
CONFIG_RT_LWIP_MSKADDR3=0
CONFIG_CHECKSUM_CHECK_TCP=0
CONFIG_CHECKSUM_CHECK_IP=0
CONFIG_CHECKSUM_CHECK_UDP=0

View File

@ -46,6 +46,70 @@ config RT_USING_SPI5
endmenu
menu "BSP_LWIP CONFIG"
config RT_LWIP_IPADDR0
int "RT_LWIP_IPADDR0"
default 192
config RT_LWIP_IPADDR1
int "RT_LWIP_IPADDR1"
default 168
config RT_LWIP_IPADDR2
int "RT_LWIP_IPADDR2"
default 1
config RT_LWIP_IPADDR3
int "RT_LWIP_IPADDR3"
default 201
config RT_LWIP_GWADDR0
int "RT_LWIP_GWADDR0"
default 192
config RT_LWIP_GWADDR1
int "RT_LWIP_GWADDR1"
default 168
config RT_LWIP_GWADDR2
int "RT_LWIP_GWADDR2"
default 1
config RT_LWIP_GWADDR3
int "RT_LWIP_GWADDR3"
default 1
config RT_LWIP_MSKADDR0
int "RT_LWIP_MSKADDR0"
default 255
config RT_LWIP_MSKADDR1
int "RT_LWIP_MSKADDR1"
default 255
config RT_LWIP_MSKADDR2
int "RT_LWIP_MSKADDR2"
default 255
config RT_LWIP_MSKADDR3
int "RT_LWIP_MSKADDR3"
default 0
config CHECKSUM_CHECK_TCP
int "CHECKSUM_CHECK_TCP"
default 0
config CHECKSUM_CHECK_IP
int "The CHECKSUM_CHECK_IP"
default 0
config CHECKSUM_CHECK_UDP
int "The CHECKSUM_CHECK_UDP"
default 0
endmenu

View File

@ -20,7 +20,7 @@
#include "time.h"
#ifdef RT_USING_DFS
/* dfs init */
#include <dfs_init.h>
/* dfs filesystem:ELM filesystem init */
#include <dfs_elm.h>
/* dfs Filesystem APIs */

View File

@ -117,6 +117,17 @@ void HAL_ETH_ErrorCallback(ETH_HandleTypeDef *heth)
{
rt_kprintf("eth err\n");
}
static void delay_ms(rt_uint32_t ms)
{
if (ms < 1000 / RT_TICK_PER_SECOND)
{
rt_thread_delay(1);
}
else
{
rt_thread_delay(ms/(1000 / RT_TICK_PER_SECOND));
}
}
static void phy_pin_reset(void)
{

View File

@ -25,6 +25,7 @@
#define RT_USING_EVENT
#define RT_USING_MAILBOX
#define RT_USING_MESSAGEQUEUE
/* RT_USING_SIGNALS is not set */
/* Memory Management */
@ -54,32 +55,32 @@
/* Command shell */
#define RT_USING_FINSH
#define FINSH_USING_HISTORY
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION
#define FINSH_THREAD_PRIORITY 20
#define FINSH_THREAD_STACK_SIZE 2048
#define FINSH_CMD_SIZE 80
/* FINSH_USING_AUTH is not set */
#define FINSH_DEFAULT_PASSWORD "rtthread"
/* FINSH_USING_MSH is not set */
/* FINSH_USING_MSH_DEFAULT is not set */
/* FINSH_USING_MSH_ONLY is not set */
/* Device virtual file system */
#define RT_USING_DFS
/* DFS_USING_WORKDIR is not set */
#define DFS_FILESYSTEMS_MAX 4
#define DFS_FD_MAX 16
#define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX 2
#define DFS_FD_MAX 4
#define RT_USING_DFS_ELMFAT
#define RT_DFS_ELM_CODE_PAGE 437
#define RT_DFS_ELM_WORD_ACCESS
/* RT_DFS_ELM_USE_LFN_0 is not set */
#define RT_DFS_ELM_USE_LFN_0
/* RT_DFS_ELM_USE_LFN_1 is not set */
/* RT_DFS_ELM_USE_LFN_2 is not set */
#define RT_DFS_ELM_USE_LFN_3
#define RT_DFS_ELM_USE_LFN 3
/* RT_DFS_ELM_USE_LFN_3 is not set */
#define RT_DFS_ELM_USE_LFN 0
#define RT_DFS_ELM_MAX_LFN 255
#define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_MAX_SECTOR_SIZE 4096
#define RT_DFS_ELM_MAX_SECTOR_SIZE 512
/* RT_DFS_ELM_USE_ERASE is not set */
#define RT_DFS_ELM_REENTRANT
#define RT_USING_DFS_DEVFS
@ -97,62 +98,104 @@
/* RT_USING_PIN is not set */
/* RT_USING_MTD_NOR is not set */
#define RT_USING_MTD_NAND
#define RT_MTD_NAND_DEBUG
/* RT_MTD_NAND_DEBUG is not set */
#define RT_USING_RTC
#define RT_USING_SDIO
#define RT_USING_SPI
#define RT_USING_SFUD
#define RT_SFUD_USING_SFDP
#define RT_SFUD_USING_FLASH_INFO_TABLE
#define RT_SFUD_DEBUG
/* RT_USING_W25QXX is not set */
/* RT_USING_GD is not set */
/* RT_USING_ENC28J60 is not set */
/* RT_USING_SPI_WIFI is not set */
/* RT_USING_SDIO is not set */
/* RT_USING_SPI is not set */
/* RT_USING_WDT is not set */
/* RT_USING_USB_HOST is not set */
/* RT_USING_USB_DEVICE is not set */
/* libc */
/* POSIX layer and C standard library */
#define RT_USING_LIBC
/* RT_USING_PTHREADS is not set */
/* RT_USING_POSIX is not set */
/* Network stack */
/* light weight TCP/IP stack */
/* RT_USING_LWIP is not set */
#define RT_USING_LWIP
#define RT_USING_LWIP141
/* RT_USING_LWIP202 is not set */
/* RT_LWIP_IGMP is not set */
#define RT_LWIP_ICMP
/* RT_LWIP_SNMP is not set */
#define RT_LWIP_DNS
#define RT_LWIP_DHCP
#define IP_SOF_BROADCAST 1
#define IP_SOF_BROADCAST_RECV 1
#define LWIP_USING_DHCPD
#define RT_LWIP_UDP
#define RT_LWIP_TCP
/* RT_LWIP_RAW is not set */
/* RT_LWIP_PPP is not set */
/* RT_LWIP_PPPOE is not set */
/* RT_LWIP_PPPOS is not set */
#define RT_LWIP_PBUF_NUM 16
#define RT_LWIP_RAW_PCB_NUM 4
#define RT_LWIP_UDP_PCB_NUM 4
#define RT_LWIP_TCP_PCB_NUM 4
#define RT_LWIP_TCP_SEG_NUM 40
#define RT_LWIP_TCP_SND_BUF 8196
#define RT_LWIP_TCP_WND 8196
#define RT_LWIP_TCPTHREAD_PRIORITY 10
#define RT_LWIP_TCPTHREAD_MBOX_SIZE 8
#define RT_LWIP_TCPTHREAD_STACKSIZE 1024
#define RT_LWIP_ETHTHREAD_PRIORITY 12
#define RT_LWIP_ETHTHREAD_STACKSIZE 1024
#define RT_LWIP_ETHTHREAD_MBOX_SIZE 8
/* RT_LWIP_REASSEMBLY_FRAG is not set */
#define LWIP_NETIF_STATUS_CALLBACK 1
#define SO_REUSE 1
#define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_SNDTIMEO 1
#define LWIP_SO_RCVBUF 1
/* Modbus master and slave stack */
/* RT_USING_MODBUS is not set */
/* RT_USING_NETUTILS is not set */
/* RT-Thread UI Engine */
/* RT_USING_GUIENGINE is not set */
/* RT-Thread online packages */
/* system packages */
/* PKG_USING_PARTITION is not set */
/* PKG_USING_SQLITE is not set */
/* IoT - internet of things */
/* PKG_USING_CJSON is not set */
/* PKG_USING_PAHOMQTT is not set */
#define PKG_USING_PAHOMQTT
/* PKG_USING_WEBCLIENT is not set */
/* PKG_USING_MONGOOSE is not set */
/* PKG_USING_WEBTERMINAL is not set */
/* security packages */
/* PKG_USING_MBEDTLS is not set */
/* language packages */
/* PKG_USING_JERRYSCRIPT is not set */
/* multimedia packages */
/* tools packages */
/* PKG_USING_CMBACKTRACE is not set */
/* PKG_USING_EASYLOGGER is not set */
/* miscellaneous packages */
/* PKG_USING_HELLO is not set */
/* multimedia packages */
/* security packages */
/* system packages */
/* PKG_USING_CMBACKTRACE is not set */
/* PKG_USING_PARTITION is not set */
/* BSP_SPECIAL CONFIG */
#define RT_RTC_NAME "rtc"
@ -162,4 +205,22 @@
#define RT_USING_UART3
#define RT_USING_SPI5
/* BSP_LWIP CONFIG */
#define RT_LWIP_IPADDR0 192
#define RT_LWIP_IPADDR1 168
#define RT_LWIP_IPADDR2 1
#define RT_LWIP_IPADDR3 201
#define RT_LWIP_GWADDR0 192
#define RT_LWIP_GWADDR1 168
#define RT_LWIP_GWADDR2 1
#define RT_LWIP_GWADDR3 1
#define RT_LWIP_MSKADDR0 255
#define RT_LWIP_MSKADDR1 255
#define RT_LWIP_MSKADDR2 255
#define RT_LWIP_MSKADDR3 0
#define CHECKSUM_CHECK_TCP 0
#define CHECKSUM_CHECK_IP 0
#define CHECKSUM_CHECK_UDP 0
#endif

View File

@ -1,4 +1,5 @@
import os
import scons_config
# toolchains options
ARCH='arm'