ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.67k stars 2.98k forks source link

Bootloader Merging Regions Error #9949

Closed Sim-jaeil closed 3 years ago

Sim-jaeil commented 5 years ago

Description

Hi. I am using the MBED boot loader function. The first attached picture below is MBED-OS-5.11.0, and it works without error. The second attached picture is a picture of MBED-OS-5.11.1 version, and all subsequent versions will behave similarly. The problem is that the "Space used after regions merged" subaddress is different from the APP start address you set. Why is that? What changed the boot loader method? I'm sorry I can not speak English well. Thank you. mbed-os-5 11 0 mbed-os-5 11 1 up

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug
ciarmcom commented 5 years ago

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-953

pawelm87 commented 5 years ago

I have this same problem. After compilate bootloader I got two files bin:

Two file have this same size and (binary) looks that same. When I used "mbed-os-example-bootloader_application.bin" to build application it doesn't work. Bootloader load app from SD, flashed memory, print message "Starting application" and stop. App don't start. The tutorial on the github website states that there should be two different files for the bootloader to work.

When I change folder "tools" (old version mbed-os probably 5.10.4) in mbed-os everything work fine, I got two file with difference size. App builded from file padded bootloader - start after flashing memory.

Compiler GCC_ARM STM32L476 - I changed mbed_app.json - bootloader works on mbed-os 5.10.4 mbed-os 5.11.5 - imported program in 20.03.2019 from git program:

  • mbed-os-example-bootloader
  • mbed-os-example-blinky

in Mbed Studio change folder "tools" don't work

Can you fix this bug or told what happens ??

trowbridgec commented 5 years ago

I've seen this same issue too in our custom project where the entire hex file (project.hex) is about the same size as the application hex file (project_application.hex).

Compiler GCC_ARM
NRF52840
mbed-os 5.12.0 RC2
project.hex: 2,119,676 bytes (2.1MB)
project_application.hex: 2,053,405 bytes (2.1MB)
cmonr commented 5 years ago

@ARMmbed/mbed-os-tools @c1728p9

mfatiga commented 5 years ago

What is the status on this? This seems to be a big issue, not being able to build a bootloader at all. Is there any temporary fix that could be done until this is solved?

theotherjimmy commented 5 years ago

not being able to build a bootloader at all

That's not what this issue is about. This issue is about missing padding after a bootloader is built. If you can't build the bootloader, please open a different issue.

mfatiga commented 5 years ago

@theotherjimmy yes, I perfectly understand what the issue is about. But the final bootloader image is not correct because it is missing the padding and because of this it does not jump to the main application address. Sorry if I expressed myself incorrectly. I have solved this in our environment in our build scripts by validating the bootloader image size with the restrict_size value in mbed_app.json and padding it if necessary. We have projects with integrated bootloader source and main application source and this issue broke our build because the main app does not start. Shouldn't this kind of bug be detected by tests?

madchutney commented 5 years ago

This looks like it was caused by PR https://github.com/ARMmbed/mbed-os/pull/8097.

boraozgen commented 4 years ago

This issue is still present in mbed-os-6.2.0.

If this is not planned to fix, at least the documentation could be updated with an alternative method. I am currently using target.mbed_app_start option in the application and flashing the bootloader and the application separately. Took me a while to find this.

mfatiga commented 4 years ago

@boraozgen Yes, looks like this is still not fixed, I am using a custom python script that is validating the bootloader image size with the restrict_size value in mbed_app.json and padding it if necessary using intelhex.

ciarmcom commented 4 years ago

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers. Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2237

0xc0170 commented 3 years ago

For anyone interested, there was a fix referenced above. As the old tools were frozen, I'll close this issue as won't fix.