You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Greg Foringer <gf...@gmail.com> on 2017/04/04 18:48:31 UTC
Problem loading images to nRF52DK board
Hello,
I've spent about 16 hours trying to get the nrf52_boot and blehci image
flashed to my board. I'm hoping someone has some insight about my problem.
I have installed all the SEGGER JLink tools and drivers (v6.14c) on both my
OSX host and my Ubuntu 16.04 guest. When using JLinkExe, it can connect to
the board over USB. I'm using the latest 1.0.0 version of newt. I've
followed the instructions to build the nrf52_boot bootloader for my nRF52DK
board (PCA10040 v1.1.0) as well as the blehci app.
The targets build just fine and I get a boot.elf.bin and a blehci.img.
newt load -v nrf52_boot fails whether I do it on Linux or OSX with the
following message (I've added newlines to make it more readable):
$ newt load -v nrf52_boot
Loading bootloader
Load command:
/workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk/nrf52dk_download.sh
/workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk
/workspace/bin/targets/nrf52_boot/app/apps/boot/boot
load - Error: Downloading
/workspace/bin/targets/nrf52_boot/app/apps/boot/boot.elf.bin to 0x0
GNU gdb (7.8-0ubuntu1+6) 7.8 Copyright (C) 2014 Free Software Foundation,
Inc. License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html> This is free software: you are free to
change and redistribute it. There is NO WARRANTY, to the extent permitted
by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see: <
http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at: <
http://www.gnu.org/software/gdb/documentation/>.
For help, type "help". Type "apropos word" to search for commands related
to "word".
SEGGER J-Link GDB Server V5.12c Command Line Version JLinkARM.dll V5.12c
(DLL compiled Apr 21 2016 16:22:40)
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 3333
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on
start: off
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: nRF52
Target interface: SWD
Target interface speed: 4000kHz
Target endian: little
Connecting to J-Link...
Connecting to J-Link failed.
Connected correctly?
GDBServer will be closed... Shutting down...
Could not connect to J-Link.
Please check power, connection and settings..
gdb_cmds:2: Error in sourced command file: localhost:3333: Connection timed
out.
(gdb) quit
I have tried erasing the device memory using JLinkExe and trying again,
I've tried different operating systems (except Windows because I only have
a Macbook with a Windows Guest VM and there doesn't appear to be a native
Windows newt tool). I've tried loading the images myself using the SEGGER
JLink tools but they all expect .hex files and can't read the build output
from the newt tool. I'd be happy with any solution that can simply get
these images onto my device, because I'd really like to customize the
nimBLE controller firmware for a project I'm working on this week.
Re: Problem loading images to nRF52DK board
Posted by will sanfilippo <wi...@runtime.io>.
Hello Greg:
Not sure why you are having problems using the newt tool to download, but JLinkExe can load binary files. There is a command called “loadbin” that will allow you to load a binary file at a given location. Load the bootloader at 0 and the img file that you created at address 0x8000.
The loadbin syntax is: loadbin <filename> <addr>
Just to be sure, first erase it again (using the erase command).
> On Apr 4, 2017, at 11:48 AM, Greg Foringer <gf...@gmail.com> wrote:
>
> Hello,
>
> I've spent about 16 hours trying to get the nrf52_boot and blehci image
> flashed to my board. I'm hoping someone has some insight about my problem.
>
> I have installed all the SEGGER JLink tools and drivers (v6.14c) on both my
> OSX host and my Ubuntu 16.04 guest. When using JLinkExe, it can connect to
> the board over USB. I'm using the latest 1.0.0 version of newt. I've
> followed the instructions to build the nrf52_boot bootloader for my nRF52DK
> board (PCA10040 v1.1.0) as well as the blehci app.
>
>
> The targets build just fine and I get a boot.elf.bin and a blehci.img.
>
>
> newt load -v nrf52_boot fails whether I do it on Linux or OSX with the
> following message (I've added newlines to make it more readable):
>
>
> $ newt load -v nrf52_boot
>
> Loading bootloader
>
> Load command:
> /workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk/nrf52dk_download.sh
> /workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk
> /workspace/bin/targets/nrf52_boot/app/apps/boot/boot
>
>
> load - Error: Downloading
> /workspace/bin/targets/nrf52_boot/app/apps/boot/boot.elf.bin to 0x0
>
>
> GNU gdb (7.8-0ubuntu1+6) 7.8 Copyright (C) 2014 Free Software Foundation,
> Inc. License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html> This is free software: you are free to
> change and redistribute it. There is NO WARRANTY, to the extent permitted
> by law. Type "show copying" and "show warranty" for details.
>
>
> This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
>
>
> Type "show configuration" for configuration details.
>
> For bug reporting instructions, please see: <
> http://www.gnu.org/software/gdb/bugs/>.
>
> Find the GDB manual and other documentation resources online at: <
> http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help". Type "apropos word" to search for commands related
> to "word".
>
>
> SEGGER J-Link GDB Server V5.12c Command Line Version JLinkARM.dll V5.12c
> (DLL compiled Apr 21 2016 16:22:40)
>
> -----GDB Server start settings-----
>
> GDBInit file: none
>
> GDB Server Listening port: 3333
>
> SWO raw output listening port: 2332
>
> Terminal I/O port: 2333
>
> Accept remote connection: yes
>
> Generate logfile: off
>
> Verify download: off
>
> Init regs on
>
> start: off
>
> Silent mode: off
>
> Single run mode: on
>
>
> Target connection timeout: 0 ms
>
>
> ------J-Link related settings------
>
> J-Link Host interface: USB
>
> J-Link script: none
>
> J-Link settings file: none
>
>
> ------Target related settings------
>
> Target device: nRF52
>
> Target interface: SWD
>
> Target interface speed: 4000kHz
>
> Target endian: little
>
>
> Connecting to J-Link...
>
> Connecting to J-Link failed.
>
> Connected correctly?
>
> GDBServer will be closed... Shutting down...
>
> Could not connect to J-Link.
>
> Please check power, connection and settings..
>
> gdb_cmds:2: Error in sourced command file: localhost:3333: Connection timed
> out.
>
> (gdb) quit
>
>
> I have tried erasing the device memory using JLinkExe and trying again,
> I've tried different operating systems (except Windows because I only have
> a Macbook with a Windows Guest VM and there doesn't appear to be a native
> Windows newt tool). I've tried loading the images myself using the SEGGER
> JLink tools but they all expect .hex files and can't read the build output
> from the newt tool. I'd be happy with any solution that can simply get
> these images onto my device, because I'd really like to customize the
> nimBLE controller firmware for a project I'm working on this week.
Re: Problem loading images to nRF52DK board
Posted by Christopher Collins <ch...@runtime.io>.
Hi Greg,
On Tue, Apr 04, 2017 at 06:48:31PM +0000, Greg Foringer wrote:
> Hello,
>
> I've spent about 16 hours trying to get the nrf52_boot and blehci image
> flashed to my board. I'm hoping someone has some insight about my problem.
>
> I have installed all the SEGGER JLink tools and drivers (v6.14c) on both my
> OSX host and my Ubuntu 16.04 guest. When using JLinkExe, it can connect to
> the board over USB. I'm using the latest 1.0.0 version of newt. I've
> followed the instructions to build the nrf52_boot bootloader for my nRF52DK
> board (PCA10040 v1.1.0) as well as the blehci app.
[...]
> gdb_cmds:2: Error in sourced command file: localhost:3333: Connection timed
> out.
Hmm, it looks like JLinkGDBServer isn't staying up (or isn't getting
started at all). Probably unlikely, but still worth asking: could you
have an instance of JLinkExe already running on that machine? If any
JLink tool is already running, a second invocation will fail.
One way to debug this is to manually do what newt does and see where
the process fails:
In terminal 1:
JLinkGDBServer -device nRF52 -speed 4000 -if SWD -port 3333
-singlerun -reset
In terminal 2:
arm-none-eabi-gdb
(gdb) mon reset
Resetting target
(gdb) restore /Users/ccollins/repos/mynewt/core/bin/targets/boot-nrf52dk/app/apps/boot/boot.elf.bin binary 0
Restoring binary file /Users/ccollins/repos/mynewt/core/bin/targets/boot-nrf52dk/app/apps/boot/boot.elf.bin into memory (0x0 to 0x23e0)
(of course you will need to adjust the path of your boot binary).
You can also load the image into slot 0:
(gdb) restore /Users/ccollins/repos/mynewt/core/bin/targets/blehci-nrf52dk/app/apps/blehci/blehci.img binary 0x8000
Chris
Re: Problem loading images to nRF52DK board
Posted by will sanfilippo <wi...@runtime.io>.
BTW, I am curious: what modifications are you going to make to the controller? If you do not want or cannot say, no problem. Just interested to hear different use cases/modifications that folks want to do.
Oh, and my post was just to get you going quickly; I am sure we can debug your issue.
> On Apr 4, 2017, at 11:48 AM, Greg Foringer <gf...@gmail.com> wrote:
>
> Hello,
>
> I've spent about 16 hours trying to get the nrf52_boot and blehci image
> flashed to my board. I'm hoping someone has some insight about my problem.
>
> I have installed all the SEGGER JLink tools and drivers (v6.14c) on both my
> OSX host and my Ubuntu 16.04 guest. When using JLinkExe, it can connect to
> the board over USB. I'm using the latest 1.0.0 version of newt. I've
> followed the instructions to build the nrf52_boot bootloader for my nRF52DK
> board (PCA10040 v1.1.0) as well as the blehci app.
>
>
> The targets build just fine and I get a boot.elf.bin and a blehci.img.
>
>
> newt load -v nrf52_boot fails whether I do it on Linux or OSX with the
> following message (I've added newlines to make it more readable):
>
>
> $ newt load -v nrf52_boot
>
> Loading bootloader
>
> Load command:
> /workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk/nrf52dk_download.sh
> /workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk
> /workspace/bin/targets/nrf52_boot/app/apps/boot/boot
>
>
> load - Error: Downloading
> /workspace/bin/targets/nrf52_boot/app/apps/boot/boot.elf.bin to 0x0
>
>
> GNU gdb (7.8-0ubuntu1+6) 7.8 Copyright (C) 2014 Free Software Foundation,
> Inc. License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html> This is free software: you are free to
> change and redistribute it. There is NO WARRANTY, to the extent permitted
> by law. Type "show copying" and "show warranty" for details.
>
>
> This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
>
>
> Type "show configuration" for configuration details.
>
> For bug reporting instructions, please see: <
> http://www.gnu.org/software/gdb/bugs/>.
>
> Find the GDB manual and other documentation resources online at: <
> http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help". Type "apropos word" to search for commands related
> to "word".
>
>
> SEGGER J-Link GDB Server V5.12c Command Line Version JLinkARM.dll V5.12c
> (DLL compiled Apr 21 2016 16:22:40)
>
> -----GDB Server start settings-----
>
> GDBInit file: none
>
> GDB Server Listening port: 3333
>
> SWO raw output listening port: 2332
>
> Terminal I/O port: 2333
>
> Accept remote connection: yes
>
> Generate logfile: off
>
> Verify download: off
>
> Init regs on
>
> start: off
>
> Silent mode: off
>
> Single run mode: on
>
>
> Target connection timeout: 0 ms
>
>
> ------J-Link related settings------
>
> J-Link Host interface: USB
>
> J-Link script: none
>
> J-Link settings file: none
>
>
> ------Target related settings------
>
> Target device: nRF52
>
> Target interface: SWD
>
> Target interface speed: 4000kHz
>
> Target endian: little
>
>
> Connecting to J-Link...
>
> Connecting to J-Link failed.
>
> Connected correctly?
>
> GDBServer will be closed... Shutting down...
>
> Could not connect to J-Link.
>
> Please check power, connection and settings..
>
> gdb_cmds:2: Error in sourced command file: localhost:3333: Connection timed
> out.
>
> (gdb) quit
>
>
> I have tried erasing the device memory using JLinkExe and trying again,
> I've tried different operating systems (except Windows because I only have
> a Macbook with a Windows Guest VM and there doesn't appear to be a native
> Windows newt tool). I've tried loading the images myself using the SEGGER
> JLink tools but they all expect .hex files and can't read the build output
> from the newt tool. I'd be happy with any solution that can simply get
> these images onto my device, because I'd really like to customize the
> nimBLE controller firmware for a project I'm working on this week.
Re: Problem loading images to nRF52DK board
Posted by will sanfilippo <wi...@runtime.io>.
BTW, I am curious: what modifications are you going to make to the controller? If you do not want or cannot say, no problem. Just interested to hear different use cases/modifications that folks want to do.
Oh, and my post was just to get you going quickly; I am sure we can debug your issue.
> On Apr 4, 2017, at 11:48 AM, Greg Foringer <gf...@gmail.com> wrote:
>
> Hello,
>
> I've spent about 16 hours trying to get the nrf52_boot and blehci image
> flashed to my board. I'm hoping someone has some insight about my problem.
>
> I have installed all the SEGGER JLink tools and drivers (v6.14c) on both my
> OSX host and my Ubuntu 16.04 guest. When using JLinkExe, it can connect to
> the board over USB. I'm using the latest 1.0.0 version of newt. I've
> followed the instructions to build the nrf52_boot bootloader for my nRF52DK
> board (PCA10040 v1.1.0) as well as the blehci app.
>
>
> The targets build just fine and I get a boot.elf.bin and a blehci.img.
>
>
> newt load -v nrf52_boot fails whether I do it on Linux or OSX with the
> following message (I've added newlines to make it more readable):
>
>
> $ newt load -v nrf52_boot
>
> Loading bootloader
>
> Load command:
> /workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk/nrf52dk_download.sh
> /workspace/repos/apache-mynewt-core/hw/bsp/nrf52dk
> /workspace/bin/targets/nrf52_boot/app/apps/boot/boot
>
>
> load - Error: Downloading
> /workspace/bin/targets/nrf52_boot/app/apps/boot/boot.elf.bin to 0x0
>
>
> GNU gdb (7.8-0ubuntu1+6) 7.8 Copyright (C) 2014 Free Software Foundation,
> Inc. License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html> This is free software: you are free to
> change and redistribute it. There is NO WARRANTY, to the extent permitted
> by law. Type "show copying" and "show warranty" for details.
>
>
> This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
>
>
> Type "show configuration" for configuration details.
>
> For bug reporting instructions, please see: <
> http://www.gnu.org/software/gdb/bugs/>.
>
> Find the GDB manual and other documentation resources online at: <
> http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help". Type "apropos word" to search for commands related
> to "word".
>
>
> SEGGER J-Link GDB Server V5.12c Command Line Version JLinkARM.dll V5.12c
> (DLL compiled Apr 21 2016 16:22:40)
>
> -----GDB Server start settings-----
>
> GDBInit file: none
>
> GDB Server Listening port: 3333
>
> SWO raw output listening port: 2332
>
> Terminal I/O port: 2333
>
> Accept remote connection: yes
>
> Generate logfile: off
>
> Verify download: off
>
> Init regs on
>
> start: off
>
> Silent mode: off
>
> Single run mode: on
>
>
> Target connection timeout: 0 ms
>
>
> ------J-Link related settings------
>
> J-Link Host interface: USB
>
> J-Link script: none
>
> J-Link settings file: none
>
>
> ------Target related settings------
>
> Target device: nRF52
>
> Target interface: SWD
>
> Target interface speed: 4000kHz
>
> Target endian: little
>
>
> Connecting to J-Link...
>
> Connecting to J-Link failed.
>
> Connected correctly?
>
> GDBServer will be closed... Shutting down...
>
> Could not connect to J-Link.
>
> Please check power, connection and settings..
>
> gdb_cmds:2: Error in sourced command file: localhost:3333: Connection timed
> out.
>
> (gdb) quit
>
>
> I have tried erasing the device memory using JLinkExe and trying again,
> I've tried different operating systems (except Windows because I only have
> a Macbook with a Windows Guest VM and there doesn't appear to be a native
> Windows newt tool). I've tried loading the images myself using the SEGGER
> JLink tools but they all expect .hex files and can't read the build output
> from the newt tool. I'd be happy with any solution that can simply get
> these images onto my device, because I'd really like to customize the
> nimBLE controller firmware for a project I'm working on this week.