Skip to content

Commit 47adeae

Browse files
committed
Merge remote-tracking branch 'upstream/master' into boot/nxboot/loader/boot.c-Incorrect-maths-for-percent-remaining-progress-display
2 parents 6d2600b + 8fbba09 commit 47adeae

File tree

59 files changed

+3586
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3586
-71
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ jobs:
368368
- name: Extract sources
369369
run: |
370370
7z x sources.tar.gz -y
371-
7z x sources.tar -y
371+
7z x sources.tar -y -snld
372372
373373
- name: Run Builds
374374
run: |

boot/nxboot/loader/boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state,
164164
#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT
165165
total_size = remain;
166166
#endif
167-
blocksize = MAX(info_from.blocksize, info_where.blocksize);
167+
blocksize = info_where.blocksize;
168168

169169
buf = malloc(blocksize);
170170
if (!buf)

boot/nxboot/loader/flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int flash_partition_open(const char *path)
6464
{
6565
int fd;
6666

67-
fd = open(path, O_RDWR);
67+
fd = open(path, O_RDWR | O_DIRECT);
6868
if (fd < 0)
6969
{
7070
syslog(LOG_ERR, "Could not open %s partition: %s\n",

examples/keyboard/kbd_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ int main(int argc, FAR char *argv[])
141141
else
142142
{
143143
printf("Sample :\n");
144-
printf(" code : %d\n", sample.code);
145-
printf(" type : %d\n", sample.type);
144+
printf(" code : %" PRIu32 "\n", sample.code);
145+
printf(" type : %" PRIu32 "\n", sample.type);
146146
}
147147

148148
if (nsamples && --nsamples <= 0)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ##############################################################################
2+
# apps/examples/mcuboot/update_agent_local/CMakeLists.txt
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
7+
# license agreements. See the NOTICE file distributed with this work for
8+
# additional information regarding copyright ownership. The ASF licenses this
9+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
10+
# use this file except in compliance with the License. You may obtain a copy of
11+
# the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations under
19+
# the License.
20+
#
21+
# ##############################################################################
22+
23+
if(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT)
24+
nuttx_add_application(
25+
NAME
26+
${CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PROGNAME}
27+
SRCS
28+
mcuboot_local_agent_main.c
29+
STACKSIZE
30+
${CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_STACKSIZE}
31+
PRIORITY
32+
${CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PRIORITY})
33+
endif()
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
config EXAMPLES_MCUBOOT_LOCAL_AGENT
7+
tristate "MCUBoot Local Update Agent"
8+
default n
9+
depends on BOOT_MCUBOOT
10+
select BOARDCTL
11+
select BOARDCTL_RESET
12+
---help---
13+
Enable the MCUBoot Local Update Agent example.
14+
This application reads a firmware binary from local storage
15+
and copies it to the MCUBoot secondary flash slot for update.
16+
17+
if EXAMPLES_MCUBOOT_LOCAL_AGENT
18+
19+
config EXAMPLES_MCUBOOT_LOCAL_AGENT_PROGNAME
20+
string "Program name"
21+
default "mcuboot_local_agent"
22+
---help---
23+
This is the name of the program that will be used when the NSH ELF
24+
program is installed.
25+
26+
config EXAMPLES_MCUBOOT_LOCAL_AGENT_PRIORITY
27+
int "MCUBoot Local Agent task priority"
28+
default 100
29+
30+
config EXAMPLES_MCUBOOT_LOCAL_AGENT_STACKSIZE
31+
int "MCUBoot Local Agent stack size"
32+
default DEFAULT_TASK_STACKSIZE
33+
34+
config EXAMPLES_MCUBOOT_LOCAL_AGENT_DEFAULT_PATH
35+
string "Default firmware file path"
36+
default "/mnt/sdcard/firmware.bin"
37+
---help---
38+
Default path to the firmware binary file on local storage.
39+
This can be overridden by passing a path as a command line argument.
40+
41+
endif # EXAMPLES_MCUBOOT_LOCAL_AGENT
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
############################################################################
2+
# apps/examples/mcuboot/update_agent_local/Make.defs
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more
7+
# contributor license agreements. See the NOTICE file distributed with
8+
# this work for additional information regarding copyright ownership. The
9+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance with the
11+
# License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
############################################################################
22+
23+
ifneq ($(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT),)
24+
CONFIGURED_APPS += $(APPDIR)/examples/mcuboot/update_agent_local
25+
endif
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
############################################################################
2+
# apps/examples/mcuboot/update_agent_local/Makefile
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed to the Apache Software Foundation (ASF) under one or more
7+
# contributor license agreements. See the NOTICE file distributed with
8+
# this work for additional information regarding copyright ownership. The
9+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance with the
11+
# License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+
# License for the specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
############################################################################
22+
23+
include $(APPDIR)/Make.defs
24+
25+
MAINSRC = mcuboot_local_agent_main.c
26+
27+
PROGNAME = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PROGNAME)
28+
PRIORITY = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PRIORITY)
29+
STACKSIZE = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_STACKSIZE)
30+
MODULE = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT)
31+
32+
include $(APPDIR)/Application.mk

0 commit comments

Comments
 (0)