Skip to content

Commit 0ea72d6

Browse files
authored
Merge pull request #6425 from KurtE/teensy_retain_fs
Teensy Builds retain Filesystem
2 parents 3694b5c + d47662c commit 0ea72d6

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt")))
1515
* IVT Data
1616
*************************************/
1717
const ivt image_vector_table = {
18-
IVT_HEADER, /* IVT Header */
18+
0x432000D1, /* Teensy bootloader looks for this value*/
1919
IMAGE_ENTRY_ADDRESS, /* Image Entry Function */
2020
IVT_RSVD, /* Reserved = 0 */
2121
(uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */
@@ -25,13 +25,15 @@ const ivt image_vector_table = {
2525
IVT_RSVD /* Reserved = 0 */
2626
};
2727

28+
extern unsigned long _flashimagelen;
29+
2830
__attribute__((section(".boot_hdr.boot_data")))
2931
/*************************************
3032
* Boot Data
3133
*************************************/
3234
const BOOT_DATA_T boot_data = {
3335
FLASH_BASE, /* boot start location */
34-
FLASH_SIZE, /* size */
36+
(uint32_t)&_flashimagelen, /* actual size of image */
3537
PLUGIN_FLAG, /* Plugin flag*/
3638
0xFFFFFFFF /* empty - extra data word */
3739
};

ports/mimxrt10xx/boards/teensy40/flash_config.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt")))
1515
* IVT Data
1616
*************************************/
1717
const ivt image_vector_table = {
18-
IVT_HEADER, /* IVT Header */
18+
0x432000D1, /* Teensy bootloader looks for this value*/
1919
IMAGE_ENTRY_ADDRESS, /* Image Entry Function */
2020
IVT_RSVD, /* Reserved = 0 */
2121
(uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */
@@ -25,13 +25,15 @@ const ivt image_vector_table = {
2525
IVT_RSVD /* Reserved = 0 */
2626
};
2727

28+
extern unsigned long _flashimagelen;
29+
2830
__attribute__((section(".boot_hdr.boot_data")))
2931
/*************************************
3032
* Boot Data
3133
*************************************/
3234
const BOOT_DATA_T boot_data = {
3335
FLASH_BASE, /* boot start location */
34-
FLASH_SIZE, /* size */
36+
(uint32_t)&_flashimagelen, /* actual size of image */
3537
PLUGIN_FLAG, /* Plugin flag*/
3638
0xFFFFFFFF /* empty - extra data word */
3739
};

ports/mimxrt10xx/boards/teensy41/flash_config.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt")))
1515
* IVT Data
1616
*************************************/
1717
const ivt image_vector_table = {
18-
IVT_HEADER, /* IVT Header */
18+
0x432000D1, /* Teensy bootloader looks for this value*/
1919
IMAGE_ENTRY_ADDRESS, /* Image Entry Function */
2020
IVT_RSVD, /* Reserved = 0 */
2121
(uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */
@@ -25,13 +25,15 @@ const ivt image_vector_table = {
2525
IVT_RSVD /* Reserved = 0 */
2626
};
2727

28+
extern unsigned long _flashimagelen;
29+
2830
__attribute__((section(".boot_hdr.boot_data")))
2931
/*************************************
3032
* Boot Data
3133
*************************************/
3234
const BOOT_DATA_T boot_data = {
3335
FLASH_BASE, /* boot start location */
34-
FLASH_SIZE, /* size */
36+
(uint32_t)&_flashimagelen, /* actual size of image */
3537
PLUGIN_FLAG, /* Plugin flag*/
3638
0xFFFFFFFF /* empty - extra data word */
3739
};

ports/mimxrt10xx/linking/common.ld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ SECTIONS
7474
_etext = .; /* define a global symbol at end of code */
7575
__etext = .; /* define a global symbol at end of code */
7676
} > FLASH_FIRMWARE
77-
7877
_ld_filesystem_start = ORIGIN(FLASH_FATFS);
7978
_ld_filesystem_end = _ld_filesystem_start + LENGTH(FLASH_FATFS);
8079

@@ -127,6 +126,8 @@ SECTIONS
127126
_ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data);
128127
_ld_dtcm_data_size = SIZEOF(.dtcm_data);
129128

129+
_flashimagelen = _ld_dtcm_data_flash_copy + _ld_dtcm_data_size - flash_config_location;
130+
130131
.dtcm_bss :
131132
{
132133
. = ALIGN(4);

0 commit comments

Comments
 (0)