Dear Chris,
As per your suggestion i been tried to work out newtmgr with slinky
example, but unfortunately i getting the same result.
I believe i mssing some step over here, please help me to check on my
procedure.
$ newt target create split_slinky Target targets/split_slinky
successfully created $ newt target set split_slinky
loader=@apache-mynewt-core/apps/slinky Target targets/split_slinky
successfully set target.loader <http://target.loader/>to
@apache-mynewt-core/apps/slinky $ newt target set split_slinky
app=@apache-mynewt-core/apps/splitty Target targets/split_slinky
successfully set target.app <http://target.app/>to
@apache-mynewt-core/apps/splitty $ newt target set split_slinky
bsp=@apache-mynewt-core/hw/bsp/nrf52dk Target targets/split_slinky
successfully set target.bsp <http://target.bsp/>to
@apache-mynewt-core/hw/bsp/nrf52dk $ newt target set split_slinky
build_profile=optimized Target targets/split_slinky successfully set
target.build_profile <http://target.build_profile/>to optimized $ newt
build split_slinky
$ newt size split_slinky Size of Application Image: app FLASH RAM 37
9944 *fill* 112 0 crt0.o <http://crt0.o/>8 0 crti.o <http://crti.o/>16 0
crtn.o <http://crtn.o/>308 1064 libg.a <http://libg.a/>124 432 nrf52dk.a
<http://nrf52dk.a/>66 0 split_slinky-sysinit-app.a
<http://split_slinky-sysinit-app.a/>697 2748 splitty.a
<http://splitty.a/>objsize text data bss dec hex filename 1336 1064
12724 15124 3b14
/home//myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty.elf
<http://splitty.elf/>Size of Loader Image: loader FLASH RAM 127 255
*fill* 441 0 base64.a <http://base64.a/>2084 32 baselibc.a
<http://baselibc.a/>1420 100 bootutil.a <http://bootutil.a/>394 0
cbmem.a <http://cbmem.a/>852 0 cborattr.a <http://cborattr.a/>64 0
cmsis-core.a <http://cmsis-core.a/>2595 217 config.a
<http://config.a/>620 0 crc.a <http://crc.a/>112 0 crt0.o
<http://crt0.o/>8 0 crti.o <http://crti.o/>16 0 crtn.o
<http://crtn.o/>1252 0 datetime.a <http://datetime.a/>1696 0 fcb.a
<http://fcb.a/>480 128 flash_map.a <http://flash_map.a/>1182 12
flash_test.a <http://flash_test.a/>1167 201 full.a <http://full.a/>374 0
hal.a <http://hal.a/>459 133 id.a <http://id.a/>1913 24 imgmgr.a
<http://imgmgr.a/>308 1064 libg.a <http://libg.a/>1492 0 libgcc.a
<http://libgcc.a/>3399 109 log.a <http://log.a/>1200 0 mbedtls.a
<http://mbedtls.a/>52 0 mem.a <http://mem.a/>376 12 mfg.a
<http://mfg.a/>219 20 mgmt.a <http://mgmt.a/>756 100 newtmgr.a
<http://newtmgr.a/>1368 44 nmgr_os.a <http://nmgr_os.a/>105 32
nmgr_shell.a <http://nmgr_shell.a/>504 496 nrf52dk.a
<http://nrf52dk.a/>3288 68 nrf52xxx.a <http://nrf52xxx.a/>6681 4045 os.a
<http://os.a/>732 140 reboot.a <http://reboot.a/>2428 239 shell.a
<http://shell.a/>980 2806 slinky.a <http://slinky.a/>467 26 split.a
<http://split.a/>72 0 split_slinky-sysinit-app.a
<http://split_slinky-sysinit-app.a/>66 0 split_slinky-sysinit-loader.a
<http://split_slinky-sysinit-loader.a/>1325 73 stats.a
<http://stats.a/>2352 0 tinycbor.a <http://tinycbor.a/>249 0 uart_hal.a
<http://uart_hal.a/>objsize text data bss dec hex filename 45616 1592
8384 55592 d928
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky.elf
<http://slinky.elf/>
j$ newt create-image split_slinky 1.0.0 <http://1.0.0.0/>Archiving
nordic.a <http://nordic.a/>Compiling split_slinky-sysflash.c
<http://split_slinky-sysflash.c/>Compiling split_slinky-sysinit-app.c
<http://split_slinky-sysinit-app.c/>Compiling
split_slinky-sysinit-loader.c
<http://split_slinky-sysinit-loader.c/>Archiving
split_slinky-sysinit-app.a <http://split_slinky-sysinit-app.a/>Linking
/home/myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty_tmp.elf
<http://splitty_tmp.elf/>Archiving nordic.a <http://nordic.a/>Compiling
split_slinky-sysflash.c <http://split_slinky-sysflash.c/>Compiling
split_slinky-sysinit-app.c <http://split_slinky-sysinit-app.c/>Compiling
split_slinky-sysinit-loader.c
<http://split_slinky-sysinit-loader.c/>Archiving
split_slinky-sysinit-loader.a
<http://split_slinky-sysinit-loader.a/>Linking
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky_tmp.elf
<http://slinky_tmp.elf/>Linking
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky.elf
<http://slinky.elf/>Generating ROM elf Linking
/home/myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty.elf
<http://splitty.elf/>App image succesfully generated:
/home/myNewtProj/bin/targets/split_slinky/loader/apps/slinky/slinky.img
<http://slinky.img/>App image succesfully generated:
/home/myNewtProj/bin/targets/split_slinky/app/apps/splitty/splitty.img
<http://splitty.img/>$ newt load split_slinky 0 Loading app image into
slot 2 Loading loader image into slot 1 $ newtmgr echo -c mynewt_serial
hello
Another possible issue i can think of is i get the following error when
issue the newtmgr command:
Error: open /dev/ttyACM0: permission denied
And i used the following command to solve the error above:
sudo chmod 666 /dev/ttyACM0
Appreciate on your help, thank you very much.
Regards,
Then Yoong Ze
On 22/1/2017 3:43 PM, Christopher Collins wrote:
Hi Then,
On Sun, Jan 22, 2017 at 08:39:45AM +0800, then yon wrote:
Dear Jacob,
Thanks for your verification, so that means i need to use newtmgr for
ota update.
I tried on newtmgr but i stuck when i tried to do something with the
remote endpoint.
Here what i did:
Then it stuck there, it same for any other command that required
interaction with remote endpoint.
My remote endpoint is nrf52dk board with bootloader and a working app
loaded.
Another noob question here, how do i add a newtmge ota update conn? Is
that add a ble conn?
I recommend trying the "slinky" app. This app is configured to support
newtmgr and image management, so you can use it to verify that your
serial setup is correct.
To support newtmgr in your app, you will need to:
1. Make sure the following packages get pulled in to the build:
- mgmt/imgmgr
- mgmt/newtmgr
- mgmt/newtmgr/transport/nmgr_shell
- sys/console/full
- sys/shell
The easiest way to do this is to add these entries to your app's or
target's pkg.yml file, in the "pkg.deps" section.
2. Enable the SHELL_TASK syscfg setting. You can do this by adding the
following lines to your app's or target's syscfg.yml file:
syscfg.vals:
# Enable the shell task.
SHELL_TASK: 1
If "syscfg.vals" is already present in the file, then you just need to
add the "SHELL_TASK: 1" line under it.
Chris
.