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

MCU boot for pca20035 #44

Closed
wants to merge 91 commits into from
Closed

Conversation

joakimtoe
Copy link

No description provided.

utzig and others added 30 commits January 21, 2019 16:53
This updates all references from github.com/runtimeco to
github.com/JuulLabs-OSS in docs and yml files.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Because the amount of features that the simulator is testing is growing,
the test time is taking a long time. This distributes simulator's tests
over three travis machines to decrease test time.

Add options to defined tests that run one-by-one in a sequential fashion
by defining them in $SINGLE_FEATURES, and allow defining features that
should run together by providing a string of ',' separated list of
multiple tests in $MULTI_FEATURES.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Signed-off-by: Fabio Utzig <utzig@apache.org>
Signed-off-by: Fabio Utzig <utzig@apache.org>
Use existing global var instead of using locally declared variable,
reducing RAM usage.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Also add overwrite-only + encrypted tests to travis-ci.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Throw exception on values that are less than the minimum acceptable size
of 32 bytes.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Generating images with no signature or encryption was broken by commit
06b77b8

This allows generating images with just sha256 again, and fixes a few
leftovers from the imghash TLV change.

Signed-off-by: Fabio Utzig <utzig@apache.org>
TLV types don't need to list KEYHASH because it's already added by any
signature TLV.

Total sizes were missing the KEYHASH amount.

Add a new TLV for images signed with RSA and encrypted with RSA-OAEP.

Signed-off-by: Fabio Utzig <utzig@apache.org>
This makes it easier to choose the mbedTLS config file when multiple
features share files.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Signed-off-by: Fabio Utzig <utzig@apache.org>
This adds an HDR_SIZE constant to the simulator which allows for easier
testing of images with different header sizes.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Encrypted images were known to be failing when the header size was larger
than 256 bytes because of incorrect handling of blocks sent to decryption
and hashing routines. An assert was previously added to check the header
and read block sizes matched to avoid incurring into the know error, but
it was incorrectly enabled also for non-encrypted images.

Now the handling of the header, which is not encrypted, is correctly
separated from the handling of the remaining image, when encryption is
used, to avoid ever sending header data into the decryption routines.

Signed-off-by: Fabio Utzig <utzig@apache.org>
For Zephyr the default mbedTLS mempool size for RSA-2048 signing was not
enough to allow for the calculations done by RSA-2048-OAEP (encrypted
images), so when encrypted image support is enabled, increase it to a
value that is known to work.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Signed-off-by: Fabio Utzig <utzig@apache.org>
gcc create has become deprecated: https://crates.io/crates/gcc

Signed-off-by: Fabio Utzig <utzig@apache.org>
Update `flash_area_*()` functions to call `sim_flash_*()` directly
instead of using `hal_flash_*()` functions that were not part of the
main bootloader anymore.

Signed-off-by: Fabio Utzig <utzig@apache.org>
A new align() function was added to SimFlash, and most functions that
were using/receiving align or erased_val parameters that had access to a
Flash trait were cleaned up so that they get the parameters directly
from the Flash device.

This will make it easier to extend for multiple Flash devices since
parameters should depend on the device in use.

Signed-off-by: Fabio Utzig <utzig@apache.org>
The previous c/rust ffi functions were hardcoding the values of align
and erased_val before each run through static globals. This adds new sim
flash functions that get the align/erased_val from the sim flash device
that is being run on, allowing that later multiple flash devices can
each use its own params.

Signed-off-by: Fabio Utzig <utzig@apache.org>
AreaDesc was modified to not receive a flash device on its constructor,
and instead a new function `add_flash_sectors` was added that allows it
to receive a flash device and id.

The `add_image` function that populates the areas also now receives a
dev_id that is used internally as fa_device_id.

Signed-off-by: Fabio Utzig <utzig@apache.org>
A new type `FlashMap` that stores a HashMap of [device_id -> Flash trait]
was added, which enables multi-flash devices to be passed around.

The previously existing static FLASH value that was used to simulate the
raw device, was updated to using a FlashMap which enables bootutil to
interface with more than one flash device.

Signed-off-by: Fabio Utzig <utzig@apache.org>
This adds an initial device with multiple flash (nrf52840 + SPI flash)
and updates all test routines to use a HashMap of flash devices (added
as type SimFlashMap).

Signed-off-by: Fabio Utzig <utzig@apache.org>
This adds an external SPI flash that uses a larger sector size than
the internal flash. Currently this breaks the tests but it's being
added here to trigger a CI fail that will be fixed by adding support
for this feature in a subsequent commit.

Signed-off-by: Fabio Utzig <utzig@apache.org>
Signed-off-by: Fabio Utzig <utzig@apache.org>
This adds bootutil support for slots on different flash devices
the happen to have different sector sizes.

It consists basically in relaxing the `boot_slots_compatible` to
allow swaps as long as the sectors that are required to fit both
images are able to fit inside scratch and both slot's sectors have
sizes that are multiple of each other.

This is now tested on the simulator and was tested in a Nordic's
pca10056 using slot0 in internal flash, and slot1 in the external
QSPI flash, configured with 4K, 8K and 16K sized sectors (the HW
is 4KB but Mynewt allows emulating multiples of that!)

Signed-off-by: Fabio Utzig <utzig@apache.org>
Signed-off-by: Timo Kröger <timokroeger93@gmail.com>
Make RX buffer size configurable for UART. Allow incoming
interrupts while copying data out of that buffer.

Signed-off-by: Marko Kiiskila <marko@apache.org>
Signed-off-by: Marko Kiiskila <marko@apache.org>
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
hakonfam and others added 16 commits April 12, 2019 13:18
Prior to this, the update hex was deduced from the update.bin.
The problem is that update.bin does not have the end padding.
The end padding is required for mcuboot to upgrade a hex file
flashed directly to the secondary slot.

Fix this by having a separate sign command for update.hex which
includes the --pad argument. This enables the user to verify
the update process by flashing the update.hex file directly to
the board.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Fix the TINYCBOR build scripts to work with multi-image.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Add button 1 as default serial detect pin for nrf9160_pca10090

Signed-off-by: Andreas Vibeto <andreas.vibeto@nordicsemi.no>
Use 'inside' and 'inherit_size'.
Add KConfig-based size entries.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Upstream changed the name of 'kernel_elf' to 'zephyr_final', in this
commit we do the same renaming.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Only build agent should be used for building jobs.

Signed-off-by: Chris Bittner <chris.bittner@nordicsemi.no>
Follow the device name changes in Zephyr.

Signed-off-by: Filip Kubicz <filip.kubicz@nordicsemi.no>
Use the automatically generated hex file for the app partition.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
When a parent image selects MCUboot, it should be signed regardless
of whether or not mcuboot is being built from source.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Make it easier for the user to change the mcuboot version
by extracting this as a kconfig variabl.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
It is required to depend on both the wrapper target and the file.
This patch adds the missing file dependency.
Prior to this signed.hex (and following files) were not updated
upon code change.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
This is needed when the properties are automatically set.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
@NordicBuilder
Copy link

Found the following issues, please fix and resubmit:

Gitlint issues

1: UC2 Body does not contain a 'Signed-Off-By' line
1: UC3 Title does not follow [subsystem]: [subject] (and should not start with literal subsys:): "MCU boot for pca20035"
1: UC6 Body has no content, should at least have 1 line.
3: B6 Body message is missing

Identity/Emails issues

83b5f59: author email (Jan Tore Guggedal jantore.guggedal@nordicsemi.no) needs to match one of the signed-off-by entries.

@nvlsianpu nvlsianpu self-requested a review July 1, 2019 07:21
@nvlsianpu
Copy link
Contributor

Please follow ncs commit message guideline. I expect something like here: 8b0e50c

@nvlsianpu nvlsianpu requested review from SebastianBoe, mbolivar and pdunaj and removed request for SebastianBoe July 1, 2019 07:28
@@ -0,0 +1,39 @@
# Enable RTT logging
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused. The next line (CONFIG_LOG=n) isn't enabling logging; it's disabling logging.

@@ -54,6 +54,8 @@ macro(app_set_runner_args)
endif()
endmacro()

include($ENV{ZEPHYR_BASE}/../nrf/cmake/boilerplate.cmake NO_POLICY_SCOPE)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a comment about why this line is needed? I'm guessing it's because it's an out of tree board definition?

@CLAassistant
Copy link

CLAassistant commented Jul 19, 2019

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 16 committers have signed the CLA.

✅ hakonfam
❌ rgundi
❌ timokroeger
❌ lemrey
❌ utzig
❌ mkiiskila
❌ d3zd3z
❌ ChristopherBittner
❌ sigvartmh
❌ nvlsianpu
❌ ccollins476ad
❌ oyvindronningstad
❌ SebastianBoe
❌ andvib
❌ Qbicz
❌ jtguggedal
You have signed the CLA already but the status is still pending? Let us recheck it.

@nvlsianpu
Copy link
Contributor

@joakimtoe Can you rebate your changes at current master?

@bjda bjda mentioned this pull request Sep 20, 2019
@joakimtoe joakimtoe closed this Sep 30, 2019
nvlsianpu added a commit to nvlsianpu/fw-nrfconnect-mcuboot that referenced this pull request Feb 8, 2021
Synch up to:
mcu-tools/mcuboot@a513b8e

merged by GitHub GUI nrfconnect#44

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.