Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,49 @@
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#if !defined(MBED_APP_START)
#define MBED_APP_START 0x08000000
#endif

; STM32F303K8: 64KB FLASH (0x10000)
#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x10000
#endif

#if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x20000000
#endif

;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
#define MBED_BOOT_STACK_SIZE 0x400
#endif

#define Stack_Size MBED_BOOT_STACK_SIZE
; 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)

; STM32F303K8: 64KB FLASH (0x10000) + 12KB SRAM (0x3000)
LR_IROM1 0x08000000 0x10000 { ; load region size_region
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region

ER_IROM1 0x08000000 0x10000 { ; load address = execution address
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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2807,6 +2807,11 @@
"IAR",
"GCC_ARM"
],
"supported_c_libs": {
"arm": ["std", "small"],
"gcc_arm": ["std", "small"],
"iar": ["std"]
},
"macros": [
"USE_HAL_DRIVER",
"USE_FULL_LL_DRIVER",
Expand Down Expand Up @@ -3630,12 +3635,14 @@
}
},
"overrides": {
"lse_available": 0
"lse_available": 0,
"boot-stack-size": "0x400",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?
As explained in
https://os.mbed.com/docs/mbed-os/v5.15/porting/porting-bootstrap.html
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */

So why don't we keep default 0x1000 value ?
Thx

"tickless-from-us-ticker": true
},
"detect_code": [
"0775"
],
"default_lib": "small",
"c_lib": "small",
"device_has_add": [
"ANALOGOUT",
"CAN",
Expand All @@ -3644,9 +3651,7 @@
"device_has_remove": [
"LPTICKER"
],
"release_versions": [
"2"
],
"supported_application_profiles":["bare-metal"],
"device_name": "STM32F303K8"
},
"NUCLEO_F303RE": {
Expand Down