Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kconfig: Linked code into external SEMC-controlled memory without boot header #53867

Closed
MikhailSiomin opened this issue Jan 17, 2023 · 4 comments · Fixed by #54864
Closed

kconfig: Linked code into external SEMC-controlled memory without boot header #53867

MikhailSiomin opened this issue Jan 17, 2023 · 4 comments · Fixed by #54864
Assignees
Labels
area: Kconfig bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug

Comments

@MikhailSiomin
Copy link
Contributor

It is not clear to me why the following check for CODE_FLEXSPI and CODE_FLEXSPI2 configs was added at NXP_IMX_RT_BOOT_HEADER config (at PR #41579). Since the boot ROM cannot copy and then run code linked into non-FlexSPI controlled memory.

menuconfig NXP_IMX_RT_BOOT_HEADER
bool "Boot header"
depends on ((!BOOTLOADER_MCUBOOT) && (CODE_FLEXSPI || CODE_FLEXSPI2))
help
Enable data structures required by the boot ROM to boot the
application from an external flash device.

It is also unclear to me why there was no imply for CODE_SEMC (in PR #22864), CODE_ITCM and other CODE_LOCATION.

config CODE_SEMC
bool "Link code into external SEMC-controlled memory"

I think these checks should be removed and imply for CODE_SEMC, CODE_ITCM, CODE_SRAM0, CODE_OCRAM added.
zephyr/soc/arm/nxp_imx/rt/Kconfig.soc:

...
menuconfig NXP_IMX_RT_BOOT_HEADER
	bool "Boot header"
	depends on (!BOOTLOADER_MCUBOOT)
	help
	  Enable data structures required by the boot ROM to boot the
	  application from an external flash device.
...
config CODE_SEMC
	bool "Link code into external SEMC-controlled memory"
	imply NXP_IMX_RT_BOOT_HEADER if !BOOTLOADER_MCUBOOT

config CODE_ITCM
	bool "Link code into internal instruction tightly coupled memory (ITCM)"
	imply NXP_IMX_RT_BOOT_HEADER if !BOOTLOADER_MCUBOOT
...
config CODE_SRAM0
	bool "Link code into RAM_L memory (RAM_L)"
	imply NXP_IMX_RT_BOOT_HEADER if !BOOTLOADER_MCUBOOT

config CODE_OCRAM
	bool "Link code into OCRAM memory (OCRAM-M4)"
	imply NXP_IMX_RT_BOOT_HEADER if !BOOTLOADER_MCUBOOT
...
@MikhailSiomin MikhailSiomin added the bug The issue is a bug, or the PR is fixing a bug label Jan 17, 2023
@dleach02 dleach02 assigned danieldegrasse and unassigned dleach02 Jan 31, 2023
@MikhailSiomin
Copy link
Contributor Author

@danieldegrasse, I can make a PR if you can confirm that my assumptions above are correct.

@danieldegrasse
Copy link
Collaborator

Hi @MikhailSiomin, Sorry for the late response. Currently, CONFIG_IMX_RT_BOOT_HEADER only enables the presence of the boot header. Although the iMX.RT bootloader should support loading the image into RAM using this feature, this use case is not currently tested or supported. If you are interested in enabling this feature, a PR to do so would be welcomed, I just wanted to make you aware that the effort to do so may be more than changing the KConfig settings here.

@MikhailSiomin
Copy link
Contributor Author

@danieldegrasse, I used a custom bootloader on 2.7 Zephyr that linked into semc and it worked. But faced the above problem when switching to Zephyr version 3.2. I will check what the changes affect and prepare a PR.

@danieldegrasse
Copy link
Collaborator

@MikhailSiomin, great- thank you for taking this on!

MikhailSiomin added a commit to MikhailSiomin/zephyr that referenced this issue Feb 15, 2023
Allow to include boot header for code linked into
not only FlexSPI controlled memory.
Fixes zephyrproject-rtos#53867

Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
carlescufi pushed a commit that referenced this issue Feb 23, 2023
Allow to include boot header for code linked into
not only FlexSPI controlled memory.
Fixes #53867

Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
nordicjm pushed a commit to nordicjm/zephyr that referenced this issue Mar 8, 2023
Allow to include boot header for code linked into
not only FlexSPI controlled memory.
Fixes zephyrproject-rtos#53867

Signed-off-by: Mikhail Siomin <victorovich.01@mail.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kconfig bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants