Hi Vicent,
I understand you can't post the project.
If you don't add the bootloader_config.c , it means your linker file modification have problems.
Now, please modify your problem linker file like this:
define symbol __ICFEDIT_intvec_start__ = 0x0000A000;
define symbol __ICFEDIT_region_ROM_start__ = 0x0000A000 ;
define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x1FFF0000;
define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFF0;
define symbol __ICFEDIT_size_cstack__ = 0;
define symbol __ICFEDIT_size_heap__ = 0;
define exported symbol __EXTERNAL_MRAM_ROM_BASE = 0x60000000;
define exported symbol __EXTERNAL_MRAM_ROM_SIZE = 0x00000000;
define exported symbol __EXTERNAL_MRAM_RAM_BASE = 0x60000000;
define exported symbol __EXTERNAL_MRAM_RAM_SIZE = 0x00080000;
define exported symbol __EXTERNAL_LCD_BASE = 0x60000000;
define exported symbol __EXTERNAL_LCD_SIZE = 0x1FFFF;
define exported symbol __EXTERNAL_LCD_DC_BASE = 0x60010000;
define exported symbol __INTERNAL_FLASH_BASE = 0x00000000;
define exported symbol __INTERNAL_FLASH_SIZE = 0x00100000;
define exported symbol __INTERNAL_SRAM_BASE = 0x1FFF0000;
define exported symbol __INTERNAL_SRAM_SIZE = 0x00040000;
define exported symbol __UNCACHED_DATA_START = 0x1FFF0000;
define exported symbol __UNCACHED_DATA_SIZE = 0x00020000;
define exported symbol __UNCACHED_DATA_END = 0x2000FFF0;
define exported symbol __SRAM_POOL = 0x1FFF0000;
define exported symbol __INTERNAL_FLEXNVM_BASE = 0;
define exported symbol __INTERNAL_FLEXNVM_SIZE = 0;
define exported symbol __VECTOR_TABLE_ROM_START = 0x0000A000;
define exported symbol __VECTOR_TABLE_RAM_START = __ICFEDIT_region_RAM_start__;
define exported symbol __DEFAULT_PROCESSOR_NUMBER = 1;
define exported symbol __DEFAULT_INTERRUPT_STACK_SIZE = 1024;
define exported symbol __BOOT_STACK_ADDRESS = __ICFEDIT_region_RAM_end__ - 0x100;
define exported symbol __KERNEL_DATA_END = __ICFEDIT_region_RAM_end__;
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block KERNEL_DATA with alignment = 8 { section .kernel_data };
define exported symbol __FLASHX_SECT_SIZE = 0x1000;
define exported symbol __FLASHX_END_ADDR = __INTERNAL_FLASH_BASE + __INTERNAL_FLASH_SIZE;
define block CFMPROTROM with size = 20 { section .cfmconfig };
define block FLASHX_POOL with alignment = __FLASHX_SECT_SIZE { section .flashx };
define block TEXTSECTION with alignment = 4 { section .text };
keep { section .cfmconfig };
keep { section .flashx };
initialize by copy { readwrite };
do not initialize { section .noinit };
do not initialize { section .kernel_data };
do not initialize { section .flashx };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec, block CFMPROTROM };
place in m_bootloader_config_region{ section .bootloaderconfig };
place in ROM_region { first block TEXTSECTION, readonly, last block FLASHX_POOL };
place at address mem:__ICFEDIT_region_RAM_start__ { readwrite section .vectors_ram };
place in RAM_region { readwrite, last block KERNEL_DATA };
About the BCA area add, you totally can add it in the startup_MK64F12.s
#ifdef BL_HAS_BOOTLOADER_CONFIG
__bootloaderConfigurationArea ; 0x3c0
DCD 'kcfg' ; [00:03] tag - Tag value used to validate the bootloader configuration data. Must be set to 'kcfg'.
DCD 0xFFFFFFFF ; [04:07] crcStartAddress
DCD 0xFFFFFFFF ; [08:0b] crcByteCount
DCD 0xFFFFFFFF ; [0c:0f] crcExpectedValue
DCB 0xFF ; [10:10] enabledPeripherals
DCB 0xFF ; [11:11] i2cSlaveAddress
DCW 5000 ; [12:13] peripheralDetectionTimeoutMs - Timeout in milliseconds for peripheral detection before jumping to application code
DCW 0xFFFF ; [14:15] usbVid
DCW 0xFFFF ; [16:17] usbPid
DCD 0xFFFFFFFF ; [18:1b] usbStringsPointer
DCB 0xFF ; [1c:1c] clockFlags - High Speed and other clock options
DCB 0xFF ; [1d:1d] clockDivider - One's complement of clock divider, zero divider is divide by 1
DCW 0xFFFF ; [1e:1f] reserved
; Fill to align with flash configuration field.
REPT (0x400-0x3e0)/4 ; 0x3E0 - 0x3FF
DCD 0xFFFFFFFF ; Reserved for user TRIM value
ENDR
#else
; Fill to align with flash configuration field.
REPT (0x400-0x3c0)/4 ; 0x3c0:0x400
DCD 0xFFFFFFFF ; Reserved for user TRIM value
ENDR
#endif // BL_HAS_BOOTLOADER_CONFIG
I also attach the .s file.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------