mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-19 16:29:31 +00:00
remove FreeRTOS dependency from STM32 build; disable debugging to preserve FLASH space
LittleFS mutex routines are stubs and malloc()/free() are the stdlib versions
This commit is contained in:
parent
8455defa7a
commit
694f012dd0
@ -9,7 +9,6 @@ build_type = release
|
||||
|
||||
build_flags =
|
||||
${arduino_base.build_flags}
|
||||
-Wl,--undefined=vTaskSwitchContext
|
||||
-flto
|
||||
-Isrc/platform/stm32wl -g
|
||||
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
@ -21,7 +20,7 @@ build_flags =
|
||||
-DMESHTASTIC_EXCLUDE_BLUETOOTH
|
||||
-DMESHTASTIC_EXCLUDE_PKI
|
||||
-DMESHTASTIC_EXCLUDE_GPS
|
||||
-DconfigUSE_CMSIS_RTOS_V2=1
|
||||
-DDEBUG_MUTE
|
||||
-fmerge-all-constants
|
||||
-ffunction-sections
|
||||
-fdata-sections
|
||||
@ -31,11 +30,11 @@ build_src_filter =
|
||||
|
||||
board_upload.offset_address = 0x08000000
|
||||
upload_protocol = stlink
|
||||
debug_tool = stlink
|
||||
|
||||
lib_deps =
|
||||
${env.lib_deps}
|
||||
${radiolib_base.lib_deps}
|
||||
stm32duino/STM32duino FreeRTOS@^10.3.2
|
||||
https://github.com/caveman99/Crypto.git#eae9c768054118a9399690f8af202853d1ae8516
|
||||
|
||||
lib_ignore =
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <freertos/task.h>
|
||||
#endif
|
||||
|
||||
#if defined(ARDUINO_NRF52_ADAFRUIT) || defined(ARDUINO_ARCH_RP2040) || defined(STM32WLE5xx)
|
||||
#if defined(ARDUINO_NRF52_ADAFRUIT) || defined(ARDUINO_ARCH_RP2040)
|
||||
#define HAS_FREE_RTOS
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
|
@ -42,7 +42,6 @@ STM32_LittleFS::STM32_LittleFS(struct lfs_config *cfg)
|
||||
varclr(&_lfs);
|
||||
_lfs_cfg = cfg;
|
||||
_mounted = false;
|
||||
_mutex = xSemaphoreCreateMutexStatic(&this->_MutexStorageSpace);
|
||||
}
|
||||
|
||||
STM32_LittleFS::~STM32_LittleFS() {}
|
||||
|
@ -76,17 +76,13 @@ class STM32_LittleFS
|
||||
* code. User should not call these directly
|
||||
*------------------------------------------------------------------*/
|
||||
lfs_t *_getFS(void) { return &_lfs; }
|
||||
void _lockFS(void) { xSemaphoreTake(_mutex, portMAX_DELAY); }
|
||||
void _unlockFS(void) { xSemaphoreGive(_mutex); }
|
||||
void _lockFS(void) { /* no-op */ }
|
||||
void _unlockFS(void) { /* no-op */ }
|
||||
|
||||
protected:
|
||||
bool _mounted;
|
||||
struct lfs_config *_lfs_cfg;
|
||||
lfs_t _lfs;
|
||||
SemaphoreHandle_t _mutex;
|
||||
|
||||
private:
|
||||
StaticSemaphore_t _MutexStorageSpace;
|
||||
};
|
||||
|
||||
#if !CFG_DEBUG
|
||||
|
@ -174,8 +174,7 @@ void lfs_crc(uint32_t *crc, const void *buffer, size_t size);
|
||||
static inline void *lfs_malloc(size_t size)
|
||||
{
|
||||
#ifndef LFS_NO_MALLOC
|
||||
extern void *pvPortMalloc(size_t xWantedSize);
|
||||
return pvPortMalloc(size);
|
||||
return malloc(size);
|
||||
#else
|
||||
(void)size;
|
||||
return NULL;
|
||||
@ -186,8 +185,7 @@ static inline void *lfs_malloc(size_t size)
|
||||
static inline void lfs_free(void *p)
|
||||
{
|
||||
#ifndef LFS_NO_MALLOC
|
||||
extern void vPortFree(void *pv);
|
||||
vPortFree(p);
|
||||
free(p);
|
||||
#else
|
||||
(void)p;
|
||||
#endif
|
||||
|
@ -21,6 +21,8 @@ build_flags =
|
||||
-DMESHTASTIC_EXCLUDE_SCREEN=1
|
||||
-DMESHTASTIC_EXCLUDE_MQTT=1
|
||||
-DMESHTASTIC_EXCLUDE_POWERMON=1
|
||||
-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF
|
||||
-DMESHTASTIC_EXCLUDE_PKI
|
||||
;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF
|
||||
;-DCFG_DEBUG
|
||||
|
||||
upload_port = stlink
|
Loading…
Reference in New Issue
Block a user