diff --git a/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/ARM/startup_gd32f4xx.s b/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/ARM/startup_gd32f4xx.s index eb11e413dc..ba5c4c7399 100644 --- a/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/ARM/startup_gd32f4xx.s +++ b/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/ARM/startup_gd32f4xx.s @@ -141,10 +141,11 @@ __Vectors DCD __initial_sp ; Top of Stack DCD TRNG_IRQHandler ; 96:TRNG DCD FPU_IRQHandler ; 97:FPU DCD UART6_IRQHandler ; 98:UART6 - DCD UART7_IRQHandler ; 98:UART7 + DCD UART7_IRQHandler ; 99:UART7 DCD SPI3_IRQHandler ; 100:SPI3 DCD SPI4_IRQHandler ; 101:SPI4 DCD SPI5_IRQHandler ; 102:SPI5 + DCD 0 ; 103:Reserved DCD TLI_IRQHandler ; 104:TLI DCD TLI_ER_IRQHandler ; 105:TLI Error DCD IPA_IRQHandler ; 106:IPA diff --git a/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/GCC/startup_gd32f4xx.S b/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/GCC/startup_gd32f4xx.S index 149472da00..2e53748e25 100644 --- a/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/GCC/startup_gd32f4xx.S +++ b/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/GCC/startup_gd32f4xx.S @@ -104,6 +104,7 @@ g_pfnVectors: .word CAN1_TX_IRQHandler // 79:CAN1 TX .word CAN1_RX0_IRQHandler // 80:CAN1 RX0 .word CAN1_RX1_IRQHandler // 81:CAN1 RX1 + .word CAN1_EWMC_IRQHandler // 82:CAN1 EWMC .word USBFS_IRQHandler // 83:USBFS .word DMA1_Channel5_IRQHandler // 84:DMA1 Channel5 .word DMA1_Channel6_IRQHandler // 85:DMA1 Channel6 @@ -120,10 +121,11 @@ g_pfnVectors: .word TRNG_IRQHandler // 96:TRNG .word FPU_IRQHandler // 97:FPU .word UART6_IRQHandler // 98:UART6 - .word UART7_IRQHandler // 98:UART7 + .word UART7_IRQHandler // 99:UART7 .word SPI3_IRQHandler // 100:SPI3 .word SPI4_IRQHandler // 101:SPI4 .word SPI5_IRQHandler // 102:SPI5 + .word 0 // 103:Reserved .word TLI_IRQHandler // 104:TLI .word TLI_ER_IRQHandler // 105:TLI Error .word IPA_IRQHandler // 106:IPA diff --git a/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/IAR/startup_gd32f4xx.s b/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/IAR/startup_gd32f4xx.s index 87bf921267..af94881cdf 100644 --- a/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/IAR/startup_gd32f4xx.s +++ b/bsp/gd32450z-eval/Libraries/CMSIS/GD/GD32F4xx/Source/IAR/startup_gd32f4xx.s @@ -125,10 +125,11 @@ __vector_table DCD TRNG_IRQHandler ; 96:TRNG DCD FPU_IRQHandler ; 97:FPU DCD UART6_IRQHandler ; 98:UART6 - DCD UART7_IRQHandler ; 98:UART7 + DCD UART7_IRQHandler ; 99:UART7 DCD SPI3_IRQHandler ; 100:SPI3 DCD SPI4_IRQHandler ; 101:SPI4 DCD SPI5_IRQHandler ; 102:SPI5 + DCD 0 ; 103:Reserved DCD TLI_IRQHandler ; 104:TLI DCD TLI_ER_IRQHandler ; 105:TLI Error DCD IPA_IRQHandler ; 106:IPA diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c index 4da4207961..434217ea10 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_flash/drv_flash_l4.c @@ -233,7 +233,7 @@ int stm32_flash_erase(rt_uint32_t addr, size_t size) HAL_FLASH_Unlock(); /* Clear OPTVERR bit set on virgin samples */ - __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR); + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR | FLASH_FLAG_PGSERR); /* Get the 1st page to erase */ FirstPage = GetPage(addr); /* Get the number of pages to erase from 1st page */ diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c b/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c index 200dbf53df..4c1be94f8b 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c @@ -109,7 +109,7 @@ int rt_wdt_init(void) stm32_wdt.hiwdg.Init.Reload = 0x00000FFF; #if defined(SOC_SERIES_STM32F0) || defined(SOC_SERIES_STM32L4) || defined(SOC_SERIES_STM32F7) \ - || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L0) + || defined(SOC_SERIES_STM32H7) || defined(SOC_SERIES_STM32L0) || defined(SOC_SERIES_STM32G0) stm32_wdt.hiwdg.Init.Window = 0x00000FFF; #endif stm32_wdt.is_start = 0; diff --git a/components/net/at/src/at_cli.c b/components/net/at/src/at_cli.c index c589bb68a0..d51358d863 100644 --- a/components/net/at/src/at_cli.c +++ b/components/net/at/src/at_cli.c @@ -264,6 +264,10 @@ static void client_cli_parser(at_client_t client) } else { + if(cur_line_len >= FINSH_CMD_SIZE) + { + continue; + } rt_kprintf("%c", ch); cur_line[cur_line_len++] = ch; } diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h index 82387b432d..50248b9863 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/cc.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/cc.h @@ -40,6 +40,14 @@ #include #include +#ifndef BYTE_ORDER +#ifdef RT_USING_BIG_ENDIAN +#define BYTE_ORDER BIG_ENDIAN +#else +#define BYTE_ORDER LITTLE_ENDIAN +#endif /* RT_USING_BIG_ENDIAN */ +#endif /* BYTE_ORDER */ + typedef uint8_t u8_t; typedef int8_t s8_t; typedef uint16_t u16_t; diff --git a/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h b/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h index 72814aa25c..4c4eff942f 100644 --- a/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-1.4.1/src/arch/include/arch/sys_arch.h @@ -39,14 +39,10 @@ #include -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - #define SYS_MBOX_NULL RT_NULL #define SYS_SEM_NULL RT_NULL -typedef u32_t sys_prot_t; +typedef rt_uint32_t sys_prot_t; #define SYS_MBOX_SIZE 10 #define SYS_LWIP_TIMER_NAME "timer" diff --git a/components/net/lwip-1.4.1/src/lwipopts.h b/components/net/lwip-1.4.1/src/lwipopts.h index a5e035b53a..312f4f83ec 100644 --- a/components/net/lwip-1.4.1/src/lwipopts.h +++ b/components/net/lwip-1.4.1/src/lwipopts.h @@ -37,10 +37,6 @@ #define LWIP_PLATFORM_BYTESWAP 0 -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - /* #define RT_LWIP_DEBUG */ #ifdef RT_LWIP_DEBUG diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h index 28f86d257e..ea201be28a 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h @@ -39,6 +39,14 @@ #include #include +#ifndef BYTE_ORDER +#ifdef RT_USING_BIG_ENDIAN +#define BYTE_ORDER BIG_ENDIAN +#else +#define BYTE_ORDER LITTLE_ENDIAN +#endif /* RT_USING_BIG_ENDIAN */ +#endif /* BYTE_ORDER */ + #define U16_F "hu" #define S16_F "hd" #define X16_F "hx" diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h b/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h index 8637cc9263..478828d0a0 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/sys_arch.h @@ -39,14 +39,10 @@ #include -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - #define SYS_MBOX_NULL RT_NULL #define SYS_SEM_NULL RT_NULL -typedef u32_t sys_prot_t; +typedef rt_uint32_t sys_prot_t; #define SYS_MBOX_SIZE 10 #define SYS_LWIP_TIMER_NAME "timer" diff --git a/components/net/lwip-2.0.2/src/lwipopts.h b/components/net/lwip-2.0.2/src/lwipopts.h index fe6e2fef6f..9f5d03ebf7 100644 --- a/components/net/lwip-2.0.2/src/lwipopts.h +++ b/components/net/lwip-2.0.2/src/lwipopts.h @@ -45,10 +45,6 @@ #define LWIP_PLATFORM_BYTESWAP 0 -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - /* #define RT_LWIP_DEBUG */ #ifdef RT_LWIP_DEBUG diff --git a/components/net/lwip-2.0.3/src/arch/include/arch/cc.h b/components/net/lwip-2.0.3/src/arch/include/arch/cc.h index c7848adfc9..be5d406f50 100644 --- a/components/net/lwip-2.0.3/src/arch/include/arch/cc.h +++ b/components/net/lwip-2.0.3/src/arch/include/arch/cc.h @@ -39,6 +39,13 @@ #include #include +#ifndef BYTE_ORDER +#ifdef RT_USING_BIG_ENDIAN +#define BYTE_ORDER BIG_ENDIAN +#else +#define BYTE_ORDER LITTLE_ENDIAN +#endif /* RT_USING_BIG_ENDIAN */ +#endif /* BYTE_ORDER */ #define U16_F "hu" #define S16_F "hd" diff --git a/components/net/lwip-2.0.3/src/arch/include/arch/sys_arch.h b/components/net/lwip-2.0.3/src/arch/include/arch/sys_arch.h index 8637cc9263..d065298bff 100644 --- a/components/net/lwip-2.0.3/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-2.0.3/src/arch/include/arch/sys_arch.h @@ -36,17 +36,12 @@ #define __ARCH_SYS_ARCH_H__ #include "arch/cc.h" - #include -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - #define SYS_MBOX_NULL RT_NULL #define SYS_SEM_NULL RT_NULL -typedef u32_t sys_prot_t; +typedef rt_uint32_t sys_prot_t; #define SYS_MBOX_SIZE 10 #define SYS_LWIP_TIMER_NAME "timer" diff --git a/components/net/lwip-2.0.3/src/lwipopts.h b/components/net/lwip-2.0.3/src/lwipopts.h index fe6e2fef6f..9f5d03ebf7 100644 --- a/components/net/lwip-2.0.3/src/lwipopts.h +++ b/components/net/lwip-2.0.3/src/lwipopts.h @@ -45,10 +45,6 @@ #define LWIP_PLATFORM_BYTESWAP 0 -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - /* #define RT_LWIP_DEBUG */ #ifdef RT_LWIP_DEBUG diff --git a/components/net/lwip-2.1.2/src/arch/include/arch/cc.h b/components/net/lwip-2.1.2/src/arch/include/arch/cc.h index 28f86d257e..ea201be28a 100644 --- a/components/net/lwip-2.1.2/src/arch/include/arch/cc.h +++ b/components/net/lwip-2.1.2/src/arch/include/arch/cc.h @@ -39,6 +39,14 @@ #include #include +#ifndef BYTE_ORDER +#ifdef RT_USING_BIG_ENDIAN +#define BYTE_ORDER BIG_ENDIAN +#else +#define BYTE_ORDER LITTLE_ENDIAN +#endif /* RT_USING_BIG_ENDIAN */ +#endif /* BYTE_ORDER */ + #define U16_F "hu" #define S16_F "hd" #define X16_F "hx" diff --git a/components/net/lwip-2.1.2/src/arch/include/arch/sys_arch.h b/components/net/lwip-2.1.2/src/arch/include/arch/sys_arch.h index 1e97f8a5ac..e487f58211 100644 --- a/components/net/lwip-2.1.2/src/arch/include/arch/sys_arch.h +++ b/components/net/lwip-2.1.2/src/arch/include/arch/sys_arch.h @@ -36,17 +36,12 @@ #define __ARCH_SYS_ARCH_H__ #include "arch/cc.h" - #include -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - #define SYS_MBOX_NULL RT_NULL #define SYS_SEM_NULL RT_NULL -typedef u32_t sys_prot_t; +typedef rt_uint32_t sys_prot_t; #define SYS_MBOX_SIZE 10 #define SYS_LWIP_TIMER_NAME "timer" diff --git a/components/net/lwip-2.1.2/src/arch/sys_arch.c b/components/net/lwip-2.1.2/src/arch/sys_arch.c index c97609a4ea..a7d3f98968 100644 --- a/components/net/lwip-2.1.2/src/arch/sys_arch.c +++ b/components/net/lwip-2.1.2/src/arch/sys_arch.c @@ -360,7 +360,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex) rt_snprintf(tname, RT_NAME_MAX, "%s%d", SYS_LWIP_MUTEX_NAME, counter); counter ++; - tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_FIFO); + tmpmutex = rt_mutex_create(tname, RT_IPC_FLAG_PRIO); if (tmpmutex == RT_NULL) return ERR_MEM; else @@ -779,6 +779,32 @@ void ppp_trace(int level, const char *format, ...) } #endif +#ifdef LWIP_HOOK_IP4_ROUTE_SRC +struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src) +{ + struct netif *netif; + + /* iterate through netifs */ + for (netif = netif_list; netif != NULL; netif = netif->next) + { + /* is the netif up, does it have a link and a valid address? */ + if (netif_is_up(netif) && netif_is_link_up(netif) && !ip4_addr_isany_val(*netif_ip4_addr(netif))) + { + /* gateway matches on a non broadcast interface? (i.e. peer in a point to point interface) */ + if (src != NULL) + { + if (ip4_addr_cmp(src, netif_ip4_addr(netif))) + { + return netif; + } + } + } + } + netif = netif_default; + return netif; +} +#endif /* LWIP_HOOK_IP4_ROUTE_SRC */ + /* * export bsd socket symbol for RT-Thread Application Module */ diff --git a/components/net/lwip-2.1.2/src/lwipopts.h b/components/net/lwip-2.1.2/src/lwipopts.h index 81409a9d0a..f5eb177d5d 100644 --- a/components/net/lwip-2.1.2/src/lwipopts.h +++ b/components/net/lwip-2.1.2/src/lwipopts.h @@ -47,10 +47,6 @@ #define LWIP_PLATFORM_BYTESWAP 0 -#ifndef BYTE_ORDER -#define BYTE_ORDER LITTLE_ENDIAN -#endif - /* #define RT_LWIP_DEBUG */ #ifdef RT_LWIP_DEBUG @@ -648,4 +644,8 @@ #endif +#define LWIP_HOOK_IP4_ROUTE_SRC(dest, src) lwip_ip4_route_src(dest, src) +#include "lwip/ip_addr.h" +struct netif *lwip_ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src); + #endif /* __LWIPOPTS_H__ */