Skip to content

Commit d255e11

Browse files
author
Jamie Smith
authored
MIMXRT105x: upgrade linker script to use memory banks, disable SRAM (#411)
* Update MIMXRT105x linker script to use memory banks * Disable SRAM for now :/ * Add split heap support
1 parent 722c2f1 commit d255e11

File tree

12 files changed

+193
-124
lines changed

12 files changed

+193
-124
lines changed

platform/mbed_lib.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@
246246
},
247247
"MCU_STM32H7": {
248248
"crash-capture-enabled": true
249+
},
250+
"MIMXRT105X": {
251+
"crash-capture-enabled": true
249252
}
250253
}
251254
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ SECTIONS
112112
. = ALIGN(8);
113113
KEEP(*(.isr_vector)) /* Startup code */
114114
. = ALIGN(8);
115-
} > m_text AT> m_text :text
115+
} > m_text :text
116116

117117
/* FCF to absolute address of 0x400, but only if bootloader is not present. */
118118
#if !IS_BOOTLOADER_PRESENT
119119
.flash_config FLASH_VTOR_TABLE_SIZE :
120120
{
121121
KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */
122-
} > m_text AT> m_text :text
122+
} > m_text :text
123123
#else
124124
/DISCARD/ : {
125125
*(.FlashConfig)
@@ -140,19 +140,19 @@ SECTIONS
140140
KEEP (*(.init))
141141
KEEP (*(.fini))
142142
. = ALIGN(8);
143-
} > m_text AT> m_text :text
143+
} > m_text :text
144144

145145
.ARM.extab :
146146
{
147147
*(.ARM.extab* .gnu.linkonce.armextab.*)
148-
} > m_text AT> m_text :text
148+
} > m_text :text
149149

150150
.ARM :
151151
{
152152
__exidx_start = .;
153153
*(.ARM.exidx*)
154154
__exidx_end = .;
155-
} > m_text AT> m_text :text
155+
} > m_text :text
156156

157157
.ctors :
158158
{
@@ -176,7 +176,7 @@ SECTIONS
176176
KEEP (*(SORT(.ctors.*)))
177177
KEEP (*(.ctors))
178178
__CTOR_END__ = .;
179-
} > m_text AT> m_text :text
179+
} > m_text :text
180180

181181
.dtors :
182182
{
@@ -187,30 +187,30 @@ SECTIONS
187187
KEEP (*(SORT(.dtors.*)))
188188
KEEP (*(.dtors))
189189
__DTOR_END__ = .;
190-
} > m_text AT> m_text :text
190+
} > m_text :text
191191

192192
.preinit_array :
193193
{
194194
PROVIDE_HIDDEN (__preinit_array_start = .);
195195
KEEP (*(.preinit_array*))
196196
PROVIDE_HIDDEN (__preinit_array_end = .);
197-
} > m_text AT> m_text :text
197+
} > m_text :text
198198

199199
.init_array :
200200
{
201201
PROVIDE_HIDDEN (__init_array_start = .);
202202
KEEP (*(SORT(.init_array.*)))
203203
KEEP (*(.init_array*))
204204
PROVIDE_HIDDEN (__init_array_end = .);
205-
} > m_text AT> m_text :text
205+
} > m_text :text
206206

207207
.fini_array :
208208
{
209209
PROVIDE_HIDDEN (__fini_array_start = .);
210210
KEEP (*(SORT(.fini_array.*)))
211211
KEEP (*(.fini_array*))
212212
PROVIDE_HIDDEN (__fini_array_end = .);
213-
} > m_text AT> m_text :text
213+
} > m_text :text
214214

215215
#if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED
216216
/* Stick the crash data ram at the start of sram_l */

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1050_EVK/xip/evkbimxrt1050_flexspi_nor_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const flexspi_nor_config_t hyperflash_config = {
3939
(1u << kFlexSpiMiscOffset_SafeConfigFreqEnable) | (1u << kFlexSpiMiscOffset_DiffClkEnable),
4040
.sflashPadType = kSerialFlash_8Pads,
4141
.serialClkFreq = kFlexSpiSerialClk_133MHz,
42-
.sflashA1Size = BOARD_FLASH_SIZE,
42+
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
4343
.dataValidTime = {16u, 16u},
4444
.lookupTable = {
4545
// Read LUTs
@@ -68,7 +68,7 @@ const flexspi_nor_config_t qspiflash_config = {
6868
.sflashPadType = kSerialFlash_4Pads,
6969
.serialClkFreq = kFlexSpiSerialClk_133MHz,
7070
.lutCustomSeqEnable = 0u,
71-
.sflashA1Size = BOARD_FLASH_SIZE,
71+
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
7272
.lookupTable = {
7373
// Fast read sequence
7474
[0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1060_EVK/xip/evkbmimxrt1060_flexspi_nor_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const flexspi_nor_config_t qspiflash_config = {
3535
.deviceType = kFlexSpiDeviceType_SerialNOR,
3636
.sflashPadType = kSerialFlash_4Pads,
3737
.serialClkFreq = kFlexSpiSerialClk_120MHz,
38-
.sflashA1Size = BOARD_FLASH_SIZE,
38+
.sflashA1Size = MBED_ROM_BANK_EXT_FLASH_SIZE,
3939
.lookupTable =
4040
{
4141
// Read LUTs

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/flash_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,8 @@ int32_t flash_free(flash_t *obj)
655655
uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address)
656656
{
657657
uint32_t sectorsize = MBED_FLASH_INVALID_SIZE;
658-
uint32_t devicesize = BOARD_FLASH_SIZE;
659-
uint32_t startaddr = BOARD_FLASH_START_ADDR;
658+
uint32_t devicesize = MBED_ROM_BANK_EXT_FLASH_SIZE;
659+
uint32_t startaddr = MBED_ROM_BANK_EXT_FLASH_START;
660660

661661
if ((address >= startaddr) && (address < (startaddr + devicesize))) {
662662
sectorsize = BOARD_FLASH_SECTOR_SIZE;
@@ -672,12 +672,12 @@ uint32_t flash_get_page_size(const flash_t *obj)
672672

673673
uint32_t flash_get_start_address(const flash_t *obj)
674674
{
675-
return BOARD_FLASH_START_ADDR;
675+
return MBED_ROM_BANK_EXT_FLASH_START;
676676
}
677677

678678
uint32_t flash_get_size(const flash_t *obj)
679679
{
680-
return BOARD_FLASH_SIZE;
680+
return MBED_ROM_BANK_EXT_FLASH_SIZE;
681681
}
682682

683683
uint8_t flash_get_erase_value(const flash_t *obj)

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/flash_defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static uint32_t customLUT[CUSTOM_LUT_LENGTH] = {
274274

275275
flexspi_device_config_t deviceconfig = {
276276
.flexspiRootClk = 120000000,
277-
.flashSize = (BOARD_FLASH_SIZE/1024),
277+
.flashSize = (MBED_ROM_BANK_EXT_FLASH_SIZE/1024),
278278
.CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle,
279279
.CSInterval = 0,
280280
.CSHoldTime = 3,

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/fsl_flexspi_nor_boot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ typedef struct _boot_data_ {
101101
uint32_t placeholder; /* placehoder to make even 0x10 size */
102102
}BOOT_DATA_T;
103103

104-
#define FLASH_SIZE BOARD_FLASH_SIZE
104+
#define FLASH_SIZE MBED_ROM_BANK_EXT_FLASH_SIZE
105105
#define PLUGIN_FLAG (uint32_t)0
106106

107107
/* External Variables */

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/mimxrt_memory_info.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,12 @@
2020

2121
#ifdef HYPERFLASH_BOOT
2222
/* 64MB HyperFlash */
23-
#define BOARD_FLASH_SIZE (0x4000000)
24-
#define BOARD_FLASH_START_ADDR (0x60000000)
2523
#define BOARD_FLASH_PAGE_SIZE (512)
2624
#define BOARD_FLASH_SECTOR_SIZE (262144)
2725
#else
2826
/* 8MB QSPI Flash */
29-
#define BOARD_FLASH_SIZE (0x800000)
30-
#define BOARD_FLASH_START_ADDR (0x60000000)
3127
#define BOARD_FLASH_PAGE_SIZE (256)
3228
#define BOARD_FLASH_SECTOR_SIZE (4096)
3329
#endif
3430

35-
// Unless the user overrides it, define the app to use the entire flash space.
36-
#ifndef MBED_APP_START
37-
#define MBED_APP_START BOARD_FLASH_START_ADDR
38-
#endif
39-
40-
#ifndef MBED_APP_SIZE
41-
#define MBED_APP_SIZE BOARD_FLASH_SIZE
42-
#endif
43-
44-
#define MIMXRT105X_BOARD_HAS_EXTERNAL_RAM 1
45-
#define MIMXRT105X_EXTERNAL_RAM_SIZE 0x02000000
46-
4731
#endif //MBED_OS_MIMXRT_MEMORY_INFO_H

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_TEENSY_4X/TARGET_TEENSY_40/mimxrt_memory_info.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,7 @@
1919
#define MBED_OS_MIMXRT_MEMORY_INFO_H
2020

2121
/* 2MB QSPI Flash */
22-
#define BOARD_FLASH_SIZE (0x1F0000) // 1984k
23-
#define BOARD_FLASH_START_ADDR (0x60000000)
2422
#define BOARD_FLASH_PAGE_SIZE (256)
2523
#define BOARD_FLASH_SECTOR_SIZE (4096)
2624

27-
// Unless the user overrides it, define the app to use the entire flash space.
28-
#ifndef MBED_APP_START
29-
#define MBED_APP_START BOARD_FLASH_START_ADDR
30-
#endif
31-
32-
#ifndef MBED_APP_SIZE
33-
#define MBED_APP_SIZE BOARD_FLASH_SIZE
34-
#endif
35-
36-
#define MIMXRT105X_BOARD_HAS_EXTERNAL_RAM 0
37-
3825
#endif //MBED_OS_MIMXRT_MEMORY_INFO_H

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_TEENSY_4X/TARGET_TEENSY_41/mimxrt_memory_info.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,7 @@
1919
#define MBED_OS_MIMXRT_MEMORY_INFO_H
2020

2121
/* 8MB QSPI Flash */
22-
#define BOARD_FLASH_SIZE (0x7C0000) // 7936k
23-
#define BOARD_FLASH_START_ADDR (0x60000000)
2422
#define BOARD_FLASH_PAGE_SIZE (256)
2523
#define BOARD_FLASH_SECTOR_SIZE (4096)
2624

27-
// Unless the user overrides it, define the app to use the entire flash space.
28-
#ifndef MBED_APP_START
29-
#define MBED_APP_START BOARD_FLASH_START_ADDR
30-
#endif
31-
32-
#ifndef MBED_APP_SIZE
33-
#define MBED_APP_SIZE BOARD_FLASH_SIZE
34-
#endif
35-
36-
#define MIMXRT105X_BOARD_HAS_EXTERNAL_RAM 0
37-
3825
#endif //MBED_OS_MIMXRT_MEMORY_INFO_H

0 commit comments

Comments
 (0)