1 /* 2 * Copyright (c) 2006-2021, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2018-11-5 SummerGift first version 9 * 2019-04-24 yangjie Use the end of ZI as HEAP_BEGIN 10 */ 11 12 #ifndef __BOARD_H__ 13 #define __BOARD_H__ 14 15 #include <rtthread.h> 16 #include <stm32wbxx.h> 17 #include "drv_common.h" 18 #include "drv_gpio.h" 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 #define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000) 25 #define STM32_FLASH_SIZE (1024 * 1024) 26 #define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE)) 27 28 #define STM32_SRAM1_SIZE (196) 29 #define STM32_SRAM1_START (0x20000000) 30 #define STM32_SRAM1_END (STM32_SRAM1_START + STM32_SRAM1_SIZE * 1024) 31 32 #if defined(__ARMCC_VERSION) 33 extern int Image$$RW_IRAM1$$ZI$$Limit; 34 #define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit) 35 #elif __ICCARM__ 36 #pragma section="CSTACK" 37 #define HEAP_BEGIN (__segment_end("CSTACK")) 38 #else 39 extern int __bss_end; 40 #define HEAP_BEGIN ((void *)&__bss_end) 41 #endif 42 43 #define HEAP_END STM32_SRAM1_END 44 45 void SystemClock_Config(void); 46 47 #ifdef __cplusplus 48 } 49 #endif 50 51 #endif 52 53