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 not working on disco_l475_iot1 #24243

Closed
nandojve opened this issue Apr 9, 2020 · 6 comments · Fixed by mcu-tools/mcuboot#714, zephyrproject-rtos/mcuboot#13 or #24387
Closed

MCUBoot not working on disco_l475_iot1 #24243

nandojve opened this issue Apr 9, 2020 · 6 comments · Fixed by mcu-tools/mcuboot#714, zephyrproject-rtos/mcuboot#13 or #24387
Labels
area: Flash bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug

Comments

@nandojve
Copy link
Member

nandojve commented Apr 9, 2020

Describe the bug

*** Booting Zephyr OS build zephyr-v2.2.0-1280-g96f76968ebc6  ***
[00:00:00.005,000] <inf> mcuboot: Starting bootloader
[00:00:00.006,000] <wrn> mcuboot: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?
[00:00:00.006,000] <err> mcuboot: Image in the primary slot is not valid!
[00:00:00.006,000] <err> mcuboot: Unable to find bootable image

To Reproduce
Build current mainline MCUBoot/Zephyr for disco_l475_iot1 board

Expected behavior
After apply this patch it worked fine.

diff --git a/boot/zephyr/boards/disco_l475_iot1.conf b/boot/zephyr/boards/disco_l475_iot1.conf
new file mode 100644
index 0000000..6cedc26
--- /dev/null
+++ b/boot/zephyr/boards/disco_l475_iot1.conf
@@ -0,0 +1,2 @@
+# MCUBoot settings
+CONFIG_BOOT_MAX_IMG_SECTORS=256

Shell:

*** Booting Zephyr OS build zephyr-v2.2.0-1280-g96f76968ebc6  ***
[00:00:00.005,000] <inf> mcuboot: Starting bootloader
[00:00:00.007,000] <inf> mcuboot: Primary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.007,000] <inf> mcuboot: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.007,000] <inf> mcuboot: Boot source: primary slot
[00:00:00.015,000] <inf> mcuboot: Swap type: none


uart:~$ *** Booting Zephyr OS build zephyr-v2.2.0-1260-g6e899acce9bb  ***
[00:00:00.539,000] <inf> net_config: Initializing network
[00:00:00.539,000] <inf> net_config: IPv4 address: 192.168.50.153
uart:~$ 

Environment (please complete the following information):

  • OS: Linux
  • Toolchain Zephyr SDK 0.11.2
  • mainline

Additional context
I not sure if the fix should be sent to MCUBoot module or it can be addressed on Zephyr side like on board, SoC or flash driver.

@nandojve nandojve added the bug The issue is a bug, or the PR is fixing a bug label Apr 9, 2020
@erwango
Copy link
Member

erwango commented Apr 9, 2020

^^@ABOSTM

@ABOSTM
Copy link
Collaborator

ABOSTM commented Apr 10, 2020

Hi @nandojve ,
I could not find the file your are talking about

/boot/zephyr/boards/disco_l475_iot1.conf

https://github.com/zephyrproject-rtos/mcuboot/tree/master/boot/zephyr/boards
not even in MCU official github
https://github.com/JuulLabs-OSS/mcuboot/tree/master/boot/zephyr/boards
So where does it come from ?

@ABOSTM
Copy link
Collaborator

ABOSTM commented Apr 10, 2020

Hi @nandojve ,
Ok I get it. you propose a new file.
So can you create a PullRequest in zephyr, but in https://github.com/zephyrproject-rtos/mcuboot/

So this issue should be moved to https://github.com/zephyrproject-rtos/mcuboot/ (instead of https://github.com/zephyrproject-rtos/zephyr)

@utzig
Copy link
Member

utzig commented Apr 11, 2020

Hi @nandojve ,
Ok I get it. you propose a new file.
So can you create a PullRequest in zephyr, but in https://github.com/zephyrproject-rtos/mcuboot/

The fix is correct but you have to submit the PR here: https://github.com/JuulLabs-OSS/mcuboot

utzig pushed a commit to mcu-tools/mcuboot that referenced this issue Apr 11, 2020
The STM32L475 needs BOOT_MAX_IMG_SECTORS equal 256 to work properly.
This add a config file to change default value from 128 to 256 once
there isn't a proper way to handle using Device Tree.

fixes zephyrproject-rtos/zephyr/issues/24243

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
@carlescufi carlescufi added the priority: low Low impact/importance bug label Apr 14, 2020
@carlescufi
Copy link
Member

@nandojve will you send a PR to zephyr's MCUboot to update our fork?

@carlescufi
Copy link
Member

Not considered a Zephyr bug since this is board support in mcuboot and has been done upstream.

nandojve added a commit to nandojve/zephyr that referenced this issue Apr 16, 2020
MCUBoot not working on disco_l475_iot1.

Fixes zephyrproject-rtos#24243.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
carlescufi pushed a commit that referenced this issue Apr 17, 2020
MCUBoot not working on disco_l475_iot1.

Fixes #24243.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
hakehuang pushed a commit to hakehuang/zephyr that referenced this issue Jun 20, 2020
MCUBoot not working on disco_l475_iot1.

Fixes zephyrproject-rtos#24243.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Flash bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug
Projects
None yet
5 participants