Adafruit nRF52 Pro Feather with Mynewt Created by lady ada Last updated on 2019-04-05 09:48:02 AM UTC
Overview The Adafruit Feather nRF52 Pro is our latest Bluetooth Low Energy board for advanced projects and users who want to use a fully open source Bluetooth Low Energy 5.0 stack. It has a native-bluetooth chip, the nRF52832, as well as built in USB Serial and battery charging! We have other boards in the Feather family, check'em out here. (https://adafru.it/l7B) This is a special Feather - unlike the rest of the Feather family, this board is not for use with Arduino IDE.
an SWD connector and an additional DFU button. If you want to use the nRF52 with Arduino IDE please check out the Bluefruit nRF52 Feather which works out-of-the-box with our Arduino board support package. (https://adafru.it/vAx) This Feather is for advanced users only, you will be interacting with the Mynewt RTOS rather than Arduino and you cannot easily go back-and-forth without an SWD programmer.
The Adafruit Feather nRF52 Pro ships pre-programmed with the Mynewt serial bootloader that allows you to flash firmware to the device directly from the command-line using the on-board USB Serial converter and the 'newtmgr' tool, so you can get started right away with no additional hardware required. For more advanced debugging, however, you can use a Segger J-Link and the on-board SWD debug connector, which gives you access to a more powerful set of development tools and options.
Features: ARM Cortex M4F (with HW floating point acceleration) running at 64MHz 512KB flash and 64KB SRAM Built in USB Serial converter for fast and efficient programming and debugging Bluetooth Low Energy compatible 2.4GHz radio (Details available in the nRF52832 (https://adafru.it/Erx) product specification) FCC / IC / TELEC certified module Up to +4dBm output power 1.7v to 3.
also toss in some header so you can solder it in and plug into a solderless breadboard. Lipoly battery (https://adafru.it/e0v) and MicroUSB cable (https://adafru.
Device Pinout © Adafruit Industries https://learn.adafruit.
Please note that the nRF52832 uses a USB serial adapter to RXD/TXD are with respect to the nRF52 Special Notes The following pins have some restrictions that need to be taken into account when using them: PIN_DFU / P0.20: If this pin is detected to be at GND level at startup, the board will enter a special serial bootloader mode and will not execute any user code, going straight into bootloader mode.
during the bootloader phase. FRST does not work with Mynewt bootloader !! Power Pins 3.3V Output: This two pins are connected to the output of the on board 3.3V regulator. They can be used to supply 3.3V power to external sensors, breakouts or Feather Wings. LIPO Input (VBAT): This is the voltage supply off the optional LIPO cell that can be connected via the JST PH connector. It is nominally ~3.5-4.2V. VREG Enable: This pin can be set to GND to disable the 3.3V output from the on board voltage regulator.
Assembly We ship Feathers fully tested but without headers attached - this gives you the most flexibility on choosing how to use and configure your Feather Header Options! Before you go gung-ho on soldering, there's a few options to consider! The first option is soldering in plain male headers, this lets you plug in the Feather into a solderless breadboard © Adafruit Industries https://learn.adafruit.
Another option is to go with socket female headers. This won't let you plug the Feather into a breadboard but it will let you attach featherwings very easily © Adafruit Industries https://learn.adafruit.
We also have 'slim' versions of the female headers, that are a little shorter and give a more compact shape © Adafruit Industries https://learn.adafruit.
Finally, there's the "Stacking Header" option. This one is sort of the best-of-both-worlds. You get the ability to plug into a solderless breadboard and plug a featherwing on top. But its a little bulky Soldering in Plain Headers Prepare the header strip: Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down Add the breakout board: Place the breakout board over the pins so that the short © Adafruit Industries https://learn.adafruit.
pins poke through the breakout pads And Solder! Be sure to solder all pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
Solder the other strip as well. © Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the next steps Soldering on Female Header Tape In Place For sockets you'll want to tape them in place so when you flip over the board they don't fall out Flip & Tack Solder After flipping over, solder one or two points on each strip, to 'tack' the header in place © Adafruit Industries https://learn.adafruit.
© Adafruit Industries https://learn.adafruit.
And Solder! Be sure to solder all pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the next steps © Adafruit Industries https://learn.adafruit.
Native Installation (OS X) Mynewt relies on two command line utilities ( newt and newtmgr ), both of which are described elsewhere in this learning guide, as well as the presence of an ARM cross-compiling toolchain ( arm-none-eabi-gcc , etc.). Both of these need to be installed and available on your system to work with Mynewt projects. Install newt and newtmgr Binaries Binary versions of the command-line tools are available from Apache.
$ newtmgr help Newtmgr helps you manage remote devices running the Mynewt OS Usage: newtmgr [flags] newtmgr [command] Available Commands: config Read or write a config value on a device conn Manage newtmgr connection profiles crash Send a crash command to a device datetime Manage datetime on a device echo Send data to a device and display the echoed back data fs Access files on a device help Help about any command image Manage images on a device log Manage logs on a device mpstat Read mempool statistics fro
Optional: Install the OpenOCD Debugger If you wish to debug or flash your projects with a Segger J-Link, you will also need to install the OpenOCD debug tool via the following steps: $ brew install openocd If you see one of these errors: Library not loaded: /usr/local/lib/libusb-0.1.4.dylib Run: brew install libusb-compat Library not loaded: /usr/local/opt/libftdi/lib/libftdi1.2.dylib Run: brew install libftdi Library not loaded: /usr/local/lib/libhidapi.0.
throughout this learning guide. It can be installed from the command-line with the following command: $ brew install minicom You can establish a serial connection via minicom with the following command (adjusting the /dev/tty device name as appropriate): $ minicom -D /dev/tty.SLAB_USBtoUART © Adafruit Industries https://learn.adafruit.
Native Installation (Linux) Mynewt relies on two command line utilities ( newt and newtmgr ), both of which are described elsewhere in this learning guide, as well as the presence of an ARM cross-compiling toolchain ( arm-none-eabi-gcc , etc.). Both of these need to be installed and available on your system to work with Mynewt projects. Install newt and newtmgr Binaries Binary versions of the command-line tools are available from Apache. The full setup guide is available here: https://mynewt.apache.
$ sudo apt-get install openocd Once it is installed, you can check and make sure you have at least v 0.10.0 which support nRF52 chip $openocd -v Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html If you see any of these error messages: openocd: error while loading shared libraries: libhidapi-hidraw.so.0: cannot open shared object file: No such file or directory openocd: error while loading shared libraries: libusb-1.0.so.
A relatively easy to use command line application to work with serial port connections is minicom, which is used throughout this learning guide. It can be installed from the command-line with the following command: $ sudo apt-get install minicom You can establish a serial connection via minicom with the following command (adjusting the /dev/tty device name as appropriate): $ sudo minicom -D /dev/ttyUSB0 © Adafruit Industries https://learn.adafruit.
Native Installation (Win) Mynewt relies on two command line utilities ( newt and newtmgr ), both of which are described elsewhere in this learning guide, as well as the presence of an ARM cross-compiling toolchain ( arm-none-eabi-gcc , etc.). Both of these need to be installed and available on your system to work with Mynewt projects. Cut auto-reset trace Windows serial has a somewhat annoying thing it does where it toggles the DTR/RTS lines when you open a serial port.
You can test it by running newt and newtmgr from the shell $ newt version Apache Newt version: 1.5.0 $ newtmgr version Apache Newtmgr 1.5.0 ARM Cross-Compiler You will also need an cross-compiling toolchain for the ARM architecture, specifically GCC 4.9 (https://adafru.it/yBq), since newt will call arm-none-eabi-gcc from the command line. For details on installing this see the official Mynewt documentation here: https://mynewt.apache.org/latest/get_started/native_install/cross_tools.html (https://adafru.
NOTE: arm-none-eabi-gcc also needs to be available in the system PATH variable to work with newt! https://adafru.it/yBq https://adafru.it/yBq © Adafruit Industries https://learn.adafruit.
Apache Mynewt Tools Standard Tools There are two main tools used to interact with Mynewt devices: 1. newt (https://adafru.it/yAk): Build system and project management tool 2. newtmgr (https://adafru.it/yAi): Field management tool for deployed devices Consult the dedicated tool pages for details on how to setup and use these two important tools. Adafruit Tools In addition to the default system tools, Adafruit maintains an iOS app called Adafruit Mynewt Manager (https://adafru.
newt newt is a build and project management tool that hides most of the messy details of creating, building and debugging mynewt projects. With newt, you don't need to worry about makefiles, compiler flags, debug config settings, and library versions or updates. The details are elegantly hidden behind the easy to use 'newt' wrapper. For full details on newt and the entire command set see the official newt documentation (https://adafru.it/Ers).
will be rejected by the bootloader which verifies all firmware at startup! Full documentation: https://mynewt.apache.org/latest/newt/command_list/newt_load.html (https://adafru.it/ErC) $ newt load first Loading app image into slot 1 newt size This command will give you detailed information on the flash and SRAM usage of your firmware, and can be helpful when debugging or when tight on space. Full documentation: https://mynewt.apache.org/latest/newt/command_list/newt_size.html (https://adafru.
newt target show This will give you a list of all targets defined in your project, and some basic details about them. Full documentation: https://mynewt.apache.org/latest/newt/command_list/newt_target.html (https://adafru.it/ErE) $ newt target show targets/first app=apps/first bsp=@apache-mynewt-core/hw/bsp/ada_feather_nrf52 build_profile=debug targets/my_blinky_sim app=apps/blinky bsp=@apache-mynewt-core/hw/bsp/native build_profile=debug © Adafruit Industries https://learn.adafruit.
newtmgr newtmgr is an image management tool that can be used to interact with the bootloader and images on the device. For full details on the newtmgr tool and the entire command set see the official newtmgr documentation (https://adafru.it/Erv). Installing newtmgr For details on installing the newtmgr tool on your operating system of choice see: OS X Installation: https://mynewt.apache.org/latest/newt/install/newt_mac.html (https://adafru.it/Ert) Linux Installation: https://mynewt.apache.
$ newtmgr -c serial1 image list Images: slot=0 version: 0.1.
2. Sign and Version the Image ( newt create-image ) You then need to 'sign' the image you just built with a version number and meta data used to validate the image when flashing, which is done via the create-image command: $ newt create-image bleuart 0.2.0 App image succesfully generated: [PATH]/bin/targets/bleuart/app/apps/bleuart/bleuart.img Pay attention to the .img output filename since you will need this full path in the next step! 3.
What the test command will do is check the signature of the image, and then try to switch the two flash banks so that the old application (0.1.0) is in the secondary flash bank, and the new application (0.2.0) is in the primary bank.
$ newtmgr -c serial1 image list Images: slot=0 version: 0.2.0 bootable: true flags: active hash: 87276847693699896f68b3c26d378648cace2900db4145cd5ade6049ac5ec15a slot=1 version: 0.1.0 bootable: true flags: confirmed hash: be52a255c25546dacc497d62faea910459903a1c1916ce831697d40fc2c20689 Split status: N/A (0) 6.
Display Internal Statistics Mynewt has an internal statistics system that is very useful when debugging issues in the field or during development. You can defined individual statistics fields, and increment the values at appropriate moments, and access these from the command-line with the newtmgr stat command set.
Adafruit Mynewt Manager Please note that this app requires certain features to be available in the active firmware image, specifically BLE based newtmgr support.
Source Code The Swift source code for Adafruit Mynewt Manager is available on Github at the following URL: https://adafru.it/yCM https://adafru.it/yCM © Adafruit Industries https://learn.adafruit.
Apache Mynewt Applications This section contains a guide on creating a progressively more complex application in Mynewt, starting with the absolute basics and adding useful features one by one. The individual pages can be references in isolation, but the example code builds up from one example to the next in chronological order. Create a New Project (https://adafru.it/yAI): This page shows how to generate a new project, and add a custom application and build target to the project.
Create a New Project This page makes the following assumptions: 1. You have already installed the newt and newtmgr tools on your system (see the Native Installation pages in this learning guide for details) 2. The various build tools ( arm-none-eabi-gcc , etc.) are available from the command-line 3. You are using Mynewt version 1.
$ newt install -v [apache-mynewt-core]: Downloading repository description Download successful! Downloading repository mynewt-core (branch: master; commit: mynewt_1_1_0_tag) at https://github.com/apache/mynewt-cor Cloning into '/var/folders/86/hb2vp14n5_5_yvdz_z8w9x_c0000gn/T/newt-repo021712424'... remote: Counting objects: 65349, done. remote: Compressing objects: 100% (151/151), done. remote: Total 65349 (delta 130), reused 162 (delta 95), pack-reused 65099 Receiving objects: 100% (65349/65349), 80.
This file lists the external dependencies for your project pkg.name: apps/first pkg.type: app pkg.
$ mkdir -p apps/first/src $ nano apps/first/src/main.c ... and enter the following code: #include #include #include #include #include #include "os/os.h" "bsp/bsp.h" "hal/hal_gpio.h" "sysinit/sysinit.
If you are using the Adafruit nRF52 Pro Feather this should be: $ newt target set first bsp=@apache-mynewt-core/hw/bsp/ada_feather_nrf52 Target targets/first successfully set target.bsp to @apache-mynewt-core/hw/bsp/ada_feather_nrf52 3. Set the build_profile Field Finally set the build profile for the new target ( debug or optimized ): $ newt target set first build_profile=debug Target targets/first successfully set target.build_profile to debug 4.
$ newt build first Building target targets/first Compiling repos/apache-mynewt-core/boot/bootutil/src/loader.c ... Compiling repos/apache-mynewt-core/util/mem/src/mem.c ... Archiving util_mem.a Linking [PATH]/bin/targets/first/app/apps/first/first.elf Target successfully built: targets/first Sign the Build with a Version Number You can prepare the image to be flashed to the device with a mandatory version number and signing details via the newt create-image command: $ newt create-image first 0.1.
Adding Tasks The official Mynewt 'Task' documentation is available at: https://mynewt.apache.org/latest/os/core_os/task/task.html A task ( os_task ) in Mynewt is made up of a task handler function, a task 'stack' which provide the block of memory that will be used when executing the task, and a priority level. Since Mynewt is a multitasking environment, tasks are also assigned a priority level, and at any given time the highest priority task will run.
os_task_funct_t func : The function to execute when this task is active, which will have the following signature: void my_task_handler(void *arg) void *arg : Optional arguments to pass into the task handler uint8_t prio : The priority level for the task, lower = higher priority os_time_t sanity_itvl : The time at which this task should check in with the sanity task. OS_WAIT_FOREVER means never check in. os_stack_t *stack_bottom : A pointer to the bottom of a task's stack.
static void my_task_func(void *arg) { hal_gpio_init_out(LED_BLINK_PIN, 1); while (1) { /* Wait one second */ os_time_delay(OS_TICKS_PER_SEC * 1); /* Toggle the LED */ hal_gpio_toggle(LED_BLINK_PIN); } } Task Delays There are various ways that a task can be interrupted, such as delaying execution for a specific amount of time, waiting for an event on an event queue, waiting for a semaphore, etc.
#include #include #include #include #include #include "os/os.h" "bsp/bsp.h" "hal/hal_gpio.h" "sysinit/sysinit.
You can verify the task status from the command line with the newtmgr taskstat command: $ newtmgr -c serial1 taskstat task pri tid runtime blinky 100 2 0 idle 255 0 424 main 127 1 0 © Adafruit Industries csw 4 5 3 stksz 64 64 1024 stkuse last_checkin next_checkin 26 0 0 32 0 0 93 0 0 https://learn.adafruit.
Adding Shell Commands The official Shell documentation can be seen here: https://mynewt.apache.org/latest/os/modules/shell/shell.html Mynewt includes a 'Shell' library that allows you to add an extensible command-line style interface to your applications. You can implement custom commands that users can execute over a simple serial connection, and display formatted text back to the end users. Adding shell support To add shell support to your app, make sure the following pkg.deps are defined in your pkg.
#include "console/console.h" #include "shell/shell.h" ... // Command handler prototype declaration static int shell_test_cmd(int argc, char **argv); // Shell command struct static struct shell_cmd shell_test_cmd_struct = { .sc_cmd = "test", .sc_cmd_func = shell_test_cmd }; ... // Implement your command handler static int shell_test_cmd(int argc, char **argv) { console_printf("Test!\n"); return 0; } ...
/* Shell command struct */ static struct shell_cmd shell_test_cmd_struct = { .sc_cmd = "test", .
$ minicom -D /dev/tty.SLAB_USBtoUART Once connected you can send the ' help ' command to get a list of valid shell commands, and then then 'test' command which should display ' Test! ' in the shell: © Adafruit Industries https://learn.adafruit.
Adding Statistics Full documentation on statistics is available here: https://mynewt.apache.org/latest/os/modules/stats/stats.html Mynewt includes an internal statistics system where numeric values can be declared and incremented over time, then accessed as a debug and analysis tool.
STATS_SECT_START(my_stat_section) STATS_SECT_ENTRY(attempt_stat) STATS_SECT_ENTRY(error_stat) STATS_SECT_END At compile time, this will resolve to the following structure: struct stats_my_stat_section { struct stats_hdr s_hdr; uint32_t sattempt_stat; uint32_t serror_stat; }; You will also need to provide names for each field, regardless of WHETHER you have enabled naming support via STATS_NAMES or not: Note that the field names need to match between the STATS_SECT_ENTRY name above and the STATS_NAME entry
The stats_init() and stats_register() function calls should occur AFTER the sysinit(); function! rc = stats_init( STATS_HDR(g_mystat), STATS_SIZE_INIT_PARMS(g_mystat, STATS_SIZE_32), STATS_NAME_INIT_PARMS(my_stat_section)); assert(rc == 0); For the stat size, you can use one of the following values: STATS_SIZE_16 -- stats are 16 bits (wraps at 65536) STATS_SIZE_32 -- stats are 32 bits (wraps at 4294967296) STATS_SIZE_64 -- stats are 64-bits You then need to register the stats entry so that you can access
This will give you something resembling the following output: 12274:attempt_stat: 3 12275:error_stat: 0 If you don't have names enabled via STATS_NAME_ENABLE you would see something like this: stat my_stats 29149:s0: 3 29150:s1: 0 newtmgr Access You can also access stats through newtmgr as follows: $ newtmgr -c serial1 stat my_stats Return Code = 0 Stats Name: my_stats attempt_stat: 0 error_stat: 0 Example: Adding Stats to apps/first/src/main.
/* Define a custom stats group for querying */ STATS_SECT_START(led_stat_section) STATS_SECT_ENTRY(led_toggles) STATS_SECT_END /* Define a few stat name fields for querying */ STATS_NAME_START(led_stat_section) STATS_NAME(led_stat_section, led_toggles) STATS_NAME_END(led_stat_section) /* Add the global variable to access and increment stats */ STATS_SECT_DECL(led_stat_section) g_ledstats; int main(int argc, char **argv) { int rc; /* Initialize the task */ os_task_init(&led_task, "blinky", led_task_func, NUL
static void led_task_func(void *arg) { /* Configure the LED GPIO as an output and HIGH (On) */ hal_gpio_init_out(LED_BLINK_PIN, 1); while (1) { /* Wait one second */ os_time_delay(OS_TICKS_PER_SEC * 1); /* Toggle the LED */ hal_gpio_toggle(LED_BLINK_PIN); /* Increment the LED stat */ STATS_INC(g_ledstats, led_toggles); } } Monitoring via netwmgr You can monitor the led_toggles value via newtmgr with the following command (where we can see that the LED had been toggled 11 times to far in this case): $ newtm
Adding BLE UART Support The easiest way to add BLE UART support is using the bleuart helper module (https://adafru.it/yAS) that is part of Adafruit_Mynewt (https://adafru.it/yAU), an in house Mynewt project that we created during product development. If you wish to test a complete application that shows how to use BLE UART, you should start with the bleuart (https://adafru.
Advanced Debugging The pages in this section are for advanced users who need to debug remote or complex systems, and are aimed at giving you a head start solving specific problems: GDB Debugging (https://adafru.it/yAM): General overview of common GDB debugging commands and suggestions on how to debug common problems via GDB Command Line Debugging (https://adafru.it/yAN): Some common tricks to help debug issues from the command line Field Debugging Tips (https://adafru.
GDB Debugging GDB debugging will require a Segger JLink for the GDB Server and debug port access The definitive guide to GDB is available here: ftp://ftp.gnu.org/old-gnu/Manuals/gdb/html_chapter/gdb_toc.html Starting the Debugger You can start GDB (GNU Debugger) with newt with the following command, with a JLink connected to the target device: # $ $ $ Optionally build and flash the image newt build target_name newt create-image target_name 0.0.
(gdb) monitor halt (gdb) set print pretty on (gdb) print ble_phy_stats $5 = { s_hdr = { s_name = 0x0, s_size = 0 '\000', s_cnt = 0 '\000', s_pad1 = 0, s_next = { stqe_next = 0x0 } }, sphy_isrs = 0, stx_good = 1, stx_fail = 0, stx_late = 0, stx_bytes = 27, srx_starts = 0, srx_aborts = 0, srx_valid = 0, srx_crc_err = 0, srx_late = 0, sno_bufs = 0, sradio_state_errs = 0, srx_hw_err = 0, stx_hw_err = 0 } Formatting Display Values You can also format the printed values with the following formatters: x Regard as
(gdb) monitor halt (gdb) set print pretty on (gdb) print *array@len Useful Mynewt/Nimble Structs and Fields Some useful Mynewt or nimble fields to display can be seen below: ble_phy_stats - PHY stats for traffic tracking ble_ll_stats - Link layer stats ble_ll_conn_stats - Connection stats g_ble_ll_adv_sm - Advertising state machine g_ble_ll_stack - Link layer stack For example: (gdb) monitor halt (gdb) set print pretty on (gdb) p ble_phy_stats $16 = { s_hdr = { s_name = 0x0, s_size = 0 '\000', s_cnt = 0 '
n Indicates how much memory to display (in u units), default = 1 f Indicates the display format, where: s means null-terminated string i means machine instruction x Display as hexadecimal (default) d Display as signed decimal u Display as unsigned decimal c Print as a char constant f Print in floating point syntax t Print integer as binary u The unit size, which can be: b Bytes h Halfwords (two bytes) w Words (four bytes) g Giant worlds (eight bytes) > Note: Whenever you change the unit size ( u ), the upd
(gdb) bt #0 os_tick_idle (ticks=131072) at hal_os_tick.c:146 #1 0x000091f6 in os_idle_task (arg=) at os.c:64 #2 0x00000000 in ?? () Each line shows the frame number, and the function name and return address. In this case, the code has stopped at os_tick_idle in halos tick.c, which was called from os_idle_task in os.c.
(gdb) info registers r0 0x800000 8388608 r1 0x4000b000 1073786880 r2 0xb4a5e0 11838944 r3 0x3fffef 4194287 r4 0xffffffff 4294967295 r5 0xffffff 16777215 r6 0x504 1284 r7 0x540 1344 r8 0xff800000 4286578688 r9 0x20000 131072 r10 0x1fff8000 536838144 r11 0x0 0 r12 0x20 32 sp 0x20001e40 0x20001e40 lr 0x18435 99381 pc 0x184aa 0x184aa xpsr 0x21000000 553648128 MSP 0x20008000 536903680 PSP 0x20001e40 536878656 PRIMASK 0x1 1 BASEPRI 0x0 0 FAULTMASK 0x0 0 CONTROL 0x2 2 Wo
(gdb) list 49 /* For now, idle task simply increments a counter to show it is running.
© Adafruit Industries https://learn.adafruit.
Command Line Debugging The following tips and tricks can be used when debugging from the command line. Grep'ing Source Code The grep tool allows you to efficiently find references to strings in the current folder or recursively, such as looking for every reference to a specific function name or variable in your codebase. Grep recursively for a partial string To perform a recursive search for a partial string enter: $ grep -rn ".
This will only search files ending in .c or .h You can also exclude certain file types with the --exclude flag: $ grep --exclude=*.o -rnw "./" -e "SEARCH_PATTERN" This will exclude all files ending in .o from the search. © Adafruit Industries https://learn.adafruit.
Field Debugging Tips Debugging devices deployed remotely is always a challenge but this documentation gives some basic techniques to help debug issues remotely. Debugging Crash Dumps If a task crashes (enter the fault_handler etc.) it will normally generate a simple dump of the system registers, which can be useful to find the cause of the problem if you have the matching .elf file locally.
(gdb) monitor go (gdb) list *0x00009e54 0x9e54 is in crash_device (crash_test.c:46). 41 if (!strcmp(how, "div0")) { 42 43 val1 = 42; 44 val2 = 0; 45 46 val3 = val1 / val2; 47 console_printf("42/0 = %d\n", val3); 48 } else if (!strcmp(how, "jump0")) { 49 ((void (*)(void))0)(); 50 } else if (!strcmp(how, "ref0")) { You can see here that line 46 of crash_test.c caused the fault, which is where the divide by zero error occurs. Option 2: Debugging Crash Dumps with objdump If you have the .
When GDB comes up type c and press enter . In a different shell, proceed to do whatever is required to cause the device to crash (such as sending a shell command, newtmgr cmd, etc.. If the device crashes, GDB should indicate such. You can then type the following commands in GDB to find out where is crashed: (gdb) bt (gdb) p *g_current_task © Adafruit Industries https://learn.adafruit.
Adafruit_Mynewt Adafruit_Mynewt (https://adafru.it/yAL) is a sample Mynewt project that we use internally for various projects and experiments. It isn't necessary to use this with the Adafruit Feather nRF52 Pro, but the repository contains a number of helper modules and apps, and can help you get started working with things like BLE UART and general Bluetooth Low Energy communication. https://adafru.it/zKA https://adafru.
© Adafruit Industries https://learn.adafruit.
External Content The following external content may be useful understanding some of the many features available in Apache Mynewt: Mynewt Bootloader Build and Package Management © Adafruit Industries https://learn.adafruit.
Downloads The following resources may be useful working with the Bluefruit nRF52 Feather: Adafruit_nRF52_Arduino (https://adafru.it/vaF): The core code for this device (hosted on Github) nRF52 Example Sketches (https://adafru.it/vaK): Browse the example code from the core repo on Github nRF52832 Product Specification v1.4 (https://adafru.it/ErI): Key technical documentation for the nRF52832 SoC EagleCAD PCB files on GitHub (https://adafru.it/vbH) https://adafru.it/z4c https://adafru.
Schematic (pre March 16 2018) © Adafruit Industries Last Updated: 2019-04-05 09:48:02 AM UTC Page 87 of 87