From 677fea7bfa915e7159e21470638411cd4a391944 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Tue, 16 Jan 2024 14:17:20 -0300 Subject: [PATCH] change mongoose_custom for Keil --- .../mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 93 +++++++---------- .../mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 98 +++++++----------- .../nucleo-f746zg-keil-rtx/mongoose_custom.h | 99 +++++++------------ .../mongoose_custom.h | 98 +++++++----------- .../mongoose_custom.h | 98 +++++++----------- .../nucleo-f746zg-keil-rtx5/mongoose_custom.h | 99 +++++++------------ mongoose.h | 8 +- src/arch.h | 6 +- src/arch_freertos.h | 1 + src/arch_rtx.h | 1 + 17 files changed, 486 insertions(+), 808 deletions(-) diff --git a/examples/stm32/nucleo-f429zi-keil-baremetal/mongoose_custom.h b/examples/stm32/nucleo-f429zi-keil-baremetal/mongoose_custom.h index fa67625c49..31a9cab89c 100644 --- a/examples/stm32/nucleo-f429zi-keil-baremetal/mongoose_custom.h +++ b/examples/stm32/nucleo-f429zi-keil-baremetal/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// FreeRTOS uses direct FreeRTOS calls -// CMSIS-RTOS1 supports only Keil RTX through API v1 -// CMSIS-RTOS2 supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 0 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 0 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_ARMCC +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 1 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 1 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 1 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment -#define MG_ENABLE_DRIVER_STM32F 1 + diff --git a/examples/stm32/nucleo-f429zi-keil-freertos/mongoose_custom.h b/examples/stm32/nucleo-f429zi-keil-freertos/mongoose_custom.h index 97a05b3c4e..390a615770 100644 --- a/examples/stm32/nucleo-f429zi-keil-freertos/mongoose_custom.h +++ b/examples/stm32/nucleo-f429zi-keil-freertos/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 1 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 0 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_FREERTOS +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 1 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 1 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment -#define MG_ENABLE_DRIVER_STM32F 1 + diff --git a/examples/stm32/nucleo-f746zg-keil-baremetal/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-baremetal/mongoose_custom.h index fa67625c49..31a9cab89c 100644 --- a/examples/stm32/nucleo-f746zg-keil-baremetal/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-baremetal/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// FreeRTOS uses direct FreeRTOS calls -// CMSIS-RTOS1 supports only Keil RTX through API v1 -// CMSIS-RTOS2 supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 0 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 0 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_ARMCC +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 1 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 1 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 1 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment -#define MG_ENABLE_DRIVER_STM32F 1 + diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/mongoose_custom.h index 154bb5c4bf..18aca30321 100644 --- a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/mongoose_custom.h @@ -1,78 +1,55 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 1 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 1 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_FREERTOS +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 0 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 0 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 + +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 +// <<< end of configuration section >>> // Add your customization below this comment +#define MG_ENABLE_LWIP 1 + diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/mongoose_custom.h index 4c87f8fa2d..2eba659460 100644 --- a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_FREERTOS -#define MG_CMSISPACK_ARCH 1 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 0 +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 0 -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 2 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 +// -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 + +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 -// Filesystem support // Enable packed (embedded) filesystem #define MG_ENABLE_PACKED_FS 1 -// - // <<< end of configuration section >>> -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif - - // Add your customization below this comment - +#define MG_ENABLE_FREERTOS_TCP 1 diff --git a/examples/stm32/nucleo-f746zg-keil-freertos/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-freertos/mongoose_custom.h index 97a05b3c4e..390a615770 100644 --- a/examples/stm32/nucleo-f746zg-keil-freertos/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-freertos/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 1 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 0 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_FREERTOS +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 1 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 1 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment -#define MG_ENABLE_DRIVER_STM32F 1 + diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/mongoose_custom.h index 948dddfe93..b179d99acb 100644 --- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/mongoose_custom.h @@ -1,78 +1,55 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 3 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 1 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_CMSIS_RTOS2 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 0 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 0 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 + +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 +// <<< end of configuration section >>> // Add your customization below this comment +#define MG_ENABLE_LWIP 1 + diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/mongoose_custom.h index 0a7b750f17..26fb707197 100644 --- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 3 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 0 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_CMSIS_RTOS2 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 1 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 1 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment -#define MG_ENABLE_DRIVER_STM32F 1 + diff --git a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/mongoose_custom.h index 8e5a9871e8..964ab1292d 100644 --- a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/mongoose_custom.h @@ -1,78 +1,54 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 2 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 3 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_CMSIS_RTOS1 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 0 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 0 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment +#define MG_ENABLE_RL 1 diff --git a/examples/stm32/nucleo-f746zg-keil-rtx/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-rtx/mongoose_custom.h index 2023bee210..e5a681c12f 100644 --- a/examples/stm32/nucleo-f746zg-keil-rtx/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-rtx/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// FreeRTOS uses direct FreeRTOS calls -// CMSIS-RTOS1 supports only Keil RTX through API v1 -// CMSIS-RTOS2 supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 2 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 0 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_CMSIS_RTOS1 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 1 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 1 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment -#define MG_ENABLE_DRIVER_STM32F 1 + diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/mongoose_custom.h index 948dddfe93..46cde88f40 100644 --- a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/mongoose_custom.h @@ -1,78 +1,54 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 3 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 1 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_CMSIS_RTOS2 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 0 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 0 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment +#define MG_ENABLE_LWIP 1 diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/mongoose_custom.h index 067d228c55..34800f7510 100644 --- a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/mongoose_custom.h @@ -1,78 +1,54 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// "FreeRTOS" uses direct FreeRTOS calls -// "CMSIS-RTOS v1" supports only Keil RTX through API v1 -// "CMSIS-RTOS v2" supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 3 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 3 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_CMSIS_RTOS2 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 0 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 0 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment +#define MG_ENABLE_RL 1 diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5/mongoose_custom.h b/examples/stm32/nucleo-f746zg-keil-rtx5/mongoose_custom.h index 07ad7c36fa..26fb707197 100644 --- a/examples/stm32/nucleo-f746zg-keil-rtx5/mongoose_custom.h +++ b/examples/stm32/nucleo-f746zg-keil-rtx5/mongoose_custom.h @@ -1,78 +1,53 @@ +// See https://mongoose.ws/documentation/#build-options +#pragma once // <<< Use Configuration Wizard in Context Menu >>> -// System Architecture -// <0=> Bare metal -// <1=> FreeRTOS -// <2=> CMSIS-RTOS v1 -// <3=> CMSIS-RTOS v2 -// Select either bare metal operation or a supported RTOS -// FreeRTOS uses direct FreeRTOS calls -// CMSIS-RTOS1 supports only Keil RTX through API v1 -// CMSIS-RTOS2 supports Keil RTX5 and FreeRTOS through API v2 - -#define MG_CMSISPACK_ARCH 3 - - -// Networking support -// Networking stack -// <0=> Built-in -// <1=> lwIP -// <2=> FreeRTOS-Plus-TCP -// <3=> MDK (RL) -// Select the networking stack to use with Mongoose Library -// The built-in stack can run on bare metal or over any RTOS -// "lwIP" requires using an RTOS and BSD socket mode -// "MDK" requires using CMSIS-RTOS1 (RTX + RL) or CMSIS-RTOS2 (MDK Plus or Pro), and BSD socket mode -#define MG_CMSISPACK_NET 0 - -// Use Mbed-TLS -// Mongoose will use Mbed-TLS calls for TLS-related functionality -#define MG_ENABLE_MBEDTLS 0 -// +// Build environment +// Keil MDK +// FreeRTOS +// CMSIS-RTOS v1 +// CMSIS-RTOS v2 +// ARM GCC + Newlib +#define MG_ARCH MG_ARCH_CMSIS_RTOS2 +// Enable builtin TCP/IP stack +#define MG_ENABLE_TCPIP 1 -// Enable custom mg_millis() -// Use a user-provided function to get uptime in milliseconds, otherwise Mongoose will default to using time(). Except for bare metal, Mongoose will use the time base for the configured architecture -//#define MG_ENABLE_CUSTOM_MILLIS 1 -// +// Network Drivers for builtin TCP/IP stack +// Enable STM23Fxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32F 1 +// Enable STM32Hxx Ethernet driver +#define MG_ENABLE_DRIVER_STM32H 0 -// Enable custom mg_rand() -// Use a user-provided function to generate random numbers, otherwise Mongoose will default to using rand() -#define MG_ENABLE_CUSTOM_RANDOM 1 -// +// Enable IMXRT Ethernet driver +#define MG_ENABLE_DRIVER_IMXRT 0 +// Enable W5500 Ethernet driver +#define MG_ENABLE_DRIVER_W5500 0 + +// Enable TI TM4C Ethernet driver +#define MG_ENABLE_DRIVER_TM4C 0 -// Filesystem support -// Enable packed (embedded) filesystem -#define MG_ENABLE_PACKED_FS 1 // +// TLS support +// None +// Built-in TLS 1.3 stack +// MbedTLS +#define MG_TLS MG_TLS_NONE -// <<< end of configuration section >>> +// Enable custom mg_millis() +#define MG_ENABLE_CUSTOM_MILLIS 0 -// Translate to Mongoose macros -#if MG_CMSISPACK_ARCH == 1 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_FREERTOS -#elif MG_CMSISPACK_ARCH == 2 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS1 -#elif MG_CMSISPACK_ARCH == 3 -#undef MG_ARCH -#define MG_ARCH MG_ARCH_CMSIS_RTOS2 -#endif -#if MG_CMSISPACK_NET == 0 -#define MG_ENABLE_TCPIP 1 -#elif MG_CMSISPACK_NET == 1 -#define MG_ENABLE_LWIP 1 -#elif MG_CMSISPACK_NET == 2 -#define MG_ENABLE_FREERTOS_TCP 1 -#elif MG_CMSISPACK_NET == 3 -#define MG_ENABLE_RL 1 -#endif +// Enable custom mg_random() +#define MG_ENABLE_CUSTOM_RANDOM 1 +// Enable packed (embedded) filesystem +#define MG_ENABLE_PACKED_FS 1 + +// <<< end of configuration section >>> // Add your customization below this comment -#define MG_ENABLE_DRIVER_STM32F 1 + diff --git a/mongoose.h b/mongoose.h index 60362d5063..83f14b5930 100644 --- a/mongoose.h +++ b/mongoose.h @@ -61,16 +61,12 @@ extern "C" { #define MG_ARCH MG_ARCH_AZURERTOS #elif defined(PICO_TARGET_NAME) #define MG_ARCH MG_ARCH_RP2040 -#elif defined(__ARMCC_VERSION) -#define MG_ARCH MG_ARCH_ARMCC #elif defined(__RTTHREAD__) #define MG_ARCH MG_ARCH_RTTHREAD #endif #endif // !defined(MG_ARCH) -// if the user did not specify an MG_ARCH, or specified a custom one, OR -// we guessed a known IDE, pull the customized config (Configuration Wizard) -#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM) || MG_ARCH == MG_ARCH_ARMCC +#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM) #include "mongoose_custom.h" // keep this include #endif @@ -188,6 +184,7 @@ extern "C" { #if defined(__ARMCC_VERSION) #define mode_t size_t #include +#include #else #include #endif @@ -293,6 +290,7 @@ int mkdir(const char *, mode_t); #include #include #include +#include #include #include #if MG_ARCH == MG_ARCH_CMSIS_RTOS1 diff --git a/src/arch.h b/src/arch.h index a9bc24b083..cf93f31db4 100644 --- a/src/arch.h +++ b/src/arch.h @@ -34,16 +34,12 @@ #define MG_ARCH MG_ARCH_AZURERTOS #elif defined(PICO_TARGET_NAME) #define MG_ARCH MG_ARCH_RP2040 -#elif defined(__ARMCC_VERSION) -#define MG_ARCH MG_ARCH_ARMCC #elif defined(__RTTHREAD__) #define MG_ARCH MG_ARCH_RTTHREAD #endif #endif // !defined(MG_ARCH) -// if the user did not specify an MG_ARCH, or specified a custom one, OR -// we guessed a known IDE, pull the customized config (Configuration Wizard) -#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM) || MG_ARCH == MG_ARCH_ARMCC +#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM) #include "mongoose_custom.h" // keep this include #endif diff --git a/src/arch_freertos.h b/src/arch_freertos.h index 345c0db4fc..883e996aa5 100644 --- a/src/arch_freertos.h +++ b/src/arch_freertos.h @@ -16,6 +16,7 @@ #if defined(__ARMCC_VERSION) #define mode_t size_t #include +#include #else #include #endif diff --git a/src/arch_rtx.h b/src/arch_rtx.h index c649d62c9c..e39a871e30 100644 --- a/src/arch_rtx.h +++ b/src/arch_rtx.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #if MG_ARCH == MG_ARCH_CMSIS_RTOS1