From 23eb7504fb38bd2d3defc201196bf44ce635839a Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 22 Oct 2022 11:17:27 +1100 Subject: [PATCH 1/8] Trimming Miniware --- source/Core/BSP/Miniware/port.c | 35 ++++++++++++++++++--------------- source/Makefile | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/source/Core/BSP/Miniware/port.c b/source/Core/BSP/Miniware/port.c index 7ee68597..125b29f5 100644 --- a/source/Core/BSP/Miniware/port.c +++ b/source/Core/BSP/Miniware/port.c @@ -189,24 +189,27 @@ StackType_t *pxPortInitialiseStack(StackType_t *pxTopOfStack, TaskFunction_t pxC /*-----------------------------------------------------------*/ static void prvTaskExitError(void) { - volatile uint32_t ulDummy = 0UL; + // volatile uint32_t ulDummy = 0UL; - /* A function that implements a task must not exit or attempt to return to - its caller as there is nothing to return to. If a task wants to exit it - should instead call vTaskDelete( NULL ). + // /* A function that implements a task must not exit or attempt to return to + // its caller as there is nothing to return to. If a task wants to exit it + // should instead call vTaskDelete( NULL ). - Artificially force an assert() to be triggered if configASSERT() is - defined, then stop here so application writers can catch the error. */ - configASSERT(uxCriticalNesting == ~0UL); - portDISABLE_INTERRUPTS(); - while (ulDummy == 0) { - /* This file calls prvTaskExitError() after the scheduler has been - started to remove a compiler warning about the function being defined - but never called. ulDummy is used purely to quieten other warnings - about code appearing after this function is called - making ulDummy - volatile makes the compiler think the function could return and - therefore not output an 'unreachable code' warning for code that appears - after it. */ + // Artificially force an assert() to be triggered if configASSERT() is + // defined, then stop here so application writers can catch the error. */ + // configASSERT(uxCriticalNesting == ~0UL); + // portDISABLE_INTERRUPTS(); + // while (ulDummy == 0) { + // /* This file calls prvTaskExitError() after the scheduler has been + // started to remove a compiler warning about the function being defined + // but never called. ulDummy is used purely to quieten other warnings + // about code appearing after this function is called - making ulDummy + // volatile makes the compiler think the function could return and + // therefore not output an 'unreachable code' warning for code that appears + // after it. */ + // } + for(;;){ + } } /*-----------------------------------------------------------*/ diff --git a/source/Makefile b/source/Makefile index 3f0064e7..ccfc9017 100644 --- a/source/Makefile +++ b/source/Makefile @@ -152,7 +152,7 @@ S_SRCS := $(shell find $(MINIWARE_STARTUP_DIR) -type f -name '*.S') LDSCRIPT=$(MINIWARE_LD_FILE) DEV_GLOBAL_DEFS= -D STM32F103T8Ux -D STM32F1 -D STM32 -D USE_HAL_DRIVER -D STM32F103xB -D USE_RTOS_SYSTICK -D GCC_ARMCM3 \ -D ARM_MATH_CM3 \ - -D STM32F10X_MD + -D STM32F10X_MD -finline-limit=9999999 DEV_LDFLAGS= -Wl,--wrap=printf -Wl,--no-wchar-size-warning DEV_AFLAGS= DEV_CFLAGS= -D VECT_TAB_OFFSET=$(bootldr_size)U From 77930a386cebbce02b13f6914ef4d24e59686d59 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 22 Oct 2022 11:23:12 +1100 Subject: [PATCH 2/8] flash api simpler Update flash.c --- source/Core/BSP/BSP_Flash.h | 2 +- source/Core/BSP/MHP30/flash.c | 5 ++--- source/Core/BSP/Miniware/flash.c | 6 +++--- source/Core/BSP/Pinecil/flash.c | 3 +-- source/Core/BSP/Pinecilv2/flash.c | 3 +-- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/source/Core/BSP/BSP_Flash.h b/source/Core/BSP/BSP_Flash.h index 0ed5f045..c1c68b5d 100644 --- a/source/Core/BSP/BSP_Flash.h +++ b/source/Core/BSP/BSP_Flash.h @@ -17,7 +17,7 @@ extern "C" { */ // Erase the flash, then save the buffer. Returns 1 if worked -uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length); +void flash_save_buffer(const uint8_t *buffer, const uint16_t length); void flash_read_buffer(uint8_t *buffer, const uint16_t length); #ifdef __cplusplus diff --git a/source/Core/BSP/MHP30/flash.c b/source/Core/BSP/MHP30/flash.c index dee6138e..75352e7d 100644 --- a/source/Core/BSP/MHP30/flash.c +++ b/source/Core/BSP/MHP30/flash.c @@ -13,7 +13,7 @@ #define SETTINGS_START_PAGE (0x08000000 + (127 * 1024)) -uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) { +void flash_save_buffer(const uint8_t *buffer, const uint16_t length) { FLASH_EraseInitTypeDef pEraseInit; pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES; pEraseInit.Banks = FLASH_BANK_1; @@ -33,10 +33,9 @@ uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) { HAL_FLASH_Unlock(); for (uint16_t i = 0; i < (length / 2); i++) { resetWatchdog(); - HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint32_t)), data[i]); + HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint16_t)), data[i]); } HAL_FLASH_Lock(); - return 1; } void flash_read_buffer(uint8_t *buffer, const uint16_t length) { memcpy(buffer, (uint8_t*)SETTINGS_START_PAGE, length); } diff --git a/source/Core/BSP/Miniware/flash.c b/source/Core/BSP/Miniware/flash.c index 17eeb1da..fd4b98bf 100644 --- a/source/Core/BSP/Miniware/flash.c +++ b/source/Core/BSP/Miniware/flash.c @@ -12,7 +12,7 @@ #define SETTINGS_START_PAGE (0x08000000 + (63 * 1024)) -uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) { +void flash_save_buffer(const uint8_t *buffer, const uint16_t length) { FLASH_EraseInitTypeDef pEraseInit; pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES; pEraseInit.Banks = FLASH_BANK_1; @@ -32,10 +32,10 @@ uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) { HAL_FLASH_Unlock(); for (uint16_t i = 0; i < (length / 2); i++) { resetWatchdog(); - HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint32_t)), data[i]); + HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint16_t)), data[i]); } HAL_FLASH_Lock(); - return 1; + } void flash_read_buffer(uint8_t *buffer, const uint16_t length) { memcpy(buffer, (uint8_t*)SETTINGS_START_PAGE, length); } diff --git a/source/Core/BSP/Pinecil/flash.c b/source/Core/BSP/Pinecil/flash.c index a6daa859..d66a3d1d 100644 --- a/source/Core/BSP/Pinecil/flash.c +++ b/source/Core/BSP/Pinecil/flash.c @@ -11,7 +11,7 @@ #include "string.h" #define FMC_PAGE_SIZE ((uint16_t)0x400U) #define SETTINGS_START_PAGE (0x08000000 + (127 * 1024)) -uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) { +void flash_save_buffer(const uint8_t *buffer, const uint16_t length) { /* unlock the flash program/erase controller */ fmc_unlock(); @@ -32,7 +32,6 @@ uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) { resetWatchdog(); } fmc_lock(); - return 1; } void flash_read_buffer(uint8_t *buffer, const uint16_t length) { diff --git a/source/Core/BSP/Pinecilv2/flash.c b/source/Core/BSP/Pinecilv2/flash.c index 38337001..071b8ce2 100644 --- a/source/Core/BSP/Pinecilv2/flash.c +++ b/source/Core/BSP/Pinecilv2/flash.c @@ -14,10 +14,9 @@ #define SETTINGS_START_PAGE (1023 * FLASH_PAGE_SIZE) // Hal auto offsets base addr -uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) { +void flash_save_buffer(const uint8_t *buffer, const uint16_t length) { BL_Err_Type err = flash_erase(SETTINGS_START_PAGE, FLASH_PAGE_SIZE); err = flash_write(SETTINGS_START_PAGE, buffer, length); - return err != SUCCESS; } void flash_read_buffer(uint8_t *buffer, const uint16_t length) { flash_read(SETTINGS_START_PAGE, buffer, length); } From 849b266d4e6f0530b0727704a2a35a5135252766 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 22 Oct 2022 11:24:29 +1100 Subject: [PATCH 3/8] Shrink HAL --- .../Inc/stm32f1xx_hal_adc.h | 10 +- .../Inc/stm32f1xx_hal_i2c.h | 26 ++-- .../Src/stm32f1xx_hal_adc.c | 126 +----------------- .../Src/stm32f1xx_hal_adc_ex.c | 40 +----- .../Src/stm32f1xx_hal_i2c.c | 78 +---------- source/Core/BSP/Miniware/stm32f1xx_it.c | 15 --- 6 files changed, 22 insertions(+), 273 deletions(-) diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h index dcd70dc3..6ba6f683 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h @@ -278,8 +278,8 @@ typedef struct { #define ADC_CHANNEL_16 ((uint32_t)(ADC_SQR3_SQ1_4)) #define ADC_CHANNEL_17 ((uint32_t)(ADC_SQR3_SQ1_4 | ADC_SQR3_SQ1_0)) -#define ADC_CHANNEL_TEMPSENSOR ADC_CHANNEL_16 /* ADC internal channel (no connection on device pin) */ -#define ADC_CHANNEL_VREFINT ADC_CHANNEL_17 /* ADC internal channel (no connection on device pin) */ +// #define ADC_CHANNEL_TEMPSENSOR ADC_CHANNEL_16 /* ADC internal channel (no connection on device pin) */ +// #define ADC_CHANNEL_VREFINT ADC_CHANNEL_17 /* ADC internal channel (no connection on device pin) */ /** * @} */ @@ -812,10 +812,6 @@ uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef *hadc); /* ADC IRQHandler and Callbacks used in non-blocking modes (Interruption and DMA) */ void HAL_ADC_IRQHandler(ADC_HandleTypeDef *hadc); -void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc); -void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef *hadc); -void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef *hadc); -void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc); /** * @} */ @@ -852,8 +848,6 @@ HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef *hadc); HAL_StatusTypeDef ADC_ConversionStop_Disable(ADC_HandleTypeDef *hadc); void ADC_StabilizationTime(uint32_t DelayUs); void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma); -void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma); -void ADC_DMAError(DMA_HandleTypeDef *hdma); /** * @} */ diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h index aea803b3..817f86e9 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h @@ -232,8 +232,8 @@ typedef struct { /** @defgroup I2C_addressing_mode I2C addressing mode * @{ */ -#define I2C_ADDRESSINGMODE_7BIT 0x00004000U -#define I2C_ADDRESSINGMODE_10BIT (I2C_OAR1_ADDMODE | 0x00004000U) +#define I2C_ADDRESSINGMODE_7BIT 0x00004000U +// #define I2C_ADDRESSINGMODE_10BIT (I2C_OAR1_ADDMODE | 0x00004000U) /** * @} */ @@ -307,17 +307,17 @@ typedef struct { /** @defgroup I2C_Flag_definition I2C Flag definition * @{ */ -#define I2C_FLAG_SMBALERT 0x00018000U -#define I2C_FLAG_TIMEOUT 0x00014000U -#define I2C_FLAG_PECERR 0x00011000U -#define I2C_FLAG_OVR 0x00010800U -#define I2C_FLAG_AF 0x00010400U -#define I2C_FLAG_ARLO 0x00010200U -#define I2C_FLAG_BERR 0x00010100U -#define I2C_FLAG_TXE 0x00010080U -#define I2C_FLAG_RXNE 0x00010040U -#define I2C_FLAG_STOPF 0x00010010U -#define I2C_FLAG_ADD10 0x00010008U +#define I2C_FLAG_SMBALERT 0x00018000U +#define I2C_FLAG_TIMEOUT 0x00014000U +#define I2C_FLAG_PECERR 0x00011000U +#define I2C_FLAG_OVR 0x00010800U +#define I2C_FLAG_AF 0x00010400U +#define I2C_FLAG_ARLO 0x00010200U +#define I2C_FLAG_BERR 0x00010100U +#define I2C_FLAG_TXE 0x00010080U +#define I2C_FLAG_RXNE 0x00010040U +#define I2C_FLAG_STOPF 0x00010010U +// #define I2C_FLAG_ADD10 0x00010008U #define I2C_FLAG_BTF 0x00010004U #define I2C_FLAG_ADDR 0x00010002U #define I2C_FLAG_SB 0x00010001U diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c index 4b829588..62eb66fd 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c @@ -1194,11 +1194,6 @@ HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef *hadc, uint32_t *pData, ui /* Set the DMA transfer complete callback */ hadc->DMA_Handle->XferCpltCallback = ADC_DMAConvCplt; - /* Set the DMA half transfer complete callback */ - hadc->DMA_Handle->XferHalfCpltCallback = ADC_DMAHalfConvCplt; - - /* Set the DMA error callback */ - hadc->DMA_Handle->XferErrorCallback = ADC_DMAError; /* Manage ADC and DMA start: ADC overrun interruption, DMA start, ADC */ /* start (in case of SW start): */ @@ -1357,8 +1352,6 @@ void HAL_ADC_IRQHandler(ADC_HandleTypeDef *hadc) { } } - /* Conversion complete callback */ - HAL_ADC_ConvCpltCallback(hadc); /* Clear regular group conversion flag */ __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_STRT | ADC_FLAG_EOC); @@ -1401,73 +1394,10 @@ void HAL_ADC_IRQHandler(ADC_HandleTypeDef *hadc) { } } - /* ========== Check Analog watchdog flags ========== */ - if (__HAL_ADC_GET_IT_SOURCE(hadc, ADC_IT_AWD)) { - if (__HAL_ADC_GET_FLAG(hadc, ADC_FLAG_AWD)) { - /* Set ADC state */ - SET_BIT(hadc->State, HAL_ADC_STATE_AWD1); - /* Level out of window callback */ - HAL_ADC_LevelOutOfWindowCallback(hadc); - - /* Clear the ADC analog watchdog flag */ - __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD); - } - } } -/** - * @brief Conversion complete callback in non blocking mode - * @param hadc: ADC handle - * @retval None - */ -__weak void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc) { - /* Prevent unused argument(s) compilation warning */ - UNUSED(hadc); - /* NOTE : This function should not be modified. When the callback is needed, - function HAL_ADC_ConvCpltCallback must be implemented in the user file. - */ -} -/** - * @brief Conversion DMA half-transfer callback in non blocking mode - * @param hadc: ADC handle - * @retval None - */ -__weak void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef *hadc) { - /* Prevent unused argument(s) compilation warning */ - UNUSED(hadc); - /* NOTE : This function should not be modified. When the callback is needed, - function HAL_ADC_ConvHalfCpltCallback must be implemented in the user file. - */ -} - -/** - * @brief Analog watchdog callback in non blocking mode. - * @param hadc: ADC handle - * @retval None - */ -__weak void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef *hadc) { - /* Prevent unused argument(s) compilation warning */ - UNUSED(hadc); - /* NOTE : This function should not be modified. When the callback is needed, - function HAL_ADC_LevelOutOfWindowCallback must be implemented in the user file. - */ -} - -/** - * @brief ADC error callback in non blocking mode - * (ADC conversion with interruption or transfer by DMA) - * @param hadc: ADC handle - * @retval None - */ -__weak void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc) { - /* Prevent unused argument(s) compilation warning */ - UNUSED(hadc); - /* NOTE : This function should not be modified. When the callback is needed, - function HAL_ADC_ErrorCallback must be implemented in the user file. - */ -} /** * @} @@ -1543,32 +1473,7 @@ HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef *hadc, ADC_ChannelConf MODIFY_REG(hadc->Instance->SMPR2, ADC_SMPR2(ADC_SMPR2_SMP0, sConfig->Channel), ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel)); } - /* If ADC1 Channel_16 or Channel_17 is selected, enable Temperature sensor */ - /* and VREFINT measurement path. */ - if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR) || (sConfig->Channel == ADC_CHANNEL_VREFINT)) { - /* For STM32F1 devices with several ADC: Only ADC1 can access internal */ - /* measurement channels (VrefInt/TempSensor). If these channels are */ - /* intended to be set on other ADC instances, an error is reported. */ - if (hadc->Instance == ADC1) { - if (READ_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE) == RESET) { - SET_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE); - - if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR)) { - /* Delay for temperature sensor stabilization time */ - /* Compute number of CPU cycles to wait for */ - wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U)); - while (wait_loop_index != 0U) { - wait_loop_index--; - } - } - } - } else { - /* Update ADC state machine to error */ - SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); - - tmp_hal_status = HAL_ERROR; - } - } + /* Process unlocked */ __HAL_UNLOCK(hadc); @@ -1802,45 +1707,16 @@ void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma) { } } - /* Conversion complete callback */ - HAL_ADC_ConvCpltCallback(hadc); } else { /* Call DMA error callback */ hadc->DMA_Handle->XferErrorCallback(hdma); } } -/** - * @brief DMA half transfer complete callback. - * @param hdma: pointer to DMA handle. - * @retval None - */ -void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma) { - /* Retrieve ADC handle corresponding to current DMA handle */ - ADC_HandleTypeDef *hadc = (ADC_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; - /* Half conversion callback */ - HAL_ADC_ConvHalfCpltCallback(hadc); -} -/** - * @brief DMA error callback - * @param hdma: pointer to DMA handle. - * @retval None - */ -void ADC_DMAError(DMA_HandleTypeDef *hdma) { - /* Retrieve ADC handle corresponding to current DMA handle */ - ADC_HandleTypeDef *hadc = (ADC_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; - /* Set ADC state */ - SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); - /* Set ADC error code to DMA error */ - SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_DMA); - - /* Error callback */ - HAL_ADC_ErrorCallback(hadc); -} /** * @} diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c index 893b798d..c696a1e5 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c @@ -661,11 +661,6 @@ HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef *hadc, uint32_t /* Set the DMA transfer complete callback */ hadc->DMA_Handle->XferCpltCallback = ADC_DMAConvCplt; - /* Set the DMA half transfer complete callback */ - hadc->DMA_Handle->XferHalfCpltCallback = ADC_DMAHalfConvCplt; - - /* Set the DMA error callback */ - hadc->DMA_Handle->XferErrorCallback = ADC_DMAError; /* Manage ADC and DMA start: ADC overrun interruption, DMA start, ADC */ /* start (in case of SW start): */ @@ -1034,11 +1029,8 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef *hadc, ADC_I MODIFY_REG(hadc->Instance->SMPR2, ADC_SMPR2(ADC_SMPR2_SMP0, sConfigInjected->InjectedChannel), ADC_SMPR2(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel)); } - /* If ADC1 InjectedChannel_16 or InjectedChannel_17 is selected, enable Temperature sensor */ - /* and VREFINT measurement path. */ - if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR) || (sConfigInjected->InjectedChannel == ADC_CHANNEL_VREFINT)) { - SET_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE); - } + + /* Configure the offset: offset enable/disable, InjectedChannel, offset value */ switch (sConfigInjected->InjectedRank) { @@ -1060,33 +1052,7 @@ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef *hadc, ADC_I break; } - /* If ADC1 Channel_16 or Channel_17 is selected, enable Temperature sensor */ - /* and VREFINT measurement path. */ - if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR) || (sConfigInjected->InjectedChannel == ADC_CHANNEL_VREFINT)) { - /* For STM32F1 devices with several ADC: Only ADC1 can access internal */ - /* measurement channels (VrefInt/TempSensor). If these channels are */ - /* intended to be set on other ADC instances, an error is reported. */ - if (hadc->Instance == ADC1) { - if (READ_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE) == RESET) { - SET_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE); - - if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR)) { - /* Delay for temperature sensor stabilization time */ - /* Compute number of CPU cycles to wait for */ - wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U)); - while (wait_loop_index != 0U) { - wait_loop_index--; - } - } - } - } else { - /* Update ADC state machine to error */ - SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); - - tmp_hal_status = HAL_ERROR; - } - } - + /* Process unlocked */ __HAL_UNLOCK(hadc); diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c index 8d3ef522..2e48a209 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c @@ -957,16 +957,7 @@ HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData /* Clear ADDR flag */ __HAL_I2C_CLEAR_ADDRFLAG(hi2c); - /* If 10bit addressing mode is selected */ - if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_10BIT) { - /* Wait until ADDR flag is set */ - if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, RESET, Timeout, tickstart) != HAL_OK) { - return HAL_TIMEOUT; - } - - /* Clear ADDR flag */ - __HAL_I2C_CLEAR_ADDRFLAG(hi2c); - } + while (hi2c->XferSize > 0U) { /* Wait until TXE flag is set */ @@ -3083,10 +3074,6 @@ void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c) { if (((sr1itflags & I2C_FLAG_SB) != RESET) && ((itsources & I2C_IT_EVT) != RESET)) { I2C_Master_SB(hi2c); } - /* ADD10 Set -------------------------------------------------------------*/ - else if (((sr1itflags & I2C_FLAG_ADD10) != RESET) && ((itsources & I2C_IT_EVT) != RESET)) { - I2C_Master_ADD10(hi2c); - } /* ADDR Set --------------------------------------------------------------*/ else if (((sr1itflags & I2C_FLAG_ADDR) != RESET) && ((itsources & I2C_IT_EVT) != RESET)) { I2C_Master_ADDR(hi2c); @@ -3760,14 +3747,6 @@ static HAL_StatusTypeDef I2C_Master_ADDR(I2C_HandleTypeDef *hi2c) { if ((hi2c->EventCount == 0U) && (CurrentMode == HAL_I2C_MODE_MEM)) { /* Clear ADDR flag */ __HAL_I2C_CLEAR_ADDRFLAG(hi2c); - } else if ((hi2c->EventCount == 0U) && (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_10BIT)) { - /* Clear ADDR flag */ - __HAL_I2C_CLEAR_ADDRFLAG(hi2c); - - /* Generate Restart */ - hi2c->Instance->CR1 |= I2C_CR1_START; - - hi2c->EventCount++; } else { if (hi2c->XferCount == 0U) { /* Clear ADDR flag */ @@ -3996,22 +3975,8 @@ static HAL_StatusTypeDef I2C_MasterRequestWrite(I2C_HandleTypeDef *hi2c, uint16_ if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_7BIT) { /* Send slave address */ hi2c->Instance->DR = I2C_7BIT_ADD_WRITE(DevAddress); - } else { - /* Send header of slave address */ - hi2c->Instance->DR = I2C_10BIT_HEADER_WRITE(DevAddress); - - /* Wait until ADD10 flag is set */ - if (I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADD10, Timeout, Tickstart) != HAL_OK) { - if (hi2c->ErrorCode == HAL_I2C_ERROR_AF) { - return HAL_ERROR; - } else { - return HAL_TIMEOUT; - } - } - - /* Send slave address */ - hi2c->Instance->DR = I2C_10BIT_ADDRESS(DevAddress); } + /* Wait until ADDR flag is set */ if (I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, Timeout, Tickstart) != HAL_OK) { @@ -4059,45 +4024,8 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_7BIT) { /* Send slave address */ hi2c->Instance->DR = I2C_7BIT_ADD_READ(DevAddress); - } else { - /* Send header of slave address */ - hi2c->Instance->DR = I2C_10BIT_HEADER_WRITE(DevAddress); - - /* Wait until ADD10 flag is set */ - if (I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADD10, Timeout, Tickstart) != HAL_OK) { - if (hi2c->ErrorCode == HAL_I2C_ERROR_AF) { - return HAL_ERROR; - } else { - return HAL_TIMEOUT; - } - } - - /* Send slave address */ - hi2c->Instance->DR = I2C_10BIT_ADDRESS(DevAddress); - - /* Wait until ADDR flag is set */ - if (I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, Timeout, Tickstart) != HAL_OK) { - if (hi2c->ErrorCode == HAL_I2C_ERROR_AF) { - return HAL_ERROR; - } else { - return HAL_TIMEOUT; - } - } - - /* Clear ADDR flag */ - __HAL_I2C_CLEAR_ADDRFLAG(hi2c); - - /* Generate Restart */ - hi2c->Instance->CR1 |= I2C_CR1_START; - - /* Wait until SB flag is set */ - if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_SB, RESET, Timeout, Tickstart) != HAL_OK) { - return HAL_TIMEOUT; - } - - /* Send header of slave address */ - hi2c->Instance->DR = I2C_10BIT_HEADER_READ(DevAddress); } + /* Wait until ADDR flag is set */ if (I2C_WaitOnMasterAddressFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, Timeout, Tickstart) != HAL_OK) { diff --git a/source/Core/BSP/Miniware/stm32f1xx_it.c b/source/Core/BSP/Miniware/stm32f1xx_it.c index ce9fa3b4..41569410 100644 --- a/source/Core/BSP/Miniware/stm32f1xx_it.c +++ b/source/Core/BSP/Miniware/stm32f1xx_it.c @@ -11,21 +11,6 @@ extern TIM_HandleTypeDef htim1; // used for the systick /* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ -void NMI_Handler(void) {} - -// We have the assembly for a breakpoint trigger here to halt the system when a debugger is connected -// Hardfault handler, often a screwup in the code -void HardFault_Handler(void) {} - -// Memory management unit had an error -void MemManage_Handler(void) {} - -// Prefetcher or busfault occured -void BusFault_Handler(void) {} - -void UsageFault_Handler(void) {} - -void DebugMon_Handler(void) {} // Systick is used by FreeRTOS tick void SysTick_Handler(void) { osSystickHandler(); } From e8fc4c0039606cdc6640b4f27115526b656b3e3e Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 22 Oct 2022 11:46:33 +1100 Subject: [PATCH 4/8] More optimisation flags --- source/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Makefile b/source/Makefile index ccfc9017..63865c9c 100644 --- a/source/Makefile +++ b/source/Makefile @@ -313,7 +313,7 @@ $(shell find $(DEVICE_BSP_DIR) -type d \( $(EXCLUDED_DIRS) \) -prune -false -o $(shell find $(SOURCE_MIDDLEWARES_DIR) -type f -name '*.cpp') # code optimisation ------------------------------------------------------------ -OPTIM=-Os -fshort-wchar -flto -finline-small-functions -findirect-inlining -fdiagnostics-color -ffunction-sections -fdata-sections -fshort-enums -fsingle-precision-constant -fno-common +OPTIM=-Os -foptimize-strlen -faggressive-loop-optimizations -fdevirtualize-at-ltrans -fmerge-all-constants -fshort-wchar -flto=8 -finline-small-functions -finline-functions -findirect-inlining -fdiagnostics-color -ffunction-sections -fdata-sections -fshort-enums -fsingle-precision-constant -fno-common -fno-math-errno -ffast-math -ffinite-math-only -fno-signed-zeros -fsingle-precision-constant # global defines --------------------------------------------------------------- GLOBAL_DEFINES += $(DEV_GLOBAL_DEFS) -D USE_RTOS_SYSTICK -D MODEL_$(model) -D VECT_TAB_OFFSET=$(bootldr_size)U -fshort-wchar From 17065a38e3697564955caeb79089eefb24119de8 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 22 Oct 2022 11:50:13 +1100 Subject: [PATCH 5/8] Remove unused --- .../STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c | 1 - .../STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c | 1 - .../STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c | 13 ------------- 3 files changed, 15 deletions(-) diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c index 62eb66fd..f29ea6c5 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c @@ -1439,7 +1439,6 @@ void HAL_ADC_IRQHandler(ADC_HandleTypeDef *hadc) { */ HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef *hadc, ADC_ChannelConfTypeDef *sConfig) { HAL_StatusTypeDef tmp_hal_status = HAL_OK; - __IO uint32_t wait_loop_index = 0U; /* Check the parameters */ assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c index c696a1e5..dc2e20e8 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c @@ -900,7 +900,6 @@ __weak void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc) { */ HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef *hadc, ADC_InjectionConfTypeDef *sConfigInjected) { HAL_StatusTypeDef tmp_hal_status = HAL_OK; - __IO uint32_t wait_loop_index = 0U; /* Check the parameters */ assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); diff --git a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c index 2e48a209..5dd8b7c7 100644 --- a/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c +++ b/source/Core/BSP/Miniware/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c @@ -309,7 +309,6 @@ static HAL_StatusTypeDef I2C_MasterTransmit_BTF(I2C_HandleTypeDef *hi2c); static HAL_StatusTypeDef I2C_MasterReceive_RXNE(I2C_HandleTypeDef *hi2c); static HAL_StatusTypeDef I2C_MasterReceive_BTF(I2C_HandleTypeDef *hi2c); static HAL_StatusTypeDef I2C_Master_SB(I2C_HandleTypeDef *hi2c); -static HAL_StatusTypeDef I2C_Master_ADD10(I2C_HandleTypeDef *hi2c); static HAL_StatusTypeDef I2C_Master_ADDR(I2C_HandleTypeDef *hi2c); /** @@ -3718,18 +3717,6 @@ static HAL_StatusTypeDef I2C_Master_SB(I2C_HandleTypeDef *hi2c) { return HAL_OK; } -/** - * @brief Handle ADD10 flag for Master - * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains - * the configuration information for I2C module - * @retval HAL status - */ -static HAL_StatusTypeDef I2C_Master_ADD10(I2C_HandleTypeDef *hi2c) { - /* Send slave address */ - hi2c->Instance->DR = I2C_10BIT_ADDRESS(hi2c->Devaddress); - - return HAL_OK; -} /** * @brief Handle ADDR flag for Master From 30ef41ad5a895a9d6912d86ece70cc92c447d828 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 22 Oct 2022 11:54:39 +1100 Subject: [PATCH 6/8] Update Makefile --- source/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Makefile b/source/Makefile index 63865c9c..e40c3461 100644 --- a/source/Makefile +++ b/source/Makefile @@ -313,7 +313,7 @@ $(shell find $(DEVICE_BSP_DIR) -type d \( $(EXCLUDED_DIRS) \) -prune -false -o $(shell find $(SOURCE_MIDDLEWARES_DIR) -type f -name '*.cpp') # code optimisation ------------------------------------------------------------ -OPTIM=-Os -foptimize-strlen -faggressive-loop-optimizations -fdevirtualize-at-ltrans -fmerge-all-constants -fshort-wchar -flto=8 -finline-small-functions -finline-functions -findirect-inlining -fdiagnostics-color -ffunction-sections -fdata-sections -fshort-enums -fsingle-precision-constant -fno-common -fno-math-errno -ffast-math -ffinite-math-only -fno-signed-zeros -fsingle-precision-constant +OPTIM=-Os -foptimize-strlen -faggressive-loop-optimizations -fdevirtualize-at-ltrans -fmerge-all-constants -fshort-wchar -flto -finline-small-functions -finline-functions -findirect-inlining -fdiagnostics-color -ffunction-sections -fdata-sections -fshort-enums -fsingle-precision-constant -fno-common -fno-math-errno -ffast-math -ffinite-math-only -fno-signed-zeros -fsingle-precision-constant # global defines --------------------------------------------------------------- GLOBAL_DEFINES += $(DEV_GLOBAL_DEFS) -D USE_RTOS_SYSTICK -D MODEL_$(model) -D VECT_TAB_OFFSET=$(bootldr_size)U -fshort-wchar From bf13020fef02236aa729bd53a4ce98e9446c7bf1 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sat, 22 Oct 2022 12:01:53 +1100 Subject: [PATCH 7/8] Remove debug output meta --- source/Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/Makefile b/source/Makefile index e40c3461..12e813c0 100644 --- a/source/Makefile +++ b/source/Makefile @@ -271,7 +271,7 @@ CPUFLAGS= -march=rv32imafc \ -mcmodel=medany -fsigned-char -fno-builtin -nostartfiles \ -DportasmHANDLE_INTERRUPT=FreeRTOS_Interrupt_Handler -DARCH_RISCV -D__RISCV_FEATURE_MVE=0 -DportUSING_MPU_WRAPPERS=0 # -DBFLB_USE_ROM_DRIVER=1 -DEV_LDFLAGS=-nostartfiles -DDEBUG +DEV_LDFLAGS=-nostartfiles DEV_AFLAGS= DEV_GLOBAL_DEFS= #Required to be turned off due to their drivers tripping warnings @@ -318,7 +318,6 @@ OPTIM=-Os -foptimize-strlen -faggressive-loop-optimizations -fdevirtualize-at-lt # global defines --------------------------------------------------------------- GLOBAL_DEFINES += $(DEV_GLOBAL_DEFS) -D USE_RTOS_SYSTICK -D MODEL_$(model) -D VECT_TAB_OFFSET=$(bootldr_size)U -fshort-wchar -DEBUG=-g3 ifdef swd_enable GLOBAL_DEFINES += -DSWD_ENABLE endif @@ -400,7 +399,6 @@ CHECKOPTIONS_C= $(CHECKOPTIONS) -Wbad-function-cast CXXFLAGS=$(DEV_CXXFLAGS) \ $(CPUFLAGS) \ - $(DEBUG) \ $(INCLUDES) \ $(GLOBAL_DEFINES) \ -D${COMPILER} \ @@ -419,7 +417,6 @@ CXXFLAGS=$(DEV_CXXFLAGS) \ CFLAGS=$(DEV_CFLAGS) \ $(CPUFLAGS) \ - $(DEBUG) \ $(INCLUDES) \ $(CHECKOPTIONS_C) \ $(GLOBAL_DEFINES) \ @@ -436,7 +433,6 @@ AFLAGS= $(CPUFLAGS) \ $(DEV_AFLAGS) \ $(GLOBAL_DEFINES) \ $(OPTIM) \ - $(DEBUG) \ $(ASM_INC) \ $(INCLUDES) @@ -546,12 +542,12 @@ Core/Gen/Translation.%.cpp $(OUTPUT_DIR)/Core/Gen/translation.files/%.pickle: .. $(OUTPUT_DIR)/Core/Gen/translation.files/%.o: Core/Gen/Translation.%.cpp @test -d $(@D) || mkdir -p $(@D) @echo Generating $@ - @$(CPP) -c $(filter-out -flto -g3,$(CXXFLAGS)) $< -o $@ + @$(CPP) -c $(filter-out -flto ,$(CXXFLAGS)) $< -o $@ $(OUTPUT_DIR)/Core/Gen/translation.files/multi.%.o: Core/Gen/Translation_multi.%.cpp @test -d $(@D) || mkdir -p $(@D) @echo Generating $@ - @$(CPP) -c $(filter-out -flto -g3,$(CXXFLAGS)) $< -o $@ + @$(CPP) -c $(filter-out -flto ,$(CXXFLAGS)) $< -o $@ $(HOST_OUTPUT_DIR)/brieflz/libbrieflz.so: Core/brieflz/brieflz.c Core/brieflz/depack.c @test -d $(@D) || mkdir -p $(@D) From 3e939a7d129f402d55702342b7af2774bfca3168 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" <5425387+Ralim@users.noreply.github.com> Date: Sat, 22 Oct 2022 12:26:57 +1100 Subject: [PATCH 8/8] Always use compressed data even for single languages (#1430) * Always use compressed data even for single languages * Update push.yml --- .github/workflows/push.yml | 2 +- source/Makefile | 25 +------------------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6bda0d65..996c9674 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Install dependencies (apk) - run: apk add --no-cache gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf newlib-arm-none-eabi findutils python3 py3-pip make git bash + run: apk add --no-cache gcc-riscv-none-elf gcc-arm-none-eabi newlib-riscv-none-elf newlib-arm-none-eabi findutils python3 py3-pip make git musl-dev clang bash clang-extra-tools - name: Install dependencies (python) run: python3 -m pip install bdflib diff --git a/source/Makefile b/source/Makefile index 12e813c0..491a38da 100644 --- a/source/Makefile +++ b/source/Makefile @@ -472,30 +472,6 @@ firmware-%: $(HEXFILE_DIR)/$(model)_%.hex $(HEXFILE_DIR)/$(model)_%.bin $(HEXFIL python3 dfuse-pack.py -b $(DEVICE_DFU_ADDRESS)@0:$< -D $(DEVICE_DFU_VID_PID) $@ $(HEXFILE_DIR)/$(model)_%.elf : \ - $(OUT_OBJS_S) $(OUT_OBJS) $(OUT_OBJS_CPP) \ - $(OUTPUT_DIR)/Core/Gen/Translation.%.o \ - $(OUTPUT_DIR)/Core/LangSupport/lang_single.o \ - Makefile $(LDSCRIPT) - @test -d $(@D) || mkdir -p $(@D) - @echo Linking $@ - @$(CPP) $(CXXFLAGS) $(OUT_OBJS_S) $(OUT_OBJS) $(OUT_OBJS_CPP) \ - $(OUTPUT_DIR)/Core/Gen/Translation.$*.o \ - $(OUTPUT_DIR)/Core/LangSupport/lang_single.o \ - $(LIBS) $(LINKER_FLAGS) -o$@ -Wl,-Map=$@.map - -$(HEXFILE_DIR)/$(model)_string_compressed_%.elf : \ - $(OUT_OBJS_S) $(OUT_OBJS) $(OUT_OBJS_CPP) \ - $(OUTPUT_DIR)/Core/Gen/Translation_brieflz.%.o \ - $(OUTPUT_DIR)/Core/LangSupport/lang_single.o \ - Makefile $(LDSCRIPT) - @test -d $(@D) || mkdir -p $(@D) - @echo Linking $@ - @$(CPP) $(CXXFLAGS) $(OUT_OBJS_S) $(OUT_OBJS) $(OUT_OBJS_CPP) \ - $(OUTPUT_DIR)/Core/Gen/Translation_brieflz.$*.o \ - $(OUTPUT_DIR)/Core/LangSupport/lang_single.o \ - $(LIBS) $(LINKER_FLAGS) -o$@ -Wl,-Map=$@.map - -$(HEXFILE_DIR)/$(model)_font_compressed_%.elf : \ $(OUT_OBJS_S) $(OUT_OBJS) $(OUT_OBJS_CPP) \ $(OUTPUT_DIR)/Core/Gen/Translation_brieflz_font.%.o \ $(OUTPUT_DIR)/Core/LangSupport/lang_single.o \ @@ -507,6 +483,7 @@ $(HEXFILE_DIR)/$(model)_font_compressed_%.elf : \ $(OUTPUT_DIR)/Core/LangSupport/lang_single.o \ $(LIBS) $(LINKER_FLAGS) -o$@ -Wl,-Map=$@.map + $(OUT_OBJS): $(OUTPUT_DIR)/%.o : %.c Makefile @test -d $(@D) || mkdir -p $(@D) @echo Compiling ${<}