Unverified Commit 70bfbd21 authored by Andrzej Puzdrowski's avatar Andrzej Puzdrowski Committed by GitHub
Browse files

merge: synchronize up to 85da97f2 + cherry-pick upstream bugfixes for LTS 2.7.0

Synchronized up using merge as far as possible to not lost compatibility with TFM:
up to https://github.com/mcu-tools/mcuboot/commit/85da97f2fb4b9c5f53fae5e58d7b4201e33d4688



- introduce MCUBOOT_CPU_IDLE() for support low power single thread (fixes single thread power consumption)
- Allow not working secondary image device and boot form primary device if image available

Other fixes were cherry-picked:
- fixes memory alignment of the RAM buffer that is used to temporarily store data during swap.
- update devicetree py package lib files include path in assembly
- serial recovery: cbor_encoder: fix str encoding macros
- zephyr: Kconfig: fix board references
- do not set defaults for LOG_IMMEDIATE Kconfig
- boot: Do not use `irq_lock()` if using arm cleanup
- Kconfig: fix deadlock on cryptolib selectors

merged by Github web GUI

Signed-off-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
parents ca01db42 b549f678
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -14,10 +14,11 @@ jobs:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        stale-pr-message: 'This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.'
        stale-issue-message: 'This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.'
        days-before-stale: 60
        days-before-stale: 180
        days-before-close: 14
        stale-issue-label: 'stale'
        stale-pr-label: 'stale'
        exempt-issue-labels: 'someday'
        # exempt-pr-labels: 'Blocked,In progress'
        # exempt-issue-labels: 'In progress,Enhancement,Feature,Feature Request,RFC,Meta'
        operations-per-run: 400
+1 −0
Original line number Diff line number Diff line
@@ -613,6 +613,7 @@ boot_serial_start(const struct boot_uart_funcs *f)

    off = 0;
    while (1) {
        MCUBOOT_CPU_IDLE();
        rc = f->read(in_buf + off, sizeof(in_buf) - off, &full_line);
        if (rc <= 0 && !full_line) {
            continue;
+1 −1
Original line number Diff line number Diff line
/*
 * This file has been copied from the cddl-gen submodule.
 * Commit 8f9358a0b4b0e9b0cd579f0988056ef0b60760e4
 * Commit 9f77837f9950da1633d22abf6181a830521a6688
 */

/*
+1 −1
Original line number Diff line number Diff line
/*
 * This file has been copied from the cddl-gen submodule.
 * Commit 8f9358a0b4b0e9b0cd579f0988056ef0b60760e4
 * Commit 9f77837f9950da1633d22abf6181a830521a6688
 */

/*
+16 −5
Original line number Diff line number Diff line
/*
 * This file has been copied from the cddl-gen submodule.
 * Commit 8f9358a0b4b0e9b0cd579f0988056ef0b60760e4
 * Commit 9f77837f9950da1633d22abf6181a830521a6688
 */

/*
@@ -126,6 +126,7 @@ static bool value_extract(cbor_state_t *state,

static bool int32_decode(cbor_state_t *state, int32_t *result)
{
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);
	uint32_t uint_result;
	int32_t int_result;
@@ -155,6 +156,7 @@ static bool int32_decode(cbor_state_t *state, int32_t *result)

bool intx32_decode(cbor_state_t *state, int32_t *result)
{
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);

	if (major_type != CBOR_MAJOR_TYPE_PINT
@@ -197,6 +199,7 @@ static bool uint32_decode(cbor_state_t *state, uint32_t *result)

bool uintx32_decode(cbor_state_t *state, uint32_t *result)
{
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);

	if (major_type != CBOR_MAJOR_TYPE_PINT) {
@@ -233,6 +236,7 @@ bool uintx32_expect_union(cbor_state_t *state, uint32_t result)
static bool strx_start_decode(cbor_state_t *state,
		cbor_string_type_t *result, cbor_major_type_t exp_major_type)
{
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);

	if (major_type != exp_major_type) {
@@ -243,10 +247,10 @@ static bool strx_start_decode(cbor_state_t *state,
		FAIL();
	}

	if ((state->payload + result->len) > state->payload_end) {
	if (result->len > (state->payload_end - state->payload)) {
		cbor_print("error: 0x%x > 0x%x\r\n",
		(uint32_t)(state->payload + result->len),
		(uint32_t)state->payload_end);
		(uint32_t)result->len,
		(uint32_t)(state->payload_end - state->payload));
		FAIL_RESTORE();
	}

@@ -264,6 +268,7 @@ bool bstrx_cbor_start_decode(cbor_state_t *state, cbor_string_type_t *result)
		FAIL_RESTORE();
	}

	/* Overflow is checked in strx_start_decode() */
	state->payload_end = result->value + result->len;
	return true;
}
@@ -290,6 +295,7 @@ bool strx_decode(cbor_state_t *state, cbor_string_type_t *result,
		FAIL();
	}

	/* Overflow is checked in strx_start_decode() */
	(state->payload) += result->len;
	return true;
}
@@ -338,8 +344,9 @@ bool tstrx_expect(cbor_state_t *state, cbor_string_type_t *result)
static bool list_map_start_decode(cbor_state_t *state,
		cbor_major_type_t exp_major_type)
{
	uint32_t new_elem_count;
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);
	uint32_t new_elem_count;

	if (major_type != exp_major_type) {
		FAIL();
@@ -400,6 +407,7 @@ bool map_end_decode(cbor_state_t *state)

static bool primx_decode(cbor_state_t *state, uint32_t *result)
{
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);

	if (major_type != CBOR_MAJOR_TYPE_PRIM) {
@@ -468,6 +476,7 @@ bool boolx_expect(cbor_state_t *state, bool result)

bool double_decode(cbor_state_t *state, double *result)
{
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);

	if (major_type != CBOR_MAJOR_TYPE_PRIM) {
@@ -501,6 +510,7 @@ bool any_decode(cbor_state_t *state, void *result)
	cbor_assert(result == NULL,
			"'any' type cannot be returned, only skipped.\n");

	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);
	uint32_t value;
	uint32_t num_decode;
@@ -545,6 +555,7 @@ bool any_decode(cbor_state_t *state, void *result)

bool tag_decode(cbor_state_t *state, uint32_t *result)
{
	FAIL_IF(state->payload >= state->payload_end);
	uint8_t major_type = MAJOR_TYPE(*state->payload);

	if (major_type != CBOR_MAJOR_TYPE_TAG) {
Loading