Skip to content

Commit 3ebc99f

Browse files
authored
Merge pull request #5681 from slashdevteam/mk24bootloader
Adding bootloader support to MK24F1 target
2 parents 2b718fe + bb4a72c commit 3ebc99f

File tree

3 files changed

+39
-15
lines changed

3 files changed

+39
-15
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/TARGET_MCU_K24F1M/device/TOOLCHAIN_ARM_STD/MK24FN1M0xxx12.sct

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,22 @@
5555
#define __ram_vector_table_size__ 0x00000000
5656
#endif
5757

58-
#define m_interrupts_start 0x00000000
58+
#if !defined(MBED_APP_START)
59+
#define MBED_APP_START 0
60+
#endif
61+
62+
#if !defined(MBED_APP_SIZE)
63+
#define MBED_APP_SIZE 0x100000
64+
#endif
65+
66+
#define m_interrupts_start MBED_APP_START
5967
#define m_interrupts_size 0x00000400
6068

61-
#define m_flash_config_start 0x00000400
69+
#define m_flash_config_start MBED_APP_START + 0x400
6270
#define m_flash_config_size 0x00000010
6371

64-
#define m_text_start 0x00000410
65-
#define m_text_size 0x000FFBF0
72+
#define m_text_start MBED_APP_START + 0x410
73+
#define m_text_size MBED_APP_SIZE - 0x410
6674

6775
#define m_interrupts_ram_start 0x1FFF0000
6876
#define m_interrupts_ram_size __ram_vector_table_size__

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/TARGET_MCU_K24F1M/device/TOOLCHAIN_GCC_ARM/MK24FN1M0xxx12.ld

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,24 @@ __ram_vector_table__ = 1;
5656
__stack_size__ = 0x8000;
5757
__heap_size__ = 0x10000;
5858

59-
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
60-
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
59+
#if !defined(MBED_APP_START)
60+
#define MBED_APP_START 0
61+
#endif
62+
63+
#if !defined(MBED_APP_SIZE)
64+
#define MBED_APP_SIZE 0x100000
65+
#endif
66+
67+
HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x8000;
68+
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
6169
M_VECTOR_RAM_SIZE = DEFINED(__ram_vector_table__) ? 0x0400 : 0x0;
6270

6371
/* Specify the memory areas */
6472
MEMORY
6573
{
66-
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
67-
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
68-
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0
74+
m_interrupts (RX) : ORIGIN = MBED_APP_START, LENGTH = 0x400
75+
m_flash_config (RX) : ORIGIN = MBED_APP_START + 0x400, LENGTH = 0x10
76+
m_text (RX) : ORIGIN = MBED_APP_START + 0x410, LENGTH = MBED_APP_SIZE - 0x410
6977
m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000
7078
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00030000
7179
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/TARGET_MCU_K24F1M/device/TOOLCHAIN_IAR/MK24FN1M0xxx12.icf

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,25 @@ define symbol __ram_vector_table__ = 1;
5252
define symbol __stack_size__=0x8000;
5353
define symbol __heap_size__=0x10000;
5454

55+
if (!isdefinedsymbol(MBED_APP_START)) {
56+
define symbol MBED_APP_START = 0;
57+
}
58+
59+
if (!isdefinedsymbol(MBED_APP_SIZE)) {
60+
define symbol MBED_APP_SIZE = 0x100000;
61+
}
62+
5563
define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0;
5664
define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0;
5765

58-
define symbol m_interrupts_start = 0x00000000;
59-
define symbol m_interrupts_end = 0x000003FF;
66+
define symbol m_interrupts_start = MBED_APP_START;
67+
define symbol m_interrupts_end = MBED_APP_START + 0x3FF;
6068

61-
define symbol m_flash_config_start = 0x00000400;
62-
define symbol m_flash_config_end = 0x0000040F;
69+
define symbol m_flash_config_start = MBED_APP_START + 0x400;
70+
define symbol m_flash_config_end = MBED_APP_START + 0x40F;
6371

64-
define symbol m_text_start = 0x00000410;
65-
define symbol m_text_end = 0x000FFFFF;
72+
define symbol m_text_start = MBED_APP_START + 0x410;
73+
define symbol m_text_end = MBED_APP_START + MBED_APP_SIZE - 1;
6674

6775
define symbol m_interrupts_ram_start = 0x1FFF0000;
6876
define symbol m_interrupts_ram_end = 0x1FFF0000 + __ram_vector_table_offset__;

0 commit comments

Comments
 (0)