diff options
author | Ben V. Brown <[email protected]> | 2022-10-20 18:06:05 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-10-20 18:06:05 +1100 |
commit | 1a3d6ba219232c8d66f0dca37d12e64ae56fa7dd (patch) | |
tree | f6b323e490273fd8e4f199fc39bde0247ade51d0 /source/Core/BSP | |
parent | 82f49b5f50dd27009f5a769d3c00fe4e00db3b41 (diff) | |
download | IronOS-1a3d6ba219232c8d66f0dca37d12e64ae56fa7dd.tar.gz IronOS-1a3d6ba219232c8d66f0dca37d12e64ae56fa7dd.zip |
Fixing up TS80P Build (#1429)
* Silence wchart warning + go back to simple size limiter
Going from smart linker file to basic #defines to make things just easier to debug
* 2 deg c increments for NTC table
* Update cmsis_gcc.h
* Drop special linker
* Update portmacro.h
* Update Makefile
Diffstat (limited to 'source/Core/BSP')
-rw-r--r-- | source/Core/BSP/MHP30/flash.c | 12 | ||||
-rw-r--r-- | source/Core/BSP/MHP30/stm32f103.ld | 11 | ||||
-rw-r--r-- | source/Core/BSP/Miniware/BSP.cpp | 37 | ||||
-rw-r--r-- | source/Core/BSP/Miniware/Vendor/CMSIS/Include/cmsis_gcc.h | 4 | ||||
-rw-r--r-- | source/Core/BSP/Miniware/flash.c | 8 | ||||
-rw-r--r-- | source/Core/BSP/Miniware/stm32f103.ld | 11 | ||||
-rw-r--r-- | source/Core/BSP/Pinecil/flash.c | 2 | ||||
-rw-r--r-- | source/Core/BSP/Pinecilv2/bl_mcu_sdk/components/freertos/portable/gcc/risc-v/bl702/portmacro.h | 1 |
8 files changed, 12 insertions, 74 deletions
diff --git a/source/Core/BSP/MHP30/flash.c b/source/Core/BSP/MHP30/flash.c index c320d687..dee6138e 100644 --- a/source/Core/BSP/MHP30/flash.c +++ b/source/Core/BSP/MHP30/flash.c @@ -10,14 +10,15 @@ #include "stm32f1xx_hal.h"
#include "string.h"
-static uint16_t settings_page[512] __attribute__((section(".settings_page")));
+#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024))
+
uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
FLASH_EraseInitTypeDef pEraseInit;
pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES;
pEraseInit.Banks = FLASH_BANK_1;
pEraseInit.NbPages = 1;
- pEraseInit.PageAddress = (uint32_t)settings_page;
+ pEraseInit.PageAddress = (uint32_t)SETTINGS_START_PAGE;
uint32_t failingAddress = 0;
resetWatchdog();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR | FLASH_FLAG_BSY);
@@ -32,13 +33,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, (uint32_t)&settings_page[i], data[i]);
+ HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint32_t)), data[i]);
}
HAL_FLASH_Lock();
return 1;
}
-void flash_read_buffer(uint8_t *buffer, const uint16_t length) {
- memset(buffer, 0, length);
- memcpy(buffer, settings_page, length);
-}
+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/MHP30/stm32f103.ld b/source/Core/BSP/MHP30/stm32f103.ld index a3a5a942..3461bb86 100644 --- a/source/Core/BSP/MHP30/stm32f103.ld +++ b/source/Core/BSP/MHP30/stm32f103.ld @@ -116,17 +116,6 @@ SECTIONS _edata = .; /* define a global symbol at data end */
} >RAM AT> ROM
- .logo_page (NOLOAD) :
- {
- . = ABSOLUTE(__FLASH_END_ADDR__ - 2048);
- KEEP (*(.logo_page*))
- } > ROM
-
- .settings_page (NOLOAD) :
- {
- . = ABSOLUTE(__FLASH_END_ADDR__ - 1024);
- KEEP (*(.settings_page*))
- } > ROM
.bss :
{
diff --git a/source/Core/BSP/Miniware/BSP.cpp b/source/Core/BSP/Miniware/BSP.cpp index f09a8ece..2cc36e6e 100644 --- a/source/Core/BSP/Miniware/BSP.cpp +++ b/source/Core/BSP/Miniware/BSP.cpp @@ -29,66 +29,29 @@ void resetWatchdog() { HAL_IWDG_Refresh(&hiwdg); } static const uint16_t NTCHandleLookup[] = {
// ADC Reading , Temp in C
29189, 0, //
- 29014, 1, //
28832, 2, //
- 28644, 3, //
28450, 4, //
- 28249, 5, //
28042, 6, //
- 27828, 7, //
27607, 8, //
- 27380, 9, //
27146, 10, //
- 26906, 11, //
26660, 12, //
- 26407, 13, //
26147, 14, //
- 25882, 15, //
25610, 16, //
- 25332, 17, //
25049, 18, //
- 24759, 19, //
24465, 20, //
- 24164, 21, //
23859, 22, //
- 23549, 23, //
23234, 24, //
- 22915, 25, //
22591, 26, //
- 22264, 27, //
21933, 28, //
- 21599, 29, //
21261, 30, //
- 20921, 31, //
20579, 32, //
- 20234, 33, //
19888, 34, //
- 19541, 35, //
19192, 36, //
- 18843, 37, //
18493, 38, //
- 18143, 39, //
17793, 40, //
- 17444, 41, //
17096, 42, //
- 16750, 43, //
16404, 44, //
16061, 45, //
- // 15719, 46, //
- // 15380, 47, //
- // 15044, 48, //
- // 14710, 49, //
- // 14380, 50, //
- // 14053, 51, //
- // 13729, 52, //
- // 13410, 53, //
- // 13094, 54, //
- // 12782, 55, //
- // 12475, 56, //
- // 12172, 57, //
- // 11874, 58, //
- // 11580, 59, //
- // 11292, 60, //
};
#endif
diff --git a/source/Core/BSP/Miniware/Vendor/CMSIS/Include/cmsis_gcc.h b/source/Core/BSP/Miniware/Vendor/CMSIS/Include/cmsis_gcc.h index cccea707..ea4e5e68 100644 --- a/source/Core/BSP/Miniware/Vendor/CMSIS/Include/cmsis_gcc.h +++ b/source/Core/BSP/Miniware/Vendor/CMSIS/Include/cmsis_gcc.h @@ -124,7 +124,7 @@ __attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) { \return PSP Register value
*/
__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) {
- register uint32_t result;
+ uint32_t result;
__ASM volatile("MRS %0, psp\n" : "=r"(result));
return (result);
@@ -143,7 +143,7 @@ __attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProc \return MSP Register value
*/
__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) {
- register uint32_t result;
+ uint32_t result;
__ASM volatile("MRS %0, msp\n" : "=r"(result));
return (result);
diff --git a/source/Core/BSP/Miniware/flash.c b/source/Core/BSP/Miniware/flash.c index 1d5469ee..17eeb1da 100644 --- a/source/Core/BSP/Miniware/flash.c +++ b/source/Core/BSP/Miniware/flash.c @@ -10,14 +10,14 @@ #include "stm32f1xx_hal.h"
#include "string.h"
-static uint16_t settings_page[512] __attribute__((section(".settings_page")));
+#define SETTINGS_START_PAGE (0x08000000 + (63 * 1024))
uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
FLASH_EraseInitTypeDef pEraseInit;
pEraseInit.TypeErase = FLASH_TYPEERASE_PAGES;
pEraseInit.Banks = FLASH_BANK_1;
pEraseInit.NbPages = 1;
- pEraseInit.PageAddress = (uint32_t)settings_page;
+ pEraseInit.PageAddress = (uint32_t)SETTINGS_START_PAGE;
uint32_t failingAddress = 0;
resetWatchdog();
__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_WRPERR | FLASH_FLAG_PGERR | FLASH_FLAG_BSY);
@@ -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, (uint32_t)&settings_page[i], data[i]);
+ HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, SETTINGS_START_PAGE+ (i*sizeof(uint32_t)), data[i]);
}
HAL_FLASH_Lock();
return 1;
}
-void flash_read_buffer(uint8_t *buffer, const uint16_t length) { memcpy(buffer, settings_page, length); }
+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/stm32f103.ld b/source/Core/BSP/Miniware/stm32f103.ld index a3a5a942..3461bb86 100644 --- a/source/Core/BSP/Miniware/stm32f103.ld +++ b/source/Core/BSP/Miniware/stm32f103.ld @@ -116,17 +116,6 @@ SECTIONS _edata = .; /* define a global symbol at data end */
} >RAM AT> ROM
- .logo_page (NOLOAD) :
- {
- . = ABSOLUTE(__FLASH_END_ADDR__ - 2048);
- KEEP (*(.logo_page*))
- } > ROM
-
- .settings_page (NOLOAD) :
- {
- . = ABSOLUTE(__FLASH_END_ADDR__ - 1024);
- KEEP (*(.settings_page*))
- } > ROM
.bss :
{
diff --git a/source/Core/BSP/Pinecil/flash.c b/source/Core/BSP/Pinecil/flash.c index 8c0ce3f5..a6daa859 100644 --- a/source/Core/BSP/Pinecil/flash.c +++ b/source/Core/BSP/Pinecil/flash.c @@ -10,8 +10,6 @@ #include "gd32vf103_libopt.h"
#include "string.h"
#define FMC_PAGE_SIZE ((uint16_t)0x400U)
-// static uint16_t settings_page[FMC_PAGE_SIZE] __attribute__ ((section (".settings_page")));
-// Linker script doesnt want to play, so for now its hard coded
#define SETTINGS_START_PAGE (0x08000000 + (127 * 1024))
uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
diff --git a/source/Core/BSP/Pinecilv2/bl_mcu_sdk/components/freertos/portable/gcc/risc-v/bl702/portmacro.h b/source/Core/BSP/Pinecilv2/bl_mcu_sdk/components/freertos/portable/gcc/risc-v/bl702/portmacro.h index 2f331e48..8fcc210a 100644 --- a/source/Core/BSP/Pinecilv2/bl_mcu_sdk/components/freertos/portable/gcc/risc-v/bl702/portmacro.h +++ b/source/Core/BSP/Pinecilv2/bl_mcu_sdk/components/freertos/portable/gcc/risc-v/bl702/portmacro.h @@ -41,6 +41,7 @@ extern "C" { * These settings should not be altered.
*-----------------------------------------------------------
*/
+#include "FreeRTOSConfig.h"
#include <stddef.h>
#include <stdint.h>
|