
.ui16Start = 0xA55AU,
.ui32FlashStart = (uint32_t)&__ROM_start__,
.ui32FlashEnd = (uint32_t)&m_safety_flash_end,
.ui32CRC = (uint32_t)FS_CFG_FLASH_TST_CRC,
.ui16End = 0x5AA5U
};
Where "__attribute__((used, section(".flshcrc")))" is a directive for the linker script to place this strucuture to memory
section "flshcrc".
MCUXpresso Linker settings
The structure definition in the above example expects memory section "flscrc" to be defined in the linker. This can be set as follows:
/* The safety FLASH CRC. */
.SEC_CRC m_fs_flash_crc_start : ALIGN(4)
{
FILL(0xff)
KEEP(*(.flshcrc*))
} >MEM_FLASH
Where "m_fs_flash_crc_start" is the user-defined address, but this section must be placed at the end of the output
*.hex
file.
5.2.3.3 Flash loader configuration
It is necessary to set a correct output file for the download to the target. There are the following two ways to do this in the
MCUXpresso IDE:
1. Using the "Debug configuration".
2. Using the "GUI Flash Tool".
Debug configuration
• Create the debug configuration for your debugger.
• Open the "Debug Configurations" menu ("Run → Debug configuration") and select the "Startup" tab. In this tab, select
"Load Image -> Use File ->
<YOUR_PROJECT_NAME_crc.hex
".
• This edited
*.hex
file is in the
<workspace>/<your_project>/Debug/<your_project>_crc.hex
folder.
This can be set in the OpenSDA, CMSIS-DAP, or J-Link debuggers.
Post-build CRC calculation
LPC CM0 Safety Example , Rev. 3, 07/2021
NXP Semiconductors
21