Merge pull request #12663 from hugueskamba/hk-NUCLEO_F303K8-fix-microlib-support-optimize-ram

Migrate NUCLEO_F303K8 to Mbed OS 5 baremetal
pull/12844/head
Martin Kojtal 2020-04-22 07:06:13 +02:00 committed by GitHub
commit e33e93622c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 15 deletions

View File

@ -28,27 +28,49 @@
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#if !defined(MBED_APP_START)
#define MBED_APP_START 0x08000000
#endif
#define Stack_Size MBED_BOOT_STACK_SIZE
; STM32F303K8: 64KB FLASH (0x10000)
#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x10000
#endif
; STM32F303K8: 64KB FLASH (0x10000) + 12KB SRAM (0x3000)
LR_IROM1 0x08000000 0x10000 { ; load region size_region
#if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x20000000
#endif
ER_IROM1 0x08000000 0x10000 { ; load address = execution address
;12KB SRAM (0x3000)
#if !defined(MBED_RAM_SIZE)
#define MBED_RAM_SIZE 0x3000
#endif
#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif
; 60 Non-Core vectors + 16 ARM Core System Handler Vectors vectors + reserved areas = 98 vectors 392 bytes (0x188) to be reserved in RAM
#define VECTOR_SIZE 0x188
#define RAM_FIXED_SIZE (MBED_BOOT_STACK_SIZE+VECTOR_SIZE)
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
; 98 vectors = 392 bytes (0x188) to be reserved in RAM
RW_IRAM1 (0x20000000+0x188) (0x3000-0x188-Stack_Size) { ; RW data
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE) { ; RW data
.ANY (+RW +ZI)
}
ARM_LIB_STACK (0x20000000+0x3000) EMPTY -Stack_Size { ; stack
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
}
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack
}
}

View File

@ -6,6 +6,7 @@
STACK_SIZE = MBED_BOOT_STACK_SIZE;
/* 60 Non-Core vectors + 16 ARM Core System Handler Vectors vectors + reserved areas = 392 bytes (0x188) to be reserved in RAM */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K

View File

@ -2734,6 +2734,11 @@
"IAR",
"GCC_ARM"
],
"supported_c_libs": {
"arm": ["std", "small"],
"gcc_arm": ["std", "small"],
"iar": ["std"]
},
"macros": [
"USE_HAL_DRIVER",
"USE_FULL_LL_DRIVER",
@ -3558,12 +3563,14 @@
}
},
"overrides": {
"lse_available": 0
"lse_available": 0,
"boot-stack-size": "0x400",
"tickless-from-us-ticker": true
},
"detect_code": [
"0775"
],
"default_lib": "small",
"c_lib": "small",
"device_has_add": [
"ANALOGOUT",
"CAN",
@ -3572,9 +3579,7 @@
"device_has_remove": [
"LPTICKER"
],
"release_versions": [
"2"
],
"supported_application_profiles":["bare-metal"],
"device_name": "STM32F303K8"
},
"NUCLEO_F303RE": {