feat support webserver for edu-arm32 board

This commit is contained in:
Liu_Weichao
2024-01-03 14:20:37 +08:00
parent 9e962d2cf2
commit 87c4c585d9
17 changed files with 123 additions and 31 deletions

View File

@@ -50,7 +50,7 @@ export SRC_DIR:= $(SRC_APP_DIR) $(SRC_KERNEL_DIR)
export LIBCC
export MUSL_DIR := $(KERNEL_ROOT)/lib/musllib
export LWIP_DIR := $(KERNEL_ROOT)/resources/ethernet
export MONGOOSE_DIR := $(KERNEL_ROOT)/../../APP_Framework/Applications/mongoose/lib
export MONGOOSE_DIR := $(KERNEL_ROOT)/../../APP_Framework/Applications/webserver/lib
PART:=
@@ -75,10 +75,6 @@ ifeq ($(CONFIG_RESOURCES_LWIP), y)
PART += COMPILE_LWIP
endif
ifeq ($(CONFIG_USE_MONGOOSE), y)
# PART += COMPILE_MONGOOSE
endif
ifeq ($(CONFIG_MCUBOOT_BOOTLOADER), y)
PART += COMPILE_BOOTLOADER
else ifeq ($(CONFIG_MCUBOOT_APPLICATION), y)
@@ -141,7 +137,7 @@ COMPILE_MONGOOSE:
done
@cp link_mongoose.mk build/Makefile
@$(MAKE) -C build TARGET=mongoose.a LINK_FLAGS=LFLAGS
@cp build/mongoose.a $(KERNEL_ROOT)/../../APP_Framework/Applications/mongoose/mongoose.a
@cp build/mongoose.a $(KERNEL_ROOT)/../../APP_Framework/Applications/webserver/mongoose.a
@rm build/Makefile build/make.obj
COMPILE_KERNEL:

View File

@@ -211,7 +211,7 @@ CONFIG_ADD_XIZI_FEATURES=y
#
# config stack size and priority of main task
#
CONFIG_MAIN_KTASK_STACK_SIZE=1024
CONFIG_MAIN_KTASK_STACK_SIZE=2048
CONFIG_MAIN_KTASK_PRIORITY=16
#

View File

@@ -15,4 +15,8 @@ ifeq ($(CONFIG_RESOURCES_LWIP), y)
export LINK_LWIP := $(KERNEL_ROOT)/resources/ethernet/LwIP/liblwip.a
endif
ifeq ($(CONFIG_APPLICATION_WEBSERVER), y)
export LINK_MONGOOSE := $(KERNEL_ROOT)/../../APP_Framework/Applications/webserver/mongoose.a
endif
export ARCH = arm

View File

@@ -75,6 +75,7 @@ Modification:
static stc_sd_handle_t gSdHandle;
static int sd_lock = -1;
static int is_mount_ok = 0;
static void SdCardConfig(void)
{
@@ -214,11 +215,13 @@ static struct SdioDevDone dev_done =
*/
static int MountSDCardFs(enum FilesystemType fs_type)
{
if (MountFilesystem(SDIO_BUS_NAME, SDIO_DEVICE_NAME, SDIO_DRIVER_NAME, fs_type, "/") == 0)
if (MountFilesystem(SDIO_BUS_NAME, SDIO_DEVICE_NAME, SDIO_DRIVER_NAME, fs_type, "/") == 0) {
KPrintf("Sd card mount to '/'");
else
is_mount_ok = 1;
} else {
KPrintf("Sd card mount to '/' failed!");
is_mount_ok = 0;
}
return 0;
}
#endif
@@ -253,9 +256,17 @@ static void SdCardDetach(void)
#ifdef MOUNT_SDCARD_FS
UnmountFileSystem("/");
is_mount_ok = 0;
#endif
}
int GetSdMountStatus(void)
{
if(!is_mount_ok)
KPrintf("SD card is not inserted or failed to mount, please check!\r\n");
return is_mount_ok;
}
static uint8 SdCardReadCd(void)
{
en_pin_state_t sd_cd_state = GPIO_ReadInputPins(SDIOC_CD_PORT, SDIOC_CD_PIN);

View File

@@ -16,6 +16,7 @@ menuconfig BSP_USING_UART3
menuconfig BSP_USING_UART4
bool "Enable USART4 for RS485"
default y
select BSP_USING_RS485
if BSP_USING_UART4
config SERIAL_BUS_NAME_4
string "serial bus 4 name"
@@ -28,6 +29,10 @@ menuconfig BSP_USING_UART4
default "usart4_dev4"
endif
config BSP_USING_RS485
bool
default n
menuconfig BSP_USING_UART6
bool "Enable USART6"
default n

View File

@@ -15,8 +15,8 @@ ifeq ($(CONFIG_RESOURCES_LWIP), y)
export LINK_LWIP := $(KERNEL_ROOT)/resources/ethernet/LwIP/liblwip.a
endif
ifeq ($(CONFIG_USE_MONGOOSE), y)
export LINK_MONGOOSE := $(KERNEL_ROOT)/../../APP_Framework/Applications/mongoose/mongoose.a
ifeq ($(CONFIG_APPLICATION_WEBSERVER), y)
export LINK_MONGOOSE := $(KERNEL_ROOT)/../../APP_Framework/Applications/webserver/mongoose.a
endif
export ARCH = arm

View File

@@ -39,7 +39,7 @@ ifeq ($(CONFIG_CRYPTO), y)
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/security/crypto/include #
endif
ifeq ($(CONFIG_USE_MONGOOSE),y)
ifeq ($(CONFIG_APPLICATION_WEBSERVER),y)
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/mongoose #
endif