nxp-mcuxpresso / sbl

Other
39 stars 10 forks source link

MIMXRT1021: Unable to Build SBL due to Linker Script Issue #6

Open wdt0134 opened 11 months ago

wdt0134 commented 11 months ago

Description: I am working on building the Secure Bootloader(SBL) for MIMXRT1021 using the provided linker script. However, I encountered a syntax error while trying to build the project. The error is thrown on the line where the ivt_begin variable is defined in the linker script.

Steps to Reproduce: Utilize the provided linker script for MIMXRT1021. Attempt to build the SBL. Observe the syntax error on the line ivt_begin = ORIGIN(m_flash_config) + LENGTH(m_flash_config); Expected Behavior: The project should build successfully without any syntax errors.

Observed Behavior: A syntax error is thrown on the line where ivt_begin is defined in the linker script. The exact error message is:

/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld:board/link/MIMXRT1021xxxxx_flexspi_nor.ld:59: syntax error The error persists even when changing the expression to a direct assignment as follows:

ivt_begin = 0x60000000 + 0x00001000;

Environment: Compiler: GNU C Compiler Linker: GNU ld (GNU Binutils for Ubuntu) 2.38 Build Environment: Ubuntu (WSL2) Additional Information: I attempted to change the definition of the ivt_begin variable outside the SECTIONS block following common practice, but I encountered a syntax error similar to when it was defined within the SECTIONS block. However, I was able to build successfully by changing to the following:

/*ivt_begin= ORIGIN(m_flash_config) + LENGTH(m_flash_config);*/

.ivt : AT(ORIGIN(m_flash_config) + LENGTH(m_flash_config))

[Attachments:] MIMXRT1021xxxxx_flexspi_nor.ld.txt

This resolution to this issue would aid others who are struggling with building the SBL for MIMXRT1021. Your consideration would be greatly appreciated. Thank you.