diff --git a/USDK/component/common/api/wifi_api.c b/USDK/component/common/api/wifi_api.c index fa4920b..76b3582 100644 --- a/USDK/component/common/api/wifi_api.c +++ b/USDK/component/common/api/wifi_api.c @@ -411,15 +411,10 @@ LOCAL rtw_result_t StartStDHCPClient(void) struct netif * pnetif = &xnetif[WLAN_ST_NETIF_NUM]; DHCP_CONFIG *p = (dhcp_cfg *)&wifi_st_dhcp; unsigned char mode = p->mode; - if((mode == 3) // Auto fix - && p->ip != IP4ADDR(255,255,255,255) - && p->ip != IP4ADDR(0,0,0,0)) { + if(mode == 2 && p->ip != IP4ADDR(255,255,255,255) && p->ip != IP4ADDR(0,0,0,0)) { // fixed ip + netif_set_addr(pnetif, (ip_addr_t *)&p->ip, (ip_addr_t *)&p->mask, (ip_addr_t *)&p->gw); } - else mode = 1; // DHCP On - if(mode == 2) { // fixed ip - netif_set_addr(pnetif, (ip_addr_t *)&p->ip, (ip_addr_t *)&p->mask, (ip_addr_t *)&p->gw); - } - else if(mode) { + else if(mode) { // DHCP On UBaseType_t savePriority = uxTaskPriorityGet(NULL); /* If not rise priority, LwIP DHCP may timeout */ vTaskPrioritySet(NULL, tskIDLE_PRIORITY + 3); @@ -430,7 +425,7 @@ LOCAL rtw_result_t StartStDHCPClient(void) p->ip = pnetif->ip_addr.addr; p->gw = pnetif->gw.addr; p->mask = pnetif->netmask.addr; - if(p->mode == 3) { // Auto fix + if(mode > 2) { // 3+ Auto fix p->mode = 2; // fixed ip write_wifi_cfg(BID_ST_DHCP_CFG); } diff --git a/USDK/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c b/USDK/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c index 59ae1d7..ef7df66 100644 --- a/USDK/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c +++ b/USDK/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c @@ -223,20 +223,20 @@ s8 sdio_write_blocks(uint32_t sector, const uint8_t *buffer, uint32_t count) { //----- s8 sdio_sd_init(void) { if (sdio_status != SDIO_SD_OK) { - SdioHostAdapter.AdmaDescTbl = gAdmaTbls; if (sdio_status <= SDIO_INIT_FAIL) sdio_init_host(); if (sdio_status != SDIO_INIT_OK) { return -1; } DBG_SDIO_INFO("Init sd card.\n"); + SdioHostAdapter.AdmaDescTbl = gAdmaTbls; if (HalSdioHostOp.HalSdioHostInitCard(&SdioHostAdapter)) { return -1; } sdio_status = SDIO_SD_OK; if (HalSdioHostOp.HalSdioHostChangeSdClock(&SdioHostAdapter, -// SD_CLK_20_8MHZ) != HAL_OK) - SD_CLK_41_6MHZ) != HAL_OK) + SD_CLK_20_8MHZ) != HAL_OK) +// SD_CLK_41_6MHZ) != HAL_OK) DBG_SDIO_INFO("SD card does not support high speed.\n"); } return 0; diff --git a/USDK/component/common/file_system/fatfs/r0.10c/include/ffconf.h b/USDK/component/common/file_system/fatfs/r0.10c/include/ffconf.h index 85f3005..9018593 100644 --- a/USDK/component/common/file_system/fatfs/r0.10c/include/ffconf.h +++ b/USDK/component/common/file_system/fatfs/r0.10c/include/ffconf.h @@ -119,7 +119,7 @@ / FatFs supports only BMP. */ -#define _FS_RPATH 0 /* 0 to 2 */ +#define _FS_RPATH 2 /* 0 to 2 */ /* The _FS_RPATH option configures relative path feature. / / 0: Disable relative path feature and remove related functions. diff --git a/USDK/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c b/USDK/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c index 2ca62fc..ddfef6c 100644 --- a/USDK/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c +++ b/USDK/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c @@ -112,7 +112,8 @@ void HalSdioHostOpInit(void *Data) { phsha->HalSdioHostErase = &HalSdioHostEraseRtl8195a; phsha->HalSdioHostGetWriteProtect = &HalSdioHostGetWriteProtectRtl8195a; phsha->HalSdioHostSetWriteProtect = &HalSdioHostSetWriteProtectRtl8195a; -//#ifdef RTL8710AF + +#if 0 //#ifdef RTL8710AF if(HalGetChipId() != CHIP_ID_8195AM) { GPIOState[0] &= ~((1 << 8) - 1); { @@ -123,8 +124,7 @@ void HalSdioHostOpInit(void *Data) { } // vTaskDelay(1); } - -//#endif +#endif } #endif // CONFIG_SDIO_HOST_EN diff --git a/USDK/flasher.mk b/USDK/flasher.mk index 9a33190..4f281d2 100644 --- a/USDK/flasher.mk +++ b/USDK/flasher.mk @@ -206,8 +206,7 @@ runram: -f $(FLASHER_PATH)rtl8710.ocd -c 'init' -c 'reset halt' -c 'adapter_khz $(FLASHER_SPEED)' \ -c 'load_image $(RAM1R_IMAGE) 0x10000bc8 bin' \ -c 'load_image $(RAM2_IMAGE) 0x10006000 bin' \ - -c 'mww 0x40000210 0x20200113' \ - -c 'reset run' -c shutdown + -c 'mww 0x40000210 0x20111157' -c 'rtl8710_reboot' -c shutdown endif endif diff --git a/USDK/sdkset.mk b/USDK/sdkset.mk index ba7e7bc..d32ab25 100644 --- a/USDK/sdkset.mk +++ b/USDK/sdkset.mk @@ -19,9 +19,9 @@ # FLAGS # ------------------------------------------------------------------- CFLAGS = -DM3 -DCONFIG_PLATFORM_8195A -DGCC_ARMCM3 -DARDUINO_SDK -DF_CPU=166666666L -DNDEBUG -CFLAGS += -mcpu=cortex-m3 -mthumb -g2 -Os -std=gnu99 -Wall -Werror +CFLAGS += -mcpu=cortex-m3 -mthumb -g2 -Os -std=gnu99 -Wall -Werror -Wpedantic -Wextra CFLAGS += -fno-common -fmessage-length=0 -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-short-enums -fsigned-char -CFLAGS += -w -Wno-pointer-sign +CFLAGS += -w -Wno-pointer-sign ifdef USE_GCC_LIB LFLAGS = -mcpu=cortex-m3 -mthumb -g -Os -nostartfiles --specs=nano.specs else @@ -40,7 +40,7 @@ all: LIBS +=_wlan _platform_new _wps _websocket _xmodem _mdns mp: LIBS +=_wlan_mp _platform_new _wps _websocket _xmodem _mdns endif ifdef USE_SDIOH -LIBS += _sdcard_v2 +#LIBS += _sdcard_v2 CFLAGS += -DCONFIG_FATFS_EN=1 endif # m c nosys gcc @@ -259,6 +259,7 @@ ifdef USE_SDIOH SRC_C += sdk/component/soc/realtek/8195a/fwlib/src/hal_sdio_host.c SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sd.c SRC_C += sdk/component/common/drivers/sdio/realtek/sdio_host/src/sdio_host.c +SRC_C += sdk/component/soc/realtek/8195a/fwlib/rtl8195a/src/rtl8195a_sdio_host_open.c endif #peripheral - osdep diff --git a/project/inc/FreeRTOSConfig.h b/project/inc/FreeRTOSConfig.h index 3340266..ad72685 100644 --- a/project/inc/FreeRTOSConfig.h +++ b/project/inc/FreeRTOSConfig.h @@ -111,7 +111,7 @@ extern uint32_t SystemCoreClock; #define configCHECK_FOR_STACK_OVERFLOW 0 #define configUSE_RECURSIVE_MUTEXES 1 #define configQUEUE_REGISTRY_SIZE 0 -#define configGENERATE_RUN_TIME_STATS 0 +#define configGENERATE_RUN_TIME_STATS 1 #if configGENERATE_RUN_TIME_STATS #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/project/src/web/web_int_callbacks.c b/project/src/web/web_int_callbacks.c index a411b16..6543941 100644 --- a/project/src/web/web_int_callbacks.c +++ b/project/src/web/web_int_callbacks.c @@ -22,6 +22,7 @@ #include "wifi_api.h" #include "sys_api.h" #include "esp_comp.h" +#include "sdk_ver.h" #ifdef USE_NETBIOS #include "netbios/netbios.h"