From 873b862edd8964bc2fa14a13a2d7105417de2285 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 4 Dec 2023 08:08:46 +1100 Subject: [PATCH 1/2] AP_Networking: fixed off by one error in cache size calculation this caused some of the memory to be cacheable which led to TCP checksum errors --- libraries/AP_Networking/AP_Networking_ChibiOS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Networking/AP_Networking_ChibiOS.cpp b/libraries/AP_Networking/AP_Networking_ChibiOS.cpp index 692ca988fc186..ea5e4f42a6b0e 100644 --- a/libraries/AP_Networking/AP_Networking_ChibiOS.cpp +++ b/libraries/AP_Networking/AP_Networking_ChibiOS.cpp @@ -37,7 +37,7 @@ bool AP_Networking_ChibiOS::allocate_buffers() sizeof(uint32_t)*STM32_MAC_TRANSMIT_BUFFERS*AP_NETWORKING_EXTERN_MAC_BUFFER_SIZE; // typically == 9240 // ensure that we allocate 32-bit aligned memory, and mark it non-cacheable - uint32_t size = 2; + uint32_t size = 1; uint8_t rasr = 0; // find size closest to power of 2 while (size < total_size) { From 20835d8716dd480d80d2a884a7613351f9d2ff05 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 4 Dec 2023 08:09:22 +1100 Subject: [PATCH 2/2] AP_Vehicle: init networking after serial manager init before serial manager led to not seeing any error messages if net init failed --- libraries/AP_Vehicle/AP_Vehicle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Vehicle/AP_Vehicle.cpp b/libraries/AP_Vehicle/AP_Vehicle.cpp index 0635dc8368cf9..dd0b1576ffb16 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.cpp +++ b/libraries/AP_Vehicle/AP_Vehicle.cpp @@ -313,16 +313,16 @@ void AP_Vehicle::setup() gcs().init(); #endif -#if AP_NETWORKING_ENABLED - networking.init(); -#endif - // initialise serial ports serial_manager.init(); #if HAL_GCS_ENABLED gcs().setup_console(); #endif +#if AP_NETWORKING_ENABLED + networking.init(); +#endif + // Register scheduler_delay_cb, which will run anytime you have // more than 5ms remaining in your call to hal.scheduler->delay hal.scheduler->register_delay_callback(scheduler_delay_callback, 5);