From 0eb2d0914c0e679cd813aab528dc9c93eeb52810 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sat, 29 May 2021 07:42:42 +0200 Subject: [PATCH] Use the bin allocator only on targets without SDRAM The bin allocator causes random alignment issues on these targets --- radio/src/CMakeLists.txt | 12 +++++++++--- radio/src/targets/horus/CMakeLists.txt | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 2bc8c7301..744ef4666 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -544,9 +544,15 @@ if(NOT MSVC) # Lua needs %g and %f set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -u _printf_float -u _scanf_float") endif() - # Nano's malloc does work well with lua, use our own - add_definitions(-DUSE_BIN_ALLOCATOR) - set(SRC ${SRC} bin_allocator.cpp) + if(SDRAM) + # Target with SDRAM do not need a custom allocator for now + # as the custom allocator has alignement issues + message("Target has SDRAM, do not use BIN_ALLOCATOR") + else() + # Nano's malloc does work well with lua, use our own + add_definitions(-DUSE_BIN_ALLOCATOR) + set(SRC ${SRC} bin_allocator.cpp) + endif() endif() if(OPENRC_BOOTLOADER) diff --git a/radio/src/targets/horus/CMakeLists.txt b/radio/src/targets/horus/CMakeLists.txt index 378b24fbe..c8f09b868 100644 --- a/radio/src/targets/horus/CMakeLists.txt +++ b/radio/src/targets/horus/CMakeLists.txt @@ -160,6 +160,7 @@ add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK) add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE}) add_definitions(-DPWR_BUTTON_${PWR_BUTTON}) add_definitions(-DHARDWARE_TRAINER_JACK) +set(SDRAM ON) if(DEFAULT_THEME) add_definitions(-DDEFAULT_THEME_${DEFAULT_THEME})