Skip to content

KW41Z: Add Bootloader support #8662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2018
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 @@ -51,14 +51,26 @@
#define __ram_vector_table_size__ 0x00000000
#endif

#define m_interrupts_start 0x00000000
#if !defined(MBED_APP_START)
#define MBED_APP_START 0
#endif

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x80000
#endif

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

#define m_interrupts_start MBED_APP_START
#define m_interrupts_size 0x00000200

#define m_flash_config_start 0x00000400
#define m_flash_config_start MBED_APP_START + 0x400
#define m_flash_config_size 0x00000010

#define m_text_start 0x00000410
#define m_text_size 0x0007FBF0
#define m_text_start MBED_APP_START + 0x410
#define m_text_size MBED_APP_SIZE - 0x410

#define m_interrupts_ram_start 0x1FFF8000
#define m_interrupts_ram_size __ram_vector_table_size__
Expand All @@ -70,7 +82,7 @@
#if (defined(__stack_size__))
#define Stack_Size __stack_size__
#else
#define Stack_Size 0x0400
#define Stack_Size MBED_BOOT_STACK_SIZE
#endif

#if (defined(__heap_size__))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,21 @@ ENTRY(Reset_Handler)

__ram_vector_table__ = 1;

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

#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x80000
#endif

#if !defined(MBED_BOOT_STACK_SIZE)
#define MBED_BOOT_STACK_SIZE 0x400
#endif

/* With the RTOS in use, this does not affect the main stack size. The size of
* the stack where main runs is determined via the RTOS. */
__stack_size__ = 0x400;
__stack_size__ = MBED_BOOT_STACK_SIZE;

__heap_size__ = 0x6000;

Expand All @@ -61,9 +73,9 @@ M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0200 : 0x0;
/* Specify the memory areas */
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000200
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0
m_interrupts (RX) : ORIGIN = MBED_APP_START, LENGTH = 0x00000200
m_flash_config (RX) : ORIGIN = MBED_APP_START + 0x400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = MBED_APP_START + 0x410, LENGTH = MBED_APP_SIZE - 0x410
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00020000
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,32 @@
*/
define symbol __ram_vector_table__ = 1;

/* Heap 1/4 of ram and stack 1/8 */
define symbol __stack_size__=0x4000;
if (!isdefinedsymbol(MBED_APP_START)) {
define symbol MBED_APP_START = 0;
}

if (!isdefinedsymbol(MBED_APP_SIZE)) {
define symbol MBED_APP_SIZE = 0x80000;
}

if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
define symbol MBED_BOOT_STACK_SIZE = 0x400;
}

define symbol __stack_size__=MBED_BOOT_STACK_SIZE;
define symbol __heap_size__=0x8000;

define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000200 : 0;
define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000001FF : 0;

define symbol m_interrupts_start = 0x00000000;
define symbol m_interrupts_end = 0x000001FF;
define symbol m_interrupts_start = MBED_APP_START;
define symbol m_interrupts_end = MBED_APP_START + 0x1FF;

define symbol m_flash_config_start = 0x00000400;
define symbol m_flash_config_end = 0x0000040F;
define symbol m_flash_config_start = MBED_APP_START + 0x400;
define symbol m_flash_config_end = MBED_APP_START + 0x40F;

define symbol m_text_start = 0x00000410;
define symbol m_text_end = 0x0007FFFF;
define symbol m_text_start = MBED_APP_START + 0x410;
define symbol m_text_end = MBED_APP_START + MBED_APP_SIZE - 1;

define symbol m_interrupts_ram_start = 0x1FFF8000;
define symbol m_interrupts_ram_end = 0x1FFF8000 + __ram_vector_table_offset__;
Expand Down
3 changes: 2 additions & 1 deletion targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,8 @@
"detect_code": ["0201"],
"device_has": ["USTICKER", "LPTICKER", "RTC", "ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "TRNG", "STDIO_MESSAGES", "FLASH"],
"release_versions": ["2", "5"],
"device_name": "MKW41Z512xxx4"
"device_name": "MKW41Z512xxx4",
"bootloader_supported": true
},
"MCU_K24F1M": {
"core": "Cortex-M4F",
Expand Down