diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvoptx
index 5512c36d..32f2a4be 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvoptx
@@ -236,6 +236,221 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U066BFF514982494867132513 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 0
+ 1
+ s_netif
+
+
+ 1
+ 1
+ eth0_status
+
+
+
+
+ 1
+ 0
+ 0x20010850
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.5.1\CMSIS\RTOS2\FreeRTOS\FreeRTOS.scvd
+ ARM.CMSIS-FreeRTOS.10.5.1
+ 1
+
+
+ 0
+
+
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+ OS Support\Event Viewer
+ 35904
+
+
+ OS Support\System and Thread Viewer
+ 35905
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvprojx
index 341600c6..3872f899 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/device-dashboard.uvprojx
@@ -460,6 +460,460 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+ 0
+ $$Device:STM32F746ZGTx$Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h
+
+
+
+
+
+
+
+
+
+ $$Device:STM32F746ZGTx$CMSIS\SVD\STM32F746.svd
+ 0
+ 0
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 1
+
+ .\Objects\
+ firmware
+ 1
+ 0
+ 1
+ 1
+ 1
+ .\Listings\
+ 1
+ 0
+ 0
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+ 0
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 3
+
+
+ 1
+
+
+ SARMCM3.DLL
+ -REMAP -MPU
+ DCM.DLL
+ -pCM7
+ SARMCM3.DLL
+ -MPU
+ TCM.DLL
+ -pCM7
+
+
+
+ 1
+ 0
+ 0
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wundef -Wshadow -Wdouble-promotion -Wno-unused-parameter -Wconversion -Wno-sign-conversion -Wno-implicit-int-conversion -Wno-format-security -fno-common -fdata-sections
+ HTTP_URL=\"http://0.0.0.0/\" UART_DEBUG=USART1
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20010000
+
+
+
+
+ --diag_suppress 6918
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::CMSIS Driver
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::Network
+
+
+ ::RTOS
+
+
+
@@ -467,6 +921,7 @@
+
@@ -475,18 +930,21 @@
+
+
+
@@ -495,132 +953,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -631,6 +1111,7 @@
+
@@ -639,6 +1120,7 @@
+
@@ -647,6 +1129,7 @@
+
@@ -655,6 +1138,7 @@
+
@@ -663,9 +1147,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/hal.h b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/hal.h
index c938e339..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,6 +6,38 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
+#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
+
+// Helper macro for MAC generation
+#define GENERATE_LOCALLY_ADMINISTERED_MAC() \
+ { \
+ 2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
+ UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
+ }
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/main.c b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/main.c
index 705245e3..c1351648 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/main.c
@@ -93,6 +93,8 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
+
// Start tasks. NOTE: stack sizes are in 32-bit words
xTaskCreate(blinker, "blinker", 128, ":)", configMAX_PRIORITIES - 1, NULL);
xTaskCreate(app_main, "app_main", 128, 0, configMAX_PRIORITIES - 1, NULL);
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/syscalls.c b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-lwip/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-lwip/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvoptx
index 19346ae4..47fb9999 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvoptx
@@ -221,6 +221,206 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=561,219,750,555,0)(1008=-1,-1,-1,-1,0)(6016=21,136,279,789,1)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 0
+ 1
+ errno
+
+
+
+
+ 1
+ 0
+ 0x20013AD0
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.5.1\CMSIS\RTOS2\FreeRTOS\FreeRTOS.scvd
+ ARM.CMSIS-FreeRTOS.10.5.1
+ 1
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvprojx
index 32796d4c..73caedbd 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/device-dashboard.uvprojx
@@ -467,6 +467,467 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("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
+
+
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ FreeRTOSIPConfig.h
+ 5
+ .\FreeRTOSIPConfig.h
+
+
+ phyHandling.c
+ 1
+ .\phyHandling.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::FreeRTOS
+
+
+ ::RTOS
+
+
+
@@ -474,6 +935,7 @@
+
@@ -482,6 +944,7 @@
+
@@ -490,114 +953,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -608,6 +1090,7 @@
+
@@ -616,6 +1099,7 @@
+
@@ -624,6 +1108,7 @@
+
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/hal.h b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/hal.h
index 8401fe4b..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,11 +6,6 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
-#endif
-
-
#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
// Helper macro for MAC generation
@@ -19,3 +14,30 @@
2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
}
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/main.c b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/main.c
index 1e19f5e6..e54522ce 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/main.c
@@ -66,6 +66,8 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
+
uint8_t macaddr[6] = GENERATE_LOCALLY_ADMINISTERED_MAC();
// required for fallback if DHCP fails
static const uint8_t ipaddr[4] = {192, 168, 0, 77};
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/syscalls.c b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos-tcp/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos-tcp/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvoptx
index 1c087503..eb963969 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvoptx
@@ -243,6 +243,228 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=561,219,750,555,0)(1008=-1,-1,-1,-1,0)(6016=21,136,279,789,1)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+ 0
+ 0
+ 98
+ 1
+ 134248896
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ .\main.c
+
+ \\device_dashboard\main.c\98
+
+
+
+
+ 0
+ 1
+ stack[6]
+
+
+ 1
+ 1
+ huart3
+
+
+
+
+ 1
+ 0
+ 0x20013AD0
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.5.1\CMSIS\RTOS2\FreeRTOS\FreeRTOS.scvd
+ ARM.CMSIS-FreeRTOS.10.5.1
+ 1
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvprojx
index e3ef9fac..e658ed29 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos/device-dashboard.uvprojx
@@ -454,6 +454,454 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+ 0
+ $$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0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20010000
+ 0x40000
+
+
+ 1
+ 0x8000000
+ 0x100000
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x8000000
+ 0x100000
+
+
+ 1
+ 0x200000
+ 0x100000
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20010000
+ 0x40000
+
+
+ 0
+ 0x20000000
+ 0x10000
+
+
+
+
+
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+
+ -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion -Wno-unused-parameter -Wconversion -Wno-sign-conversion -Wno-implicit-int-conversion -fno-common -fdata-sections
+ HTTP_URL=\"http://0.0.0.0/\" UART_DEBUG=USART1
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20010000
+
+
+
+
+
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::RTOS
+
+
+
@@ -461,6 +909,7 @@
+
@@ -469,6 +918,7 @@
+
@@ -477,90 +927,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -571,6 +1036,7 @@
+
@@ -579,6 +1045,7 @@
+
@@ -587,9 +1054,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos/hal.h b/examples/stm32/nucleo-f746zg-keil-freertos/hal.h
index 8401fe4b..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-freertos/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,11 +6,6 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
-#endif
-
-
#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
// Helper macro for MAC generation
@@ -19,3 +14,30 @@
2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
}
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos/main.c b/examples/stm32/nucleo-f746zg-keil-freertos/main.c
index efd63c8f..0c77f4a9 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos/main.c
@@ -78,6 +78,7 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
// Start tasks. NOTE: stack sizes are in 32-bit words
xTaskCreate(blinker, "blinker", 128, ":)", configMAX_PRIORITIES - 1, NULL);
xTaskCreate(server, "server", 2048, 0, configMAX_PRIORITIES - 1, NULL);
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos/syscalls.c b/examples/stm32/nucleo-f746zg-keil-freertos/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvoptx
index d3e9d885..4a9fee0f 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvoptx
@@ -236,6 +236,221 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U066BFF514982494867132513 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 0
+ 1
+ s_netif
+
+
+ 1
+ 1
+ eth0_status
+
+
+
+
+ 1
+ 0
+ 0x20010850
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.5.1\CMSIS\RTOS2\FreeRTOS\FreeRTOS.scvd
+ ARM.CMSIS-FreeRTOS.10.5.1
+ 1
+
+
+ 0
+
+
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+ OS Support\Event Viewer
+ 35904
+
+
+ OS Support\System and Thread Viewer
+ 35905
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvprojx
index 287c0f45..efea8fb0 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/device-dashboard.uvprojx
@@ -460,6 +460,460 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+ 0
+ $$Device:STM32F746ZGTx$Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h
+
+
+
+
+
+
+
+
+
+ $$Device:STM32F746ZGTx$CMSIS\SVD\STM32F746.svd
+ 0
+ 0
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 1
+
+ .\Objects\
+ firmware
+ 1
+ 0
+ 1
+ 1
+ 1
+ .\Listings\
+ 1
+ 0
+ 0
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+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
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20010000
+ 0x40000
+
+
+ 0
+ 0x20000000
+ 0x10000
+
+
+
+
+
+ 1
+ 6
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+
+ -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion -Wno-unused-parameter -Wconversion -Wno-sign-conversion -Wno-implicit-int-conversion -fno-common -fdata-sections
+ HTTP_URL=\"http://0.0.0.0/\" UART_DEBUG=USART1
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20010000
+
+
+
+
+ --diag_suppress 6918
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::CMSIS Driver
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::Network
+
+
+ ::RTOS
+
+
+
@@ -467,6 +921,7 @@
+
@@ -475,24 +930,28 @@
+
+
+
+
@@ -501,156 +960,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -661,6 +1146,7 @@
+
@@ -669,6 +1155,7 @@
+
@@ -677,6 +1164,7 @@
+
@@ -685,6 +1173,7 @@
+
@@ -693,9 +1182,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/hal.h b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/hal.h
index c938e339..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,6 +6,38 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
+#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
+
+// Helper macro for MAC generation
+#define GENERATE_LOCALLY_ADMINISTERED_MAC() \
+ { \
+ 2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
+ UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
+ }
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/main.c b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/main.c
index 2f91acbd..980c6c01 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/main.c
@@ -89,6 +89,8 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
+
osKernelInitialize(); // Initialize CMSIS-RTOS
osThreadNew(blinker, NULL, NULL); // Create the blinker thread with a default stack size
osThreadNew(app_main, NULL, NULL); // Create the thread that will start networking, use a default stack size
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/syscalls.c b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2-lwip/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvoptx
index ff9d566b..f6fb2454 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvoptx
@@ -214,6 +214,199 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 1
+ 0
+ 0x20000000
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS-FreeRTOS\10.5.1\CMSIS\RTOS2\FreeRTOS\FreeRTOS.scvd
+ ARM.CMSIS-FreeRTOS.10.5.1
+ 1
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvprojx
index 2e9edab8..1d177d51 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/device-dashboard.uvprojx
@@ -454,6 +454,454 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+ 0
+ $$Device:STM32F746ZGTx$Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h
+
+
+
+
+
+
+
+
+
+ $$Device:STM32F746ZGTx$CMSIS\SVD\STM32F746.svd
+ 0
+ 0
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 1
+
+ .\Objects\
+ firmware
+ 1
+ 0
+ 1
+ 1
+ 1
+ .\Listings\
+ 1
+ 0
+ 0
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+ 0
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 3
+
+
+ 1
+
+
+ SARMCM3.DLL
+ -REMAP -MPU
+ DCM.DLL
+ -pCM7
+ SARMCM3.DLL
+ -MPU
+ TCM.DLL
+ -pCM7
+
+
+
+ 1
+ 0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Wextra -Wundef -Wshadow -Wdouble-promotion -Wno-unused-parameter -Wconversion -Wno-sign-conversion -fno-common -fdata-sections
+ HTTP_URL=\"http://0.0.0.0/\" UART_DEBUG=USART1
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20010000
+
+
+
+
+
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::RTOS
+
+
+
@@ -461,6 +909,7 @@
+
@@ -469,12 +918,14 @@
+
+
@@ -483,114 +934,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -601,6 +1071,7 @@
+
@@ -609,6 +1080,7 @@
+
@@ -617,9 +1089,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/hal.h b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/hal.h
index 8401fe4b..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,11 +6,6 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
-#endif
-
-
#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
// Helper macro for MAC generation
@@ -19,3 +14,30 @@
2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
}
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/main.c b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/main.c
index 1abab578..0d7fbb7f 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/main.c
@@ -70,6 +70,7 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
osKernelInitialize(); // Initialize CMSIS-RTOS
osThreadNew(blinker, NULL,
NULL); // Create the blinker thread with a default stack size
diff --git a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/syscalls.c b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-freertos_cmsis2/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvoptx
index 5bcf37c5..0c7f31fa 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvoptx
@@ -25,6 +25,206 @@
Target 1
0x4
ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=44,510,420,746,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 0
+ 1
+ buf
+
+
+
+
+ 1
+ 0
+ 0x20010E40
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\Keil\MDK-Middleware\7.16.0\Network\Network.scvd
+ Keil.MDK-Middleware.7.16.0
+ 1
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
+
+ Test
+ 0x4
+ ARM-ADS
16000000
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvprojx
index fad95be8..651d2557 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/device-dashboard.uvprojx
@@ -457,6 +457,457 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS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.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::CMSIS Driver
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::Network
+
+
+
@@ -464,6 +915,7 @@
+
@@ -472,24 +924,28 @@
+
+
+
+
@@ -498,126 +954,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -628,6 +1105,7 @@
+
@@ -636,6 +1114,7 @@
+
@@ -644,6 +1123,7 @@
+
@@ -652,6 +1132,7 @@
+
@@ -660,6 +1141,7 @@
+
@@ -668,6 +1150,7 @@
+
@@ -676,6 +1159,7 @@
+
@@ -684,9 +1168,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/hal.h b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/hal.h
index c938e339..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,6 +6,38 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
+#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
+
+// Helper macro for MAC generation
+#define GENERATE_LOCALLY_ADMINISTERED_MAC() \
+ { \
+ 2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
+ UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
+ }
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/main.c b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/main.c
index 50f31e55..7f0bf6e0 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/main.c
@@ -76,6 +76,8 @@ int main(void) { // this is not actually baremetal main() but the "main" thread
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
+
osThreadCreate(osThread(blinker), NULL); // Create the blinker thread
s_am = osThreadCreate(osThread(app_main), NULL); // Create the network start thread
osKernelStart(); // Start kernel again and exit main thread
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/syscalls.c b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx-mdk/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx-mdk/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvoptx
index 2e8fb98a..4745c9ab 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvoptx
@@ -216,6 +216,201 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=44,510,420,746,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 0
+ 1
+ buf
+
+
+
+
+ 1
+ 0
+ 0x20010E40
+ 0
+
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvprojx
index 2bb7f540..3a645faa 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx/device-dashboard.uvprojx
@@ -451,6 +451,451 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+ 0
+ $$Device:STM32F746ZGTx$Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h
+
+
+
+
+
+
+
+
+
+ $$Device:STM32F746ZGTx$CMSIS\SVD\STM32F746.svd
+ 0
+ 0
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 1
+
+ .\Objects\
+ firmware
+ 1
+ 0
+ 1
+ 1
+ 1
+ .\Listings\
+ 1
+ 0
+ 0
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+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
+ 0x0
+
+
+ 0
+ 0x20010000
+ 0x40000
+
+
+ 0
+ 0x20000000
+ 0x10000
+
+
+
+
+
+ 1
+ 6
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+
+ -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion -Wno-unused-parameter -Wno-macro-redefined -Wconversion -Wno-sign-conversion -fno-common -fdata-sections
+ HTTP_URL=\"http://0.0.0.0/\" UART_DEBUG=USART1
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20010000
+
+
+
+
+
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+
@@ -458,6 +903,7 @@
+
@@ -466,12 +912,14 @@
+
+
@@ -480,84 +928,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -568,6 +1030,7 @@
+
@@ -576,6 +1039,7 @@
+
@@ -584,9 +1048,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx/hal.h b/examples/stm32/nucleo-f746zg-keil-rtx/hal.h
index 8401fe4b..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-rtx/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,11 +6,6 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
-#endif
-
-
#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
// Helper macro for MAC generation
@@ -19,3 +14,30 @@
2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
}
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx/main.c b/examples/stm32/nucleo-f746zg-keil-rtx/main.c
index 95a82ca7..d5fe04cb 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx/main.c
@@ -75,6 +75,7 @@ int main(void) { // this is not actually baremetal main() but the "main" thread
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
osThreadCreate(osThread(blinker), NULL); // Create the blinker thread
osThreadCreate(osThread(server), NULL); // Create the server thread
osKernelStart(); // Start kernel again and exit main thread
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx/syscalls.c b/examples/stm32/nucleo-f746zg-keil-rtx/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvoptx
index 71c32101..abb05405 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvoptx
@@ -226,6 +226,211 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U066BFF514982494867132513 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 0
+ 1
+ s_netif
+
+
+ 1
+ 1
+ eth0_status
+
+
+
+
+ 1
+ 0
+ 0x20010850
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\RTOS2\RTX\RTX5.scvd
+ ARM.CMSIS.5.9.0
+ 1
+
+
+ 0
+
+
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvprojx
index 229c6ea8..da08ef31 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/device-dashboard.uvprojx
@@ -457,6 +457,457 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IRO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suppress 6918
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::CMSIS Driver
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::Network
+
+
+
@@ -464,6 +915,7 @@
+
@@ -472,24 +924,28 @@
+
+
+
+
@@ -498,126 +954,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -628,6 +1105,7 @@
+
@@ -636,6 +1114,7 @@
+
@@ -644,6 +1123,7 @@
+
@@ -652,6 +1132,7 @@
+
@@ -660,6 +1141,7 @@
+
@@ -668,9 +1150,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/hal.h b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/hal.h
index c938e339..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,6 +6,38 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
+#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
+
+// Helper macro for MAC generation
+#define GENERATE_LOCALLY_ADMINISTERED_MAC() \
+ { \
+ 2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
+ UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
+ }
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/main.c b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/main.c
index fa063462..62103e58 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/main.c
@@ -90,6 +90,8 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
+
osKernelInitialize(); // Initialize CMSIS-RTOS
osThreadNew(blinker, NULL, NULL); // Create the blinker thread with a default stack size
osThreadNew(app_main, NULL, NULL); // Create the thread that will start networking, use a default stack size
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/syscalls.c b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-lwip/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvoptx
index 68f145cb..08ed511c 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvoptx
@@ -219,6 +219,204 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+
+ 1
+ 0
+ 0x20017800
+ 0
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\RTOS2\RTX\RTX5.scvd
+ ARM.CMSIS.5.9.0
+ 1
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\Keil\MDK-Middleware\7.16.0\Network\Network.scvd
+ Keil.MDK-Middleware.7.16.0
+ 1
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvprojx
index 9cb8cc31..19a0a2a7 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/device-dashboard.uvprojx
@@ -457,6 +457,457 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZG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 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20010000
+ 0x40000
+
+
+ 1
+ 0x8000000
+ 0x100000
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x0
+ 0x0
+
+
+ 1
+ 0x8000000
+ 0x100000
+
+
+ 1
+ 0x200000
+ 0x100000
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20010000
+ 0x40000
+
+
+ 0
+ 0x20000000
+ 0x10000
+
+
+
+
+
+ 1
+ 6
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+
+ -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion -Wno-unused-parameter -Wconversion -Wno-sign-conversion -fno-common -fdata-sections
+ HTTP_URL=\"http://0.0.0.0/\" UART_DEBUG=USART1
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20010000
+
+
+
+
+ --diag_suppress 6918
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::CMSIS Driver
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+ ::Network
+
+
+
@@ -464,6 +915,7 @@
+
@@ -472,24 +924,28 @@
+
+
+
+
@@ -498,126 +954,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -628,6 +1105,7 @@
+
@@ -636,6 +1114,7 @@
+
@@ -644,6 +1123,7 @@
+
@@ -652,6 +1132,7 @@
+
@@ -660,6 +1141,7 @@
+
@@ -668,6 +1150,7 @@
+
@@ -676,6 +1159,7 @@
+
@@ -684,6 +1168,7 @@
+
@@ -692,9 +1177,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/hal.h b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/hal.h
index c938e339..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,6 +6,38 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
+#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
+
+// Helper macro for MAC generation
+#define GENERATE_LOCALLY_ADMINISTERED_MAC() \
+ { \
+ 2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
+ UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
+ }
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/main.c b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/main.c
index 2112b08d..47a79360 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/main.c
@@ -75,6 +75,8 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
+
osKernelInitialize(); // Initialize CMSIS-RTOS
osThreadNew(blinker, NULL, NULL); // Create the blinker thread with a default stack size
s_am = osThreadNew(app_main, NULL, NULL); // Create the thread that will start networking, use a default stack size
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/syscalls.c b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5-mdk/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvoptx b/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvoptx
index da1db589..63d31a6b 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvoptx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvoptx
@@ -206,6 +206,191 @@
+
+ Test
+ 0x4
+ ARM-ADS
+
+ 16000000
+
+ 1
+ 1
+ 0
+ 1
+ 0
+
+
+ 1
+ 65535
+ 0
+ 0
+ 0
+
+
+ 79
+ 66
+ 8
+ .\Listings\
+
+
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+
+
+ 1
+ 0
+ 0
+
+ 18
+
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 1
+ 0
+ 0
+ 6
+
+
+
+
+
+
+
+
+
+
+ STLink\ST-LINKIII-KEIL_SWO.dll
+
+
+
+ 0
+ ARMRTXEVENTFLAGS
+ -L70 -Z18 -C0 -M0 -T1
+
+
+ 0
+ DLGTARM
+ (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)
+
+
+ 0
+ ARMDBGFLAGS
+
+
+
+ 0
+ ST-LINKIII-KEIL_SWO
+ -U-O206 -O206 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(5BA02477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FF1STM32F7xTCM_1024.FLM -FS1200000 -FL1100000 -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM)
+
+
+ 0
+ DLGUARM
+ (105=-1,-1,-1,-1,0)
+
+
+ 0
+ UL2CM3
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+
+
+
+
+ C:\Users\scaprile\AppData\Local\Arm\Packs\ARM\CMSIS\5.9.0\CMSIS\RTOS2\RTX\RTX5.scvd
+ ARM.CMSIS.5.9.0
+ 1
+
+
+ 0
+
+
+ 0
+ 1
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ 0
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 2
+ 10000000
+
+
+
+
Source Group 1
1
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvprojx b/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvprojx
index 6ac8824e..de4acc5b 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvprojx
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5/device-dashboard.uvprojx
@@ -451,6 +451,451 @@
+
+ Test
+ 0x4
+ ARM-ADS
+ 6160000::V6.16::ARMCLANG
+ 1
+
+
+ STM32F746ZGTx
+ STMicroelectronics
+ Keil.STM32F7xx_DFP.2.15.1
+ https://www.keil.com/pack/
+ IRAM(0x20010000,0x40000) IRAM2(0x20000000,0x10000) IROM(0x08000000,0x100000) IROM2(0x00200000,0x100000) CPUTYPE("Cortex-M7") FPU3(SFPU) CLOCK(12000000) ELITTLE
+
+
+ UL2CM3(-S0 -C0 -P0 -FD20010000 -FC1000 -FN2 -FF0STM32F7x_1024 -FS08000000 -FL0100000 -FF1STM32F7xTCM_1024 -FS1200000 -FL1100000 -FP0($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7x_1024.FLM) -FP1($$Device:STM32F746ZGTx$CMSIS\Flash\STM32F7xTCM_1024.FLM))
+ 0
+ $$Device:STM32F746ZGTx$Drivers\CMSIS\Device\ST\STM32F7xx\Include\stm32f7xx.h
+
+
+
+
+
+
+
+
+
+ $$Device:STM32F746ZGTx$CMSIS\SVD\STM32F746.svd
+ 0
+ 0
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 1
+
+ .\Objects\
+ firmware
+ 1
+ 0
+ 1
+ 1
+ 1
+ .\Listings\
+ 1
+ 0
+ 0
+
+ 0
+ 0
+
+
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ 0
+
+
+ 0
+ 0
+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 0x0
+ 0x0
+
+
+ 0
+ 0x0
+ 0x0
+
+
+ 0
+ 0x20010000
+ 0x40000
+
+
+ 0
+ 0x20000000
+ 0x10000
+
+
+
+
+
+ 1
+ 6
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 0
+ 1
+ 1
+ 0
+ 1
+ 0
+
+ -W -Wall -Wextra -Wundef -Wshadow -Wdouble-promotion -Wno-unused-parameter -Wconversion -Wno-sign-conversion -fno-common -fdata-sections
+ HTTP_URL=\"http://0.0.0.0/\" UART_DEBUG=USART1
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+
+
+
+
+
+
+ 1
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0x08000000
+ 0x20010000
+
+
+
+
+
+
+
+
+
+
+
+
+ Source Group 1
+
+
+ hal.h
+ 5
+ .\hal.h
+
+
+ main.c
+ 1
+ .\main.c
+
+
+ net.c
+ 1
+ .\net.c
+
+
+ packed_fs.c
+ 1
+ .\packed_fs.c
+
+
+ syscalls.c
+ 1
+ .\syscalls.c
+
+
+ mongoose.c
+ 1
+ .\mongoose.c
+
+
+ mongoose_custom.h
+ 5
+ .\mongoose_custom.h
+
+
+
+
+ :STM32CubeMX:Common Sources
+
+
+ main.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\main.c
+
+
+ stm32f7xx_it.h
+ 5
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Inc\stm32f7xx_it.h
+
+
+ stm32f7xx_it.c
+ 1
+ .\RTE\Device\STM32F746ZGTx\STCubeGenerated\Src\stm32f7xx_it.c
+
+
+
+
+ ::CMSIS
+
+
+ ::Compiler
+
+
+ ::Device
+
+
+
@@ -458,6 +903,7 @@
+
@@ -466,12 +912,14 @@
+
+
@@ -480,84 +928,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -568,6 +1030,7 @@
+
@@ -576,6 +1039,7 @@
+
@@ -584,6 +1048,7 @@
+
@@ -592,9 +1057,19 @@
+
+
+
+
+ device-dashboard
+ 1
+
+
+
+
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5/hal.h b/examples/stm32/nucleo-f746zg-keil-rtx5/hal.h
index 8401fe4b..37ab2e10 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5/hal.h
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5/hal.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2022-23 Cesanta Software Limited
+// Copyright (c) 2023 Cesanta Software Limited
// All rights reserved
// https://www.st.com/resource/en/reference_manual/dm00124865-stm32f75xxx-and-stm32f74xxx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf
@@ -6,11 +6,6 @@
#include
-#ifndef UART_DEBUG
-#define UART_DEBUG USART3
-#endif
-
-
#define UUID ((uint8_t *) UID_BASE) // Unique 96-bit chip ID. TRM 41.1
// Helper macro for MAC generation
@@ -19,3 +14,30 @@
2, UUID[0] ^ UUID[1], UUID[2] ^ UUID[3], UUID[4] ^ UUID[5], \
UUID[6] ^ UUID[7] ^ UUID[8], UUID[9] ^ UUID[10] ^ UUID[11] \
}
+
+// For internal testing purposes
+#ifdef UART_DEBUG
+#include "main.h"
+#define BIT(x) (1UL << (x))
+static inline void test_init(void) {
+ USART_TypeDef *uart = USART1; // hardcode to USART1 PA9,10
+ uint32_t freq = SystemCoreClock / BIT(((RCC->CFGR >> 13) & 0x7) - 3);
+ __HAL_RCC_USART1_CLK_ENABLE();
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ GPIO_InitTypeDef GPIO_InitStruct = {.Pin = GPIO_PIN_10 | GPIO_PIN_9,
+ .Mode = GPIO_MODE_AF_PP,
+ .Pull = GPIO_NOPULL,
+ .Speed = GPIO_SPEED_FREQ_VERY_HIGH,
+ .Alternate = GPIO_AF7_USART1};
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ uart->CR1 = 0; // Disable this UART
+ uart->BRR = freq / 115200; // Set baud rate
+ uart->CR1 |= BIT(0) | BIT(2) | BIT(3); // Set UE, RE, TE
+}
+static inline void uart_write_byte(USART_TypeDef *uart, uint8_t byte) {
+ uart->TDR = byte;
+ while ((uart->ISR & BIT(7)) == 0) (void) 0;
+}
+#else
+#define test_init()
+#endif
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5/main.c b/examples/stm32/nucleo-f746zg-keil-rtx5/main.c
index ae2b4238..a314a7ef 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5/main.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5/main.c
@@ -70,6 +70,7 @@ int main(void) {
mx_init(); // Setup clock and all peripherals configured in CubeMX
// Initialise random number generator
// Initialise ethernet pins
+ test_init(); // for internal testing purposes only
osKernelInitialize(); // Initialize CMSIS-RTOS
osThreadNew(blinker, NULL,
NULL); // Create the blinker thread with a default stack size
diff --git a/examples/stm32/nucleo-f746zg-keil-rtx5/syscalls.c b/examples/stm32/nucleo-f746zg-keil-rtx5/syscalls.c
index 822d1f8c..d642e9de 100644
--- a/examples/stm32/nucleo-f746zg-keil-rtx5/syscalls.c
+++ b/examples/stm32/nucleo-f746zg-keil-rtx5/syscalls.c
@@ -3,8 +3,16 @@
#include "main.h"
+#ifdef UART_DEBUG // For internal testing purposes
+#include "hal.h"
+int stdout_putchar (int ch) {
+ uart_write_byte(USART1, (uint8_t) ch);
+ return ch;
+}
+#else
int stdout_putchar (int ch) {
extern UART_HandleTypeDef huart3;
HAL_UART_Transmit(&huart3, (const uint8_t *)&ch, 1, 100);
return ch;
}
+#endif