From eb994266a1fc81d01f1d2b1271b65c32c3b5fd27 Mon Sep 17 00:00:00 2001 From: Ozan Durgut Date: Sat, 11 Apr 2026 15:51:58 +0200 Subject: [PATCH] board/stm32f7: remove AI activations buffer reservation Remove dedicated AI activations buffer from SDRAM memory layout. This eliminates the AI_ACTIVATIONS_RESERVED_SIZE define and the intermediate offset calculation. Now, memory pool start immediately after the framebuffer instead of reserving an additional 1.5MB gap for AI model activations. Signed-off-by: Ozan Durgut --- board/stm32f7/board_stm32f7_memory.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/board/stm32f7/board_stm32f7_memory.c b/board/stm32f7/board_stm32f7_memory.c index b653aa3..2097942 100755 --- a/board/stm32f7/board_stm32f7_memory.c +++ b/board/stm32f7/board_stm32f7_memory.c @@ -17,16 +17,8 @@ // Reserve 512KB (0x80000) to be safe #define CAMERA_LCD_FRAMEBUFFER_SIZE 0x80000 // 512KB reserved - // AI activations buffer at 0xC0080000 - 0xC01FFFFF (~1.5MB reserved) - // #define AI_ACTIVATIONS_RESERVED_SIZE 0x180000 // 1.5MB for AI model - #define AI_ACTIVATIONS_RESERVED_SIZE 0x0 // 0MB for AI model - - // Memory pool starts AFTER Camera/LCD framebuffer AND AI activations to avoid overlap - // Memory layout: 0xC0000000: LCD (512KB) | 0xC0080000: AI (1.5MB) | 0xC0200000: embedDIP pool - // Dynamic image allocations start from 0xC0200000 onwards (~6MB remaining) - #define MEMORY_POOL_START_OFFSET (CAMERA_LCD_FRAMEBUFFER_SIZE + AI_ACTIVATIONS_RESERVED_SIZE) - #define MEMORY_POOL_SIZE (1024 * 1024 * 8 - MEMORY_POOL_START_OFFSET) // ~6MB -static uint8_t *memory_pool = ((uint8_t *)SDRAM_BANK_ADDR + MEMORY_POOL_START_OFFSET); + #define MEMORY_POOL_SIZE (1024 * 1024 * 8 - CAMERA_LCD_FRAMEBUFFER_SIZE) // ~6MB +static uint8_t *memory_pool = ((uint8_t *)SDRAM_BANK_ADDR + CAMERA_LCD_FRAMEBUFFER_SIZE); typedef struct MemoryBlock { size_t size;