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

mcuboot doesn't link into code-partition #14566

Closed
nvlsianpu opened this issue Mar 15, 2019 · 9 comments · Fixed by #14620
Closed

mcuboot doesn't link into code-partition #14566

nvlsianpu opened this issue Mar 15, 2019 · 9 comments · Fixed by #14620
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug Regression Something, which was working, does not anymore
Milestone

Comments

@nvlsianpu
Copy link
Collaborator

nvlsianpu commented Mar 15, 2019

mcuboot doesn't link into code-partition despite it is chosen.

	chosen {
		zephyr,code-partition = &boot_partition;
	};

To Reproduce
build mcuboot against nrf52840_pca10059 zephyr target or any else target which has shifted code-partition.

Expected behavior
linking into code partition.

Impact
mcuboot will not work on XIP target which has mcuboot partition started at offset different than Zero.

Environment

mcuboot issue
mcu-tools/mcuboot#444

@nvlsianpu nvlsianpu added bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug Regression Something, which was working, does not anymore labels Mar 15, 2019
@nvlsianpu nvlsianpu added this to the v1.14.0 milestone Mar 15, 2019
@nvlsianpu
Copy link
Collaborator Author

nvlsianpu commented Mar 15, 2019

I would introduce Kconfig property:

config USE_CODE_PARTITION
	bool "Link application into code partition"

And use it for conditional assignment to FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE the value of
$(dt_hex_val,DT_CODE_PARTITION_OFFSET) (as it is now done with BOOTLOADER_MCUBOOT).

Then BOOTLOADER_MCUBOOT should just select USE_CODE_PARTITION.

Mcuboot project should then select just select USE_CODE_PARTITION

@nvlsianpu
Copy link
Collaborator Author

cc @SebastianBoe

@lemrey
Copy link
Collaborator

lemrey commented Mar 15, 2019

Can you confirm that this affects other boards?

@nvlsianpu
Copy link
Collaborator Author

I confirm that this is issue for other boards as well.

@mike-scott
Copy link
Contributor

mike-scott commented Mar 15, 2019

I mentioned this to @carlescufi a while back on Slack. I was having a problems getting binaries built from Zephyr to have the correct flash offset settings.

I eventually got it to work by manually specifying how I wanted mcuboot built:

west build -d build/mcuboot -b nrf52840_pca10059 -s mcuboot/boot/zephyr -- -DCONFIG_FLASH_LOAD_OFFSET=0x1000 -DCONFIG_FLASH_LOAD_SIZE=0xf000

Using this method, I was able to take the .hex file directly and place it on the board using the nRF-Connect GUI tool for Linux.

@nvlsianpu
Copy link
Collaborator Author

@mike-scott Thanks for post this workaround.

@SebastianBoe
Copy link
Collaborator

@nvlsianpu : Could you do a PR with your proposed solution?

I'm not familiar enough with these symbols to review unfortunately.

@lemrey
Copy link
Collaborator

lemrey commented Mar 18, 2019

mcu-tools/mcuboot#445
but another PR should target this repo to fix nrf52840_pca10059 specifically.

nvlsianpu added a commit to nvlsianpu/zephyr that referenced this issue Mar 18, 2019
Objective of the path is to allow to select by the application
to link into the chosen code-partition.
Introduced USE_CODE_PARTITION will be set by bootloader project.

fixes zephyrproject-rtos#14566

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
@nvlsianpu
Copy link
Collaborator Author

carlescufi pushed a commit that referenced this issue Mar 19, 2019
Objective of the path is to allow to select by the application
to link into the chosen code-partition.
Introduced USE_CODE_PARTITION will be set by bootloader project.

fixes #14566

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug Regression Something, which was working, does not anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants