Giter VIP home page Giter VIP logo

mynewt-core's Introduction

Apache Mynewt

Overview

Apache Mynewt is an open-source operating system for tiny embedded devices. Its goal is to make it easy to develop applications for microcontroller environments where power and cost are driving factors.

It currently supports the following hardware platforms:

  • nRF52 DK from Nordic Semiconductor (Cortex-M4)
  • RuuviTag Sensor beacon platform (Nordic nRF52832 based)
  • nRF51 DK from Nordic Semiconductor (Cortex-M0)
  • VBLUno51 from VNG IoT Lab (Nordic nRF51822 SoC based)
  • VBLUno52 from VNG IoT Lab (Nordic nRF52832 SoC based, Cortex-M4)
  • BLE Nano from RedBear (Nordic nRF51822 SoC based)
  • BLE Nano2 and Blend2 from RedBear (Nordic nRF52832 SoC based)
  • BMD-300-EVAL-ES from Rigado (Cortex-M4)
  • BMD-200 from Rigado (Cortex-M0)
  • Adafruit Feather nRF52 Pro
  • STM32F4DISCOVERY from ST Micro (Cortex-M4)
  • STM32-E407 from Olimex (Cortex-M4)
  • Arduino Zero (Cortex-M0)
  • Arduino Zero Pro (Cortex-M0)
  • Arduino M0 Pro (Cortex-M0)
  • Arduino MKR1000 (Cortex-M0)
  • Arduino Primo NRF52 (Cortex-M4)
  • NUCLEO-F401RE (Cortex-M4)
  • NUCLEO-F767ZI (Cortex-M7)
  • Discovery kit for STM32F7 Series (Cortex-M7)
  • FRDM-K64F from NXP (Cortex-M4)
  • BBC micro:bit (Nordic nrf51822; Cortex-M0)
  • SiFive HiFive1 (RISC-V Instruction Set Architecture)
  • NINA-B1 BLE module from u-blox (Cortex-M4)
  • 6LoWPAN clicker from MikroElectronika (PIC32MX470 microcontroller)
  • chipKIT Wi-FIRE (PIC32MZ microcontroller)
  • Creator Ci40 module (dual MIPS interAptiv CPU)
  • EE-02 board with Semtech Sx1276 chip from Telenor (Cortex-M4)
  • DA1469x Pro DK from Dialog Semiconductor (Cortex-M33)
  • nRF5340 DK from Nordic Semiconductor (Cortex-M33)

Apache Mynewt uses the Newt build and package management system, which allows you to compose your OS and choose only the components you need.

This repository contains the core packages of the Apache Mynewt OS, including:

  • A Pre-emptive, Real Time OS Kernel
  • A open-source Bluetooth 5.0 stack (both Host & Controller), NimBLE, that completely replaces the proprietary SoftDevice on Nordic chipsets. NOTE NimBLE sources were moved to separate repository.
    • Support for 251 byte packet size
    • Support for all 4 roles concurrently - Broadcaster, Observer, Peripheral and Central
    • Support for up to 32 simultaneous connections.
    • Legacy and SC (secure connections) SMP support (pairing and bonding).
    • Advertising Extensions.
  • A flash filesystem, NFFS, which is designed for tiny (128KB->16MB) flashes.
  • FatFS
  • Flash Circular Buffer
  • JSON and CBOR encoding
  • Bootloader support
  • Remote Software Upgrade
  • HAL and BSP infrastructure designed to abstract microcontroller specifics
  • Shell and Console support
  • Statistics and Logging Infrastructure
  • OIC Client and Server

For more information on the Mynewt OS, please visit our website here. If you'd like to get started, visit the Quick Start Guide.

Browsing

If you are browsing around the source tree, and want to see some of the major functional chunks, here are a few pointers:

  • kernel: Contains the core of the RTOS (kernel/os)

  • sys: Contains a number of helper libraries for building applications. Including a console (sys/console)), shell (sys/shell))

  • mgmt: Contains the management libraries for newtmgr mgmt/newtmgr), which supports software upgrade and remote fetching of logs and statistics.

  • net: Contains the networking packages. Highlights of the net directory are the NimBLE and IP packages. Nimble is a full Bluetooth host and controller implementation, that is written from the ground up for the Apache Mynewt Operating System (due to code moved to separate repo this folder contains only compatibility package files). ip is a port of LWIP, a complete IPv4 and IPv6 implementation.

  • hw: Contains the HW specific support packages. Board Support Packages are located in hw/bsp, and the MCU specific definitions they rely on are located in hw/mcu. There is a HAL (Hardware Abstraction Layer) stored in hw/hal, even though the implementation of various HALs are stored in the MCU specific definitions. Finally, drivers can be found in hw/drivers. Drivers provide a higher-level interface to the hardware than the HAL, and may require the Mynewt operating system to function.

  • fs: Contains the FS package (fs/fs) which is the high-level Apache Mynewt file system API. A specific implementation of that FS, is NFFS (Newtron Flash File System.) The Newtron file system is a FS that has been built from the ground-up in Apache Mynewt, designed to be optimized for small (64KB-32MB) flashes. The fs directory also contains fcb, a flash circular buffer implementation.

Sample Applications

In addition to some of the core packages, there are also some sample applications that show how to instantiate the Apache Mynewt system. These sample applications are located in the apps/ directory. They include:

Getting Help

If you are having trouble using or contributing to Apache Mynewt, or just want to talk to a human about what you're working on, you can contact us via the developers mailing list.

Although not a formal channel, you can also find a number of core developers on the #mynewt channel on Freenode.

Also, be sure to checkout the Frequently Asked Questions for some help troubleshooting first.

Contributing

Anybody who works with Apache Mynewt can be a contributing member of the community that develops and deploys it. The process of releasing an operating system for microcontrollers is never done: and we welcome your contributions to that effort.

More information can be found at the Community section of the Apache Mynewt website, located here.

Pull Requests

Apache Mynewt welcomes pull request via Github. Discussions are done on Github, but depending on the topic, can also be relayed to the official Apache Mynewt developer mailing list [email protected].

If you are suggesting a new feature, please email the developer list directly, with a description of the feature you are planning to work on.

We do not merge pull requests directly on Github, all PRs will be pulled and pushed through https://git.apache.org/.

Filing Bugs

Bugs can be filed on the Apache Mynewt Issues. Please label the issue as a "Bug".

Where possible, please include a self-contained reproduction case!

Feature Requests

Feature requests should also be filed on the Apache Mynewt Bug Tracker. Please label the issue as a "Feature" or "Enhancement" depending on the scope.

Writing Tests

We love getting newt tests! Apache Mynewt is a huge undertaking, and improving code coverage is a win for every Apache Mynewt user.

Writing Documentation

Contributing to documentation (in addition to writing tests), is a great way to get involved with the Apache Mynewt project.

The Mynewt core OS documentation is found in /docs.

License

The code in this repository is all under either the Apache 2 license, or a license compatible with the Apache 2 license. See the LICENSE file for more information.

Export restrictions

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

The following provides more details on the included cryptographic software: https://tls.mbed.org/supported-ssl-ciphersuites.

mynewt-core's People

Contributors

aditihilbert avatar agross-korg avatar andrzej-kaczmarek avatar benmccrea avatar bgiori avatar brolan-juul avatar caspermeijn avatar ccollins476ad avatar francois-berder avatar imgjulian avatar jacobrosenthal avatar justinekh avatar kasjer avatar m-gorecki avatar mkasenberg avatar mkiiskila avatar mlampert avatar mlaz avatar ncasaril avatar neelnatu avatar ngesbrian avatar nkaje avatar paulfdietrich avatar rymanluk avatar sjanc avatar sterlinghughes avatar utzig avatar vikrant-proxy avatar vrahane avatar wpiet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mynewt-core's Issues

os: moving os/queue.h to sys/queue.h

Moving os/queue.h to it's expected place: sys/queue.h (as it is a pretty standard include)
So that's possible to write portable code across OS (otherwise there will be a clash when trying to import our own copy of sys/queue.h)

Possibilities are (in my order of preference):

  • effectively moving file to sys/queue.h and creating an os/queue.h (for compatibilty with previous mynewt code)
  • creating a sys/queue.h wrapper:
#ifnded _SYS_QUEUE_H_
#define _SYS_QUEUE_H_
#include "os/queue.h"
#endif
  • replacing define with _SYS_QUEUE_H_ instead of _QUEUE_H_. This will avoid inclusion of developper own copy of sys/queue.h, but a sys/queue.h will need to be provided

os: callout without event queue (doc vs code)

Callout documentation makes it believe that an event queue is required to process callout callback, this requirement is not present in the code. If no queue is specified callback is processed in interupt context. Doc will need to be updated accordingly.

if (c->c_evq) {
os_eventq_put(c->c_evq, &c->c_ev);
} else {
c->c_ev.ev_cb(&c->c_ev);
}

Documentation also make mention of OS_EVENT_T_TIMER which is not defined anywhere

UART logging caused an exception for nrf51 board

Blinking code work well, but when started to play with nimble BLE stack I got an issue. So problem is - even with bare minimum BLE code from tutorial section my board (ble400) does not work - I got only TX led blinking.

So expecting some debug output on UART plugged in USB->UART moduel to it and get this in terminal

000000 Assert @ 0xa8cbโโŠ
000000 Unhandled interrupt (2), exception sp 0x20001168โโŠ
000000 r0:0x00000000 r1:0x00000000 r2:0x80000000 r3:0xe000ed00โโŠ
000000 r4:0x0000a8cb r5:0x00000002 r6:0xffffffff r7:0x000091a5โโŠ
000000 r8:0xffffffff r9:0xffffffff r10:0xffffffff r11:0xffffffffโโŠ
000000 r12:0x00000001 lr:0x0000925f pc:0x000081cc psr:0x81000000โโŠ
000000 ICSR:0x00421002โโŠ
This block repeating.

Finally I got the reason caused it

If specify in pkg.yml

pkg.deps:
...

  • "@apache-mynewt-core/sys/log/full"
  • "@apache-mynewt-core/sys/stats/full"
    ...
    then this issue appear. If replace full to stub - everything work well.

So obviously something is wrong with those 2 packages when running on nrf51 MCU. And really logging to UART is working - just causing some exception and corresponding application crash after data transmitted.

BTW as I discovered interrupt 2 is an UART interrupt for nrf51 SDK.

fsutil_write_file doesn't truncate

When I write a file (say, /cfg/hostname) with 10 bytes using fsutil_write_file, followed by another write to the same file (4 bytes this time, also using fsutil_write_file), the file still has 10 bytes in it (checked using newtmgr fs download).

The docs for fsutil_write_file states that the file should be truncated and overwritten. Currently, the truncate is not happening.

should be able to query config variables without registering a handler

In order to figure out what config variable is saved to, you need to have a handler registered, which gets called at config load time.
Expectation is that the user will keep this value around.

We should remove this requirement, so that you can load values on demand. This becomes useful for cases the amount of stored data is large (e.g. bluetooth LTK), and where it's used only for a short period of time.

os_sem: possible token overflow

When releasing a semaphore os_sem_release, token count is incremented, but no check is done to handle the case where it will overflow

Building Lora with SPI > 0

It's not possible to build Lora with SPI1, due to the following code in sx1276-board.h. Is there a specific reason for this restriction?

#if RADIO_SPI_IDX == 0
#define RADIO_NSS                   MYNEWT_VAL(SX1276_SPI_CS_PIN)
#else
#error Invalid SX1276_SPI_IDX value
#endif

nrf52 thingy target ble stack does not come back up after an erase command

This is apparently not related to #789

$ newt target show split-thingy
targets/split-thingy
    app=@apache-mynewt-core/apps/blesplit
    bsp=@apache-mynewt-core/hw/bsp/nrf52-thingy
    build_profile=optimized
    loader=@apache-mynewt-core/apps/bleprph
    syscfg=CONSOLE_ECHO=0:CONSOLE_INPUT=0:CONSOLE_MAX_INPUT_LEN=0:CONSOLE_RTT=1:CONSOLE_UART=0:JLINK_DEBUG=1:LOG_LEVEL=0:SHELL_TASK=0
$ newt build split-thingy && newt create-image split-thingy 0.0.0.1 && newt load split-thingy 0.0.0.1
Building target targets/split-thingy
...
Loading app image into slot 2
Loading loader image into slot 1
$ newt create-image split-thingy 0.0.0.2
...
App image succesfully generated: /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.img
App image succesfully generated: /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/app/apps/blesplit/blesplit.img
$ ./test2.sh

**** Running: newtmgr -c nimble_bleprph image erase *****

Done

**** Running: newtmgr -c nimble_bleprph image list *****

Images:
 slot=0
    version: 0.0.0.1
    bootable: true
    flags: active confirmed
    hash: a5cc4e507442d75e130f9f2ae69b569f21eb9da3e74c50a57d6a4fded31c99e0
Split status: N/A (0)

**** Running: newtmgr -c nimble_bleprph image upload /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.img *****

 125.98 KiB / 126.16 KiB [==============================================================================================================]  99.85%Done

**** Running: newtmgr -c nimble_bleprph image list *****

Images:
 slot=0
    version: 0.0.0.1
    bootable: true
    flags: active confirmed
    hash: a5cc4e507442d75e130f9f2ae69b569f21eb9da3e74c50a57d6a4fded31c99e0
 slot=1
    version: 0.0.0.2
    bootable: true
    flags: 
    hash: 517d45dace367a948a771e329f9efd890ef4d367f11b3a44b5104aa5455c8a56
Split status: N/A (0)

**** Running: newtmgr -c nimble_bleprph image erase *****

Error: disconnected

**** Running: newtmgr -c nimble_bleprph image list *****

Error: Failed to connect to peer after 10s

logs

000001 [ts=7812ssb, mod=64 level=0] registered service 0x1800 with handle=1
000002 [ts=15624ssb, mod=64 level=0] registering characteristic 0x2a00 with def_handle=2 val_handle=3
000002 [ts=15624ssb, mod=64 level=0] registering characteristic 0x2a01 with def_handle=4 val_handle=5
000002 [ts=15624ssb, mod=64 level=0] registering characteristic 0x2a02 with def_handle=6 val_handle=7
000002 [ts=15624ssb, mod=64 level=0] registering characteristic 0x2a03 with def_handle=8 val_handle=9
000002 [ts=10x03 ocf=0x0063 len=8
000004 [ts=31248ssb, mod=4 level=0] 0x63 0x0c 0x08 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 
000004 [ts=31248ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x3 ocf=0x63 status=0 
000004 [ts=31248ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0001 len=8
000004 [ts=31248ssb, mod=4 level=0] 0x01 0x20 0x08 0x7f 0x1a 0x0f 0x00 0x00 0x00 0x00 0x00 
0r0004 [ts=a659e-897e-45e1-b016-007107c96dd complete: cmd_pkts=1 ogf=0x8 ocf=0x1 status=0 
436ssb, mod=4 level=0] ble_hs_el=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0002 len=0
000004 [ts=31248ssb, mod=4 level=0] 0x02 0x20 0x00 
000005 [ts=39060ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x8 ocf=0x2 status=0 
000005 [ts=39060ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0003 len=0
000005 [ts=39060ssb, mod=4 level=0] 0x03 0x20 0x00 
000005 [ts=39060ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x8 ocf=0x3 status=0 
000005 [ts=39060ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x04 ocf=0x0009 00006 [ts=46872ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0005 len=6
000006 [ts=46872ssb, mod=4 level=0] 0x05 0x20 0x06 0xed 0xf3 0x62 0x90 0xb6 0xd6 
000007 [ts=54684ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x8 ocf=0x5 status=0 
000007 [ts=54684ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0007 len=0
000007 [ts=54684ssb, mod=4 level=0] 0x07 0x20 0x00 
000007 [ts=54684ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x8 ocf=0x7 status=0 
b00007 [ts= 0xc0 0x53 0x1e 0xb8 0xef 0x8d 0xei_0xd_send: ogf=0x08 ocf=0x0008 len=32
000007 [ts=54684ssb, mod=4 level=0] 0x08 0x20 sb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x8 ocf=0x27 status=0 
000006 [ts=46872ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x004e len=8
000006 [ts=46872ssb, mod=4 level=0] 0x4e 0x20 0x08 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 
000006 [ts=46872ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=vertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvlmin=0 adv_itvl_max=0
000007 [ts=54684ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0006 len=15
000008 [ts=62496ssb, mod=4 level=0] 0x06 0x20 0x0f 0x30 0x00 0x60 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x00 
000008 [ts=62496ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x8 ocf=0x6 status=0 
000008 [ts=62496ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x000a len=1
000008 [ts=62496ssb, mod=4 level=0] 0x0a 0x20 0x01 0x01 
000008 [ts=62496ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x8 ocf=0xa status=0 
000008 [ts=62496ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x0 ocf=0x0
007947 [ts=62085932ssb, mod=4 level=0] LE connection complete. handle=1 role=1 paddrtype=0 addr=b8.e8.56.3.d3.ed local_rpa=0.0.0.0.0.0 peer_rpa=0.0.0.0.0.0 itvl=12 latency=0 spvn_tmo=200 mca=5
007947 [ts=62085932ssb, mod=64 level=1] connection established; status=0 handle=1 our_ota_addr_type=1 our_ota_addr=d6:b6:90:62:f3:ed our_id_addr_type=1 our_id_addr=d6:b6:90:62:f3:ed peer_ota_addr_type=0 peer_ota_addr=b8:e8:56:03:d3:ed peer_id_addr_type=0 peer_id_addr=b8:e8:56:03:d3:ed conn_itvl=12 conn_latency=0 supervision_timeout=200 encrypted=0 authenticated=0 bonded=0
007947 [ts=62085932ssb, mod=64 level=1] 
007947 [ts=62085932ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2
007947 [ts=62085932ssb, mod=4 level=0] 0x16 0x20 0x02 0x01 0x00 
007947 [ts=62085932ssb, mod=4 level=0] Command Status: status=0 cmd_pkts=1 ocf=0x16 ogf=0x8
007948 [ts=62093744ssb, mod=4 level=0] 	Unknown LE event
007952 [ts=62124992ssb, mod=4 level=0] LE Remote Used Features. FAIL (status=26)
007954 [ts=62140616ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=7 data=0x03 0x00 0x04 0x00 0x02 0x68 0x00 
007954 [ts=62140616ssb, mod=4 level=0] rxed att command: mtu req; conn=1 mtu=104
007954 [ts=62140616ssb, mod=4 level=0] txed att command: mtu rsp; conn=1 mtu=256
007954 [ts=62140616ssb, mod=4 level=0] host tx hci data; handle=1 length=7
007954 [ts=62140616ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x07 0x00 0x03 0x00 0x04 0x00 0x03 0x00 0x01 
007954 [ts=62140616ssb, mod=64 level=1] mtu update event; conn_handle=1 cid=4 mtu=104
007958 [ts=62171864ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x10 0x01 0x00 0xff 0xff 0x00 0x28 
007958 [ts=62171864ssb, mod=4 level=0] rxed att command: read group type req; conn=1 start_handle=0x0001 end_handle=0xffff
007958 [ts=62171864ssb, mod=4 level=0] txed att command: read group type rsp; conn=1 length=6
007958 [ts=62171864ssb, mod=4 level=0] host tx hci data; handle=1 length=24
007958 [ts=62171864ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x18 0x00 0x14 0x00 0x04 0x00 0x11 0x06 0x01 0x00 0x0b 0x00 0x00 0x18 0x0c 0x00 0x0f 0x00 0x01 0x18 0x10 0x00 0x1c 0x00 0x11 0x18 
007959 [ts=62179676ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007959 [ts=62179676ssb, mod=4 level=0] handle:1 pkts:1
007962 [ts=62203112ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x10 0x1d 0x00 0xff 0xff 0x00 0x28 
007962 [ts=62203112ssb, mod=4 level=0] rxed att command: read group type req; conn=1 start_handle=0x001d end_handle=0xffff
007962 [ts=62203112ssb, mod=4 level=0] txed att command: read group type rsp; conn=1 length=20
007962 [ts=62203112ssb, mod=4 level=0] host tx hci data; handle=1 length=46
007962 [ts=62203112ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x2e 0x00 0x2a 0x00 0x04 0x00 0x11 0x14 0x1d 0x00 0x20 0x00 0x84 0xaa 0x60 0x74 0x52 0x8a 0x8b 0x86 0xd3 0x4c 0xb7 0x1d 0x1d 0xdc 0x53 0x8d 0x21 0x00 0xff 0xff 0x2d 0x71 0xa2 0x59 0xb4 0x58 0xc8 0x12 0x99 0x99 0x43 0x95 0x12 0x2f 0x46 0x59 
007963 [ts=62210924ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007963 [ts=62210924ssb, mod=4 level=0] handle:1 pkts:1
007966 [ts=62234360ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x08 0x01 0x00 0x0b 0x00 0x03 0x28 
007966 [ts=62234360ssb, mod=4 level=0] rxed att command: read type req; conn=1 start_handle=0x0001 end_handle=0x000b
007966 [ts=62234360ssb, mod=4 level=0] txed att command: read type rsp; conn=1 length=7
007966 [ts=62234360ssb, mod=4 level=0] host tx hci data; handle=1 length=41
007966 [ts=62234360ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x29 0x00 0x25 0x00 0x04 0x00 0x09 0x07 0x02 0x00 0x02 0x03 0x00 0x00 0x2a 0x04 0x00 0x02 0x05 0x00 0x01 0x2a 0x06 0x00 0x02 0x07 0x00 0x02 0x2a 0x08 0x00 0x08 0x09 0x00 0x03 0x2a 0x0a 0x00 0x02 0x0b 0x00 0x04 0x2a 
007966 [ts=62234360ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007966 [ts=62234360ssb, mod=4 level=0] handle:1 pkts:1
007969 [ts=62257796ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x08 0x0c 0x00 0x0f 0x00 0x03 0x28 
007970 [ts=62265608ssb, mod=4 level=0] rxed att command: read type req; conn=1 start_handle=0x000c end_handle=0x000f
007970 [ts=62265608ssb, mod=4 level=0] txed att command: read type rsp; conn=1 length=7
007970 [ts=62265608ssb, mod=4 level=0] host tx hci data; handle=1 length=13
007970 [ts=62265608ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0d 0x00 0x09 0x00 0x04 0x00 0x09 0x07 0x0d 0x00 0x20 0x0e 0x00 0x05 0x2a 
007970 [ts=62265608ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007970 [ts=62265608ssb, mod=4 level=0] handle:1 pkts:1
007973 [ts=62289044ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x08 0x1d 0x00 0x20 0x00 0x03 0x28 
007973 [ts=62289044ssb, mod=4 level=0] rxed att command: read type req; conn=1 start_handle=0x001d end_handle=0x0020
007973 [ts=62289044ssb, mod=4 level=0] txed att command: read type rsp; conn=1 length=21
007974 [ts=62296856ssb, mod=4 level=0] host tx hci data; handle=1 length=27
007974 [ts=62296856ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x1b 0x00 0x17 0x00 0x04 0x00 0x09 0x15 0x1e 0x00 0x14 0x1f 0x00 0x48 0x7c 0x99 0x74 0x11 0x26 0x9e 0xae 0x01 0x4e 0xce 0xfb 0x28 0x78 0x2e 0xda 
007974 [ts=62296856ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007974 [ts=62296856ssb, mod=4 level=0] handle:1 pkts:1
007977 [ts=62320292ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=7 data=0x03 0x00 0x04 0x00 0x0a 0x03 0x00 
007977 [ts=62320292ssb, mod=4 level=0] rxed att command: read req; conn=1 handle=0x0003
007977 [ts=62320292ssb, mod=4 level=0] host tx hci data; handle=1 length=19
007977 [ts=62320292ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x13 0x00 0x0f 0x00 0x04 0x00 0x0b 0x6e 0x69 0x6d 0x62 0x6c 0x65 0x2d 0x62 0x6c 0x65 0x70 0x72 0x70 0x68 
007978 [ts=62328104ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007978 [ts=62328104ssb, mod=4 level=0] handle:1 pkts:1
007981 [ts=62351540ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=7 data=0x03 0x00 0x04 0x00 0x0a 0x0b 0x00 
007981 [ts=62351540ssb, mod=4 level=0] rxed att command: read req; conn=1 handle=0x000b
007981 [ts=62351540ssb, mod=4 level=0] host tx hci data; handle=1 length=13
007981 [ts=62351540ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0d 0x00 0x09 0x00 0x04 0x00 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
007981 [ts=62351540ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007981 [ts=62351540ssb, mod=4 level=0] handle:1 pkts:1
007985 [ts=62382788ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=9 data=0x05 0x00 0x04 0x00 0x04 0x0f 0x00 0x0f 0x00 
007985 [ts=62382788ssb, mod=4 level=0] rxed att command: find info req; conn=1 start_handle=0x000f end_handle=0x000f
007985 [ts=62382788ssb, mod=4 level=0] txed att command: find info rsp; conn=1 format=1
007985 [ts=62382788ssb, mod=4 level=0] host tx hci data; handle=1 length=10
007985 [ts=62382788ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0a 0x00 0x06 0x00 0x04 0x00 0x05 0x01 0x0f 0x00 0x02 0x29 
007985 [ts=62382788ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007985 [ts=62382788ssb, mod=4 level=0] handle:1 pkts:1
007989 [ts=62414036ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=9 data=0x05 0x00 0x04 0x00 0x04 0x0f 0x00 0x0f 0x00 
007989 [ts=62414036ssb, mod=4 level=0] rxed att command: find info req; conn=1 start_handle=0x000f end_handle=0x000f
007989 [ts=62414036ssb, mod=4 level=0] txed att command: find info rsp; conn=1 format=1
007989 [ts=62414036ssb, mod=4 level=0] host tx hci data; handle=1 length=10
007989 [ts=62414036ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0a 0x00 0x06 0x00 0x04 0x00 0x05 0x01 0x0f 0x00 0x02 0x29 
007989 [ts=62414036ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007989 [ts=62414036ssb, mod=4 level=0] handle:1 pkts:1
007992 [ts=62437472ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=9 data=0x05 0x00 0x04 0x00 0x04 0x20 0x00 0x20 0x00 
007993 [ts=62445284ssb, mod=4 level=0] rxed att command: find info req; conn=1 start_handle=0x0020 end_handle=0x0020
007993 [ts=62445284ssb, mod=4 level=0] txed att command: find info rsp; conn=1 format=1
007993 [ts=62445284ssb, mod=4 level=0] host tx hci data; handle=1 length=10
007993 [ts=62445284ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x0a 0x00 0x06 0x00 0x04 0x00 0x05 0x01 0x20 0x00 0x02 0x29 
007993 [ts=62445284ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007993 [ts=62445284ssb, mod=4 level=0] handle:1 pkts:1
007996 [ts=62468720ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=9 data=0x05 0x00 0x04 0x00 0x12 0x0f 0x00 0x02 0x00 
007996 [ts=62468720ssb, mod=4 level=0] rxed att command: write req; conn=1 handle=0x000f
007996 [ts=62468720ssb, mod=64 level=1] subscribe event; conn_handle=1 attr_handle=14 reason=1 prevn=0 curn=0 previ=0 curi=1
007997 [ts=62476532ssb, mod=4 level=0] txed att command: write rsp; conn=1 
007997 [ts=62476532ssb, mod=4 level=0] host tx hci data; handle=1 length=5
007997 [ts=62476532ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x05 0x00 0x01 0x00 0x04 0x00 0x13 
007997 [ts=62476532ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
007997 [ts=62476532ssb, mod=4 level=0] handle:1 pkts:1
008000 [ts=62499968ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=9 data=0x05 0x00 0x04 0x00 0x12 0x0f 0x00 0x02 0x00 
008000 [ts=62499968ssb, mod=4 level=0] rxed att command: write req; conn=1 handle=0x000f
008000 [ts=62499968ssb, mod=4 level=0] txed att command: write rsp; conn=1 
008000 [ts=62499968ssb, mod=4 level=0] host tx hci data; handle=1 length=5
008000 [ts=62499968ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x05 0x00 0x01 0x00 0x04 0x00 0x13 
008001 [ts=62507780ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008001 [ts=62507780ssb, mod=4 level=0] handle:1 pkts:1
008004 [ts=62531216ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=9 data=0x05 0x00 0x04 0x00 0x12 0x20 0x00 0x01 0x00 
008004 [ts=62531216ssb, mod=4 level=0] rxed att command: write req; conn=1 handle=0x0020
008004 [ts=62531216ssb, mod=64 level=1] subscribe event; conn_handle=1 attr_handle=31 reason=1 prevn=0 curn=1 previ=0 curi=0
008004 [ts=62531216ssb, mod=4 level=0] txed att command: write rsp; conn=1 
008004 [ts=62531216ssb, mod=4 level=0] host tx hci data; handle=1 length=5
008004 [ts=62531216ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x05 0x00 0x01 0x00 0x04 0x00 0x13 
008005 [ts=62539028ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008005 [ts=62539028ssb, mod=4 level=0] handle:1 pkts:1
008008 [ts=62562464ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008008 [ts=62562464ssb, mod=4 level=0] handle:1 pkts:1
008010 [ts=62578088ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=15 data=0x0b 0x00 0x04 0x00 0x52 0x1f 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 
008010 [ts=62578088ssb, mod=4 level=0] rxed att command: write cmd; conn=1 handle=0x001f
2804636ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x6c 0x00 0x68 0x00 0x04 0x00 0x1b 0x1f 0x00 0x69 0x72 0x6d 0x65 0x64 0xf5 0x66 0x61 0x63 0x74 0x69 0x76 0x65 0xf5 0x69 0x70 0x65 0x72 0x6d 0x61 0x6c 0x00 0x68 0x00 0x04 0x00 0x1b 0x1f 0x00 0x01 0x00 0x00 0xf4 0x00 0x01 0x00 0x00 0xbf 0x66 0x69 0x6d 0x61 0x67 0x65 0x73 0x9f 0xbf 0x64 0x73 0x6c 0x6f 0x74 0x00 0x67 0x76 0x65 0x72 0x73 0x69 0x6f 0x6e 0x65 0x30 0x2e 0x30 0x2e 0x30 0x64 0x68 0x61 0x73 0x68 0x58 0x20 0xd9 0xa7 0x35 0xac 0x58 0x2f 0x22 0x5f 0x8b 0x43 0xb7 0x1b 0x4d 0xae 0x29 0x50 0xdb 0x9a 0xa0 0x40 0x93 0x2b 0x6c 0xa1 0x17 0xf0 0x6d 0x6b 0xd7 0x2c 0x83 0xa2 0x68 0x62 0x6f 0x6f 0x74 0x61 0x62 0x6c 0x65 0xf5 0x67 0x70 0x65 0x6e 0x64 0x69 0x6e 0x67 0xf4 0x69 0x63 0x6f 0x6e 0x66 
008039 [ts=62804636ssb, mod=4 level=1] GATT procedure initiated: notify; att_handle=31
008039 [ts=62804636ssb, mod=4 level=0] txed att command: notify req; conn=1 handle=0x001f
008039 [ts=62804636ssb, mod=4 level=0] host tx hci data; handle=1 length=108
008039 [ts=65 0x6e 0x74 0xf4 0xff 0xbf 0x64 0x73 0x6c 0x6f 0x74 0x01 0x67 0x76 0x65 0x72 0x73 0x69 0x6f 0x6e 0x65 0x30 0x2e 0x30 0x2e 0x30 0x64 0x68 0x61 0x73 0x68 0x58 0x20 0x7a 0xd9 0x2c 0x45 0x61 0xa5 0x62 0x40 0xd2 0x33 0x4c 0xd6 0x54 0xee 0x50 0x44 0xe8 0x18 0x02 0xe5 0x6c 0x73 0x71 0x95 0x2b 0xe1 0x88 0xe7 0x28 0x65 0x8f 0xf1 0x68 0x62 0x6f 0x6f 0x74 0x61 0x62 0x6c 0x65 0xf4 0x67 0x70 0x65 0x6e 0x64 
008040 [ts=62812448ssb, mod=4 level=1] GATT procedure initiated: notify; att_handle=31
008040 [ts=62812448ssb, mod=4 level=0] txed att command: notify req; conn=1 handle=0x001f
008040 [ts=62812448ssb, mod=4 level=0] host tx hci data; handle=1 length=57
008040 [ts=62812448ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x39 0x00 0x35 0x00 0x04 0x00 0x1b 0x1f 0x00 0x69 0x6e 0x67 0xf4 0x69 0x63 0x6f 0x6e 0x66 0x69 0x72 0x6d 0x65 0x64 0xf4 0x66 0x61 0x63 0x74 0x69 0x76 0x65 0xf4 0x69 0x70 0x65 0x72 0x6d 0x61 0x6e 0x65 0x6e 0x74 0xf4 0xff 0xff 0x6b 0x73 0x70 0x6c 0x69 0x74 0x53 0x74 0x61 0x74 0x75 0x73 0x02 0xff 
008043 [ts=62835884ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008043 [ts=62835884ssb, mod=4 level=0] handle:1 pkts:1
008044 [ts=62843696ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008045 [ts=62851508ssb, mod=4 level=0] handle:1 pkts:1
008048 [ts=62874944ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008048 [ts=62874944ssb, mod=4 level=0] handle:1 pkts:1
008052 [ts=62906192ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=27 data=0x68 0x00 0x04 0x00 0x16 0x1f 0x00 0x00 0x00 0x02 0x00 0x00 0x66 0x00 0x01 0x01 0x01 0xa3 0x63 0x6f 0x66 0x66 0x00 0x64 0x64 0x61 0x74 
008052 [ts=62906192ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=1 len=27 data=0x61 0x58 0x50 0x3c 0xb8 0xf3 0x96 0x24 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x64 0xf8 0x01 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
008053 [ts=62914004ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=1 len=27 data=0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x20 0xb5 0x82 0x00 0x00 0x11 0x83 0x00 0x00 0x13 0x83 0x00 0x00 0x00 0x00 0x00 
00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x5b 0x94 
008054 [ts=62921816ssb, mod=4 level=0] rxed att command: prep write req; conn=1 handle=0x001f offset=0
008054 [ts=62921816ssb, mod=4 level=0] txed att command: prep write rsp; conn=1 handle=0x001f offset=0
008054 [ts=62921816ssb, mod=4 level=0] host tx hci data; handle=1 length=108
008054 [ts=62921816ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x6c 0x00 0x68 0x00 0x04 0x00 0x17 0x1f 0x00 0x00 0x00 0x02 0x00 0x00 0x66 0x00 0x01 0x01 0x01 0xa3 0x63 0x6f 0x66 0x66 0x00 0x64 0x64 0x61 0x74 0x61 0x58 0x50 0x3c 0xb8 0xf3 0x96 0x24 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x64 0xf8 0x01 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x20 0xb5 0x82 0x00 0x00 0x11 0x83 0x00 0x00 0x13 0x83 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x5b 0x94 
008060 [ts=62968688ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=20 data=0x10 0x00 0x04 0x00 0x16 0x1f 0x00 0x63 0x00 0x00 0x00 0x63 0x6c 0x65 0x6e 0x1a 0x00 0x01 0xf8 0xa8 
008060 [ts=62968688ssb, mod=4 level=0] rxed att command: prep write req; conn=1 handle=0x001f offset=99
008060 [ts=62968688ssb, mod=4 level=0] txed att command: prep write rsp; conn=1 handle=0x001f offset=99
008060 [ts=62968688ssb, mod=4 level=0] host tx hci data; handle=1 length=20
008060 [ts=62968688ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x14 0x00 0x10 0x00 0x04 0x00 0x17 0x1f 0x00 0x63 0x00 0x00 0x00 0x63 0x6c 0x65 0x6e 0x1a 0x00 0x01 0xf8 0xa8 
008060 [ts=62968688ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008060 [ts=62968688ssb, mod=4 level=0] handle:1 pkts:1
008063 [ts=62992124ssb, mod=4 level=0] ble_hs_hci_evt_acl_process(): conn_handle=1 pb=2 len=6 data=0x02 0x00 0x04 0x00 0x18 0x01 
008064 [ts=63000000ssb, mod=4 level=0] rxed att command: exec write req; conn=1 flags=0x01
008064 [ts=63000000ssb, mod=4 level=0] host tx hci data; handle=1 length=5
008064 [ts=63000000ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x05 0x00 0x01 0x00 0x04 0x00 0x19 
008064 [ts=63000000ssb, mod=4 level=0] Number of Completed Packets: num_handles=1
008064 [ts=63000000ssb, mod=4 level=0] handle:1 pkts:1
008079 [ts=63117180ssb, mod=4 level=1] GATT procedure initiated: notify; att_handle=31
008080 [ts=63124992ssb, mod=4 level=0] txed att command: notify req; conn=1 handle=0x001f
008080 [ts=63124992ssb, mod=4 level=0] host tx hci data; handle=1 length=27
008080 [ts=63124992ssb, mod=4 level=0] ble_hs_hci_acl_tx(): 0x01 0x00 0x1b 0x00 0x17 0x00 0x04 0x00 0x1b 0x1f 0x00 0x03 0x00 0x00 0x0c 0x00 0x01 0x01 0x01 0xbf 0x62 0x72 0x63 0x00 0x63 0x6f 0x66 0x66 0x18 0x50 0xff 

Conflicting types for stm32 precision table

Some C files define AHBPrecTable as:
__I uint8_t AHBPrescTable[16]

(__I expands to volatile const).

However, the header file declares it as:

const uint8_t AHBPrescTable[16]

This mismatch causes build errors like the following:

Error: repos/apache-mynewt-core/hw/bsp/sensorhub/src/system_stm32f4xx.c:126:15: error: conflicting types for 'AHBPrescTable'
   __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
               ^
In file included from repos/apache-mynewt-core/hw/mcu/stm/stm32f4xx/src/ext/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f427xx.h:189:0,
                 from repos/apache-mynewt-core/hw/mcu/stm/stm32f4xx/src/ext/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:153,
                 from repos/apache-mynewt-core/hw/bsp/sensorhub/src/system_stm32f4xx.c:66:
repos/apache-mynewt-core/hw/mcu/stm/stm32f4xx/src/ext/Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h:76:23: note: previous declaration of 'AHBPrescTable' was here
 extern const uint8_t  AHBPrescTable[16];    /*!< AHB prescalers table values */

I am not sure if the volatile qualifier is necessary or not.

oic: fixing `oc_resource_t` structure arrangement which was different for different sources after building

Issue:
This was basically caused because of forward declaration of an enum. Changing this would mean moving around headers and creating a new one for enums.

(gdb) p &core_resources[0]
$24 = (oc_resource_t *) 0x20003078 <core_resources>
(gdb) p &core_resources[0].get_handler
$25 = (oc_request_handler_t *) 0x20003098 <core_resources+32>
(gdb) p &((oc_resource_t *) 0x20003078)->get_handler
$26 = (oc_request_handler_t *) 0x20003094 <core_resources+28>
(gdb) p &((oc_resource_t *) 0x20003080)->next                           (gdb) p &core_resources[0].next
$11 = (struct {...} *) 0x20003080 <core_resources>                      $19 = (struct {...} *) 0x20003080 <core_resources>
(gdb) p &((oc_resource_t *) 0x20003080)->device                         (gdb) p &core_resources[0].device
$12 = (int *) 0x20003084 <core_resources+4>                             $20 = (int *) 0x20003084 <core_resources+4>
(gdb) p &((oc_resource_t *) 0x20003080)->uri                            (gdb) p &core_resources[0].uri
$13 = (oc_string_t *) 0x20003088 <core_resources+8>                     $21 = (oc_string_t *) 0x20003088 <core_resources+8>
(gdb) p &((oc_resource_t *) 0x20003080)->types                          (gdb) p &core_resources[0].types
$14 = (oc_string_array_t *) 0x20003090 <core_resources+16>              $22 = (oc_string_array_t *) 0x20003090 <core_resources+16>
(gdb) p &((oc_resource_t *) 0x20003080)->interfaces                     (gdb) p &core_resources[0].interfaces
$15 = (oc_interface_mask_t *) 0x20003098 <core_resources+24>            $23 = (oc_interface_mask_t *) 0x20003098 <core_resources+24>
(gdb) p &((oc_resource_t *) 0x20003080)->default_interface              (gdb) p &core_resources[0].default_interface
$16 = (oc_interface_mask_t *) 0x20003099 <core_resources+25>            $24 = (oc_interface_mask_t *) 0x20003099 <core_resources+25>
(gdb) p &((oc_resource_t *) 0x20003080)->properties                     (gdb) p &core_resources[0].properties
$17 = (oc_resource_properties_t *) 0x2000309a <core_resources+26>       $25 = (oc_resource_properties_t *) 0x2000309c <core_resources+28>

soft pwm api questions

Current softpwm uses os cpu time, ie I think that means it shares with the system timer. At how often a timer would that get problematic?

Would it be better to use a separate hal timer? or I guess maybe a syscfg flag to choose the source?

Secondly,
soft pwm appears to attempt to utilize the pwm api 1:1, why should it get a separate device name?
https://github.com/apache/mynewt-core/blob/master/apps/pwm_test/src/main.c#L41

I would argue for the default bsps to resolve soft pwm to pwm0

nffs: Assert at nffs_pkg_init with corrupt(?) flash

(https://github.com/apache/mynewt-nffs doesn't issues, hence I've filed this here instead)

I'm getting an assert at startup from nffs that's preventing me from booting the system.

Backtrace:

#0  __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, e=e@entry=0x0)
    at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:138
#1  0x000281be in nffs_hash_remove (entry=0x0, entry@entry=0x2000bf74) at repos/apache-mynewt-core/fs/nffs/src/nffs_hash.c:179
#2  0x0002a454 in nffs_block_delete_from_ram (block_entry=0x2000bf74) at repos/apache-mynewt-core/fs/nffs/src/nffs_block.c:271
#3  0x0002835e in nffs_inode_delete_blocks_from_ram (inode_entry=0x2000b6b8) at repos/apache-mynewt-core/fs/nffs/src/nffs_inode.c:274
#4  nffs_inode_delete_from_ram (ignore_corruption=1, inode_entry=0x2000b6b8) at repos/apache-mynewt-core/fs/nffs/src/nffs_inode.c:309
#5  nffs_inode_dec_refcnt_priv (inode_entry=0x2000b6b8, ignore_corruption=1) at repos/apache-mynewt-core/fs/nffs/src/nffs_inode.c:355
#6  0x00029972 in nffs_restore_sweep () at repos/apache-mynewt-core/fs/nffs/src/nffs_restore.c:329
#7  0x00029a76 in nffs_restore_full (area_descs=area_descs@entry=0x20007104 <os_main_stack+3932>)
    at repos/apache-mynewt-core/fs/nffs/src/nffs_restore.c:1402
#8  0x0002749c in nffs_detect (area_descs=area_descs@entry=0x20007104 <os_main_stack+3932>) at repos/apache-mynewt-core/fs/nffs/src/nffs.c:671
#9  0x000275fe in nffs_pkg_init () at repos/apache-mynewt-core/fs/nffs/src/nffs.c:781
#10 0x00024e5a in sysinit_app () at bin/targets/lnode_main/generated/src/lnode_main-sysinit-app.c:89
#11 0x00008604 in main (argc=<optimized out>, argv=<optimized out>) at apps/lnode/src/main.c:113

This is using an external flash, but from what I can see it's only reading. If a nffs section is corrupted in flash it should just result in the flash being formatted rather than the system getting stuck in an assert-reboot loop right?

The external flash is defined in bsp.yml as below. It's actually a 4MB (32Mbit) flash, but I'm only using the first 1MB for NFFS at the moment:

...
        FLASH_AREA_NFFS:
            user_id: 1
            device: 1
            offset: 0x00000000
            size: 1024kB
...

NFFS generally works well on this flash, but now and then this happens and I have to start with another image and erase the flash manually.

Sterling suggested it may be a memory exhaustion issue? Happy for any input as to how to debug that and anything else further.

pwm driver (nrf52): how to close cleanly

what is the correct way to cleanly shut down all pwm functionality.
Im attempting to simply os_dev_close which is succeeding, but future os_dev_open fails with the following, presumably some irq isn't cleaned up properly either by me or the pwm driver

Program received signal SIGTRAP, Trace/breakpoint trap.
hal_system_reset () at repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_system.c:50
50	            asm("bkpt");
(gdb) where
#0  hal_system_reset () at repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_system.c:50
#1  0x0000c5c8 in os_default_irq (tf=0x2003ffc8) at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c:170
#2  0x0000d576 in os_default_irq_asm () at repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/m4/HAL_CM4.s:223
#3  <signal handler called>
#4  0x00000000 in ?? ()
#5  0x00000000 in ?? ()
(gdb) 

should this be allowable, or do I need to do some sort of cleanup like pwm_disable etc?

targets/central-nrf52840pdk
    app=@apache-mynewt-core/apps/pwm_test
    bsp=@apache-mynewt-core/hw/bsp/nrf52840pdk
    build_profile=optimized
    syscfg=BLE_LL_CONN_INIT_MIN_WIN_OFFSET=2:BLE_MAX_CONNECTIONS=1:CONSOLE_PROMPT=1:CONSOLE_RTT=1:CONSOLE_TICKS=1:CONSOLE_UART=0:LOG_CONSOLE=1:LOG_LEVEL=0:LOG_SOFT_RESET=1:OS_MAIN_STACK_SIZE=468:PWM_0=1:REBOOT_LOG_CONSOLE=1:TIMER_1=1
Jacobs-Air:charm jacobrosenthal$ 
/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
#include "syscfg/syscfg.h"
#include "sysinit/sysinit.h"
#include <os/os.h>
#include <pwm/pwm.h>
#include <bsp/bsp.h>

struct pwm_dev *pwm;
uint16_t max_val;
static struct os_callout my_callout;

int
pwm_init(void)
{
    struct pwm_chan_cfg chan_conf = {
        .pin = LED_BLINK_PIN,
        .inverted = true,
        .data = NULL
    };
    uint32_t base_freq;
    int rc;

#if MYNEWT_VAL(SOFT_PWM)
    pwm = (struct pwm_dev *) os_dev_open("spwm", 0, NULL);
#else
    pwm = (struct pwm_dev *) os_dev_open("pwm0", 0, NULL);
#endif

    /* set the PWM frequency */
    pwm_set_frequency(pwm, 10000);
    base_freq = pwm_get_clock_freq(pwm);
    max_val = (uint16_t) (base_freq / 10000);

    /* setup led 1 - 100% duty cycle*/
    rc = pwm_chan_config(pwm, 0, &chan_conf);
    assert(rc == 0);

    rc = pwm_enable_duty_cycle(pwm, 0, max_val);
    assert(rc == 0);

#ifdef LED_2
    /* setup led 2 - 50% duty cycle */
    chan_conf.pin = LED_2;
    rc = pwm_chan_config(pwm, 1, &chan_conf);
    assert(rc == 0);

    rc = pwm_enable_duty_cycle(pwm, 1, max_val/2);
    assert(rc == 0);
#endif
#ifdef LED_3
    /* setup led 3 - 25% duty cycle */
    chan_conf.pin = LED_3;
    rc = pwm_chan_config(pwm, 2, &chan_conf);
    assert(rc == 0);

    rc = pwm_enable_duty_cycle(pwm, 2, max_val/4);
    assert(rc == 0);
#endif
#ifdef LED_4
    /* setup led 4 - 10% duty cycle */
    chan_conf.pin = LED_4;
    rc = pwm_chan_config(pwm, 3, &chan_conf);
    assert(rc == 0);

    rc = pwm_enable_duty_cycle(pwm, 3, max_val/10);
    assert(rc == 0);
#endif

    return rc;
}

static void
pwm_toggle(struct os_event *ev)
{
    int rc;

    if(pwm!=0){
        rc = os_dev_close((struct os_dev *)pwm);
        assert(rc == 0);
        pwm = NULL;
    }else{
        rc = pwm_init();
        assert(rc == 0);
    }
    os_callout_reset(&my_callout, OS_TICKS_PER_SEC * 5);
}

int
main(int argc, char **argv)
{
    sysinit();

    os_callout_init(&my_callout, os_eventq_dflt_get(),  
                    pwm_toggle, NULL);

    os_callout_reset(&my_callout, OS_TICKS_PER_SEC * 5);

    while (1) {
        os_eventq_run(os_eventq_dflt_get());
    }
    assert(0);
    return(0);
}

README in net/nimble

We should have a README in mynewt-core/net/nimble so that people who are confused by there being no code in there, know to look at mynewt-nimble.

Will it support SX1261?

You've heard of Semtech's new LoRa PHY models.
Support update for LoRaMac-node has been released.

Will the SX126x be supported after the SX1276 in this beautiful project?

We would like to provide Apache Mynewt support for a newly designed LoRaWAN Module (nRF52832 + SX1261).

pwm enabled?

It's seems that it is only permitted to call pwm_disable if it was already pwm_enable_* before (tested on nrf52).
An API for testing if the pwm is currently enabled would be useful.
The same goes for configured state, as pwm_disable unconfigure the channel

Perhaps a diagram showing what function can be called in what order would be a nice addition, as well as explicitly saying in the documentation when it its legit to call the function

nrf52 thingy target occasionally disconnects and never readvertises ble during first packet of newtmgr upload command

This is apparently not related to #789

Jacobs-Air:chippd3 jacobrosenthal$ newt target show split-thingy
* Warning: failed to read repo "mynewt-nordic": open /Users/jacobrosenthal/Downloads/chippd3/repos/mynewt-nordic: no such file or directory
targets/split-thingy
    app=@apache-mynewt-core/apps/blesplit
    bsp=@apache-mynewt-core/hw/bsp/nrf52-thingy
    build_profile=optimized
    loader=@apache-mynewt-core/apps/bleprph
    syscfg=CONSOLE_ECHO=0:CONSOLE_INPUT=0:CONSOLE_MAX_INPUT_LEN=0:CONSOLE_RTT=1:CONSOLE_UART=0:LOG_LEVEL=0:SHELL_TASK=0
Jacobs-Air:chippd3 jacobrosenthal$ echo -ne "erase all\nq\n" | JLinkExe -if SWD -device nRF52 -speed 1000
SEGGER J-Link Commander V6.30b (Compiled Feb  2 2018 18:41:11)
DLL version V6.30b, compiled Feb  2 2018 18:41:01

Connecting to J-Link via USB...O.K.
Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46
Hardware version: V8.00
S/N: 268006294
License(s): FlashBP, GDB
OEM: SEGGER-EDU
VTref = 3.274V


Type "connect" to establish a target connection, '?' for help
Target connection not established yet but required for command.
Device "NRF52" selected.


Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: JTAG-AP (IDR: 0x02880000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
Cortex-M4 identified.
Erasing device ((null))...
Comparing flash   [100%] Done.
Erasing flash     [100%] Done.
Verifying flash   [100%] Done.
J-Link: Flash download: Total time needed: 0.321s (Prepare: 0.049s, Compare: 0.000s, Erase: 0.266s, Program: 0.000s, Verify: 0.000s, Restore: 0.006s)
Erasing done.
Jacobs-Air:chippd3 jacobrosenthal$ newt build boot-thingy && newt load boot-thingy
* Warning: failed to read repo "mynewt-nordic": open /Users/jacobrosenthal/Downloads/chippd3/repos/mynewt-nordic: no such file or directory
Building target targets/boot-thingy
Compiling bin/targets/boot-thingy/generated/src/boot-thingy-sysinit-app.c
Compiling bin/targets/boot-thingy/generated/src/boot-thingy-sysflash.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/bootutil_misc.c
Compiling repos/apache-mynewt-core/apps/boot/src/boot.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_ec256.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_rsa.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/image_validate.c
Compiling repos/apache-mynewt-core/boot/bootutil/src/loader.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/aes.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/aesni.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/arc4.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/asn1parse.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/asn1write.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/base64.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/bignum.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/blowfish.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/camellia.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ccm.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/certs.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/cipher.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/cipher_wrap.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/cmac.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ctr_drbg.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/debug.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/des.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/dhm.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ecdh.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ecjpake.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ecdsa.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ecp.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ecp_curves.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/entropy.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/entropy_poll.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/error.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/gcm.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/havege.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/hmac_drbg.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/md.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/md2.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/md4.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/md5.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/md_wrap.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/memory_buffer_alloc.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/net.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/net_sockets.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/oid.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/padlock.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pem.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pk.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pk_wrap.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pkcs11.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pkcs12.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pkcs5.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pkparse.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/pkwrite.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ripemd160.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/platform.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/rsa.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/sha1.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/sha256.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/sha512.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ssl_cache.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ssl_ciphersuites.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ssl_cli.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ssl_cookie.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ssl_srv.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ssl_ticket.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/ssl_tls.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/threading.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/timing.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/version.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/version_features.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/x509.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/x509_create.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/x509_crl.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/x509_crt.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/x509write_crt.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/x509_csr.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/x509write_csr.c
Compiling repos/apache-mynewt-core/crypto/mbedtls/src/xtea.c
Compiling repos/apache-mynewt-core/hw/bsp/nrf52-thingy/src/hal_bsp.c
Compiling repos/apache-mynewt-core/hw/bsp/nrf52-thingy/src/sbrk.c
Assembling repos/apache-mynewt-core/hw/bsp/nrf52-thingy/src/arch/cortex_m4/gcc_startup_nrf52.s
Assembling repos/apache-mynewt-core/hw/bsp/nrf52-thingy/src/arch/cortex_m4/gcc_startup_nrf52_split.s
Compiling repos/apache-mynewt-core/hw/cmsis-core/src/cmsis_nvic.c
Compiling repos/apache-mynewt-core/hw/drivers/uart/src/uart.c
Compiling repos/apache-mynewt-core/hw/drivers/uart/uart_hal/src/uart_hal.c
Compiling repos/apache-mynewt-core/hw/hal/src/hal_common.c
Compiling repos/apache-mynewt-core/hw/hal/src/hal_flash.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/src/prs/nrfx_prs.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/src/nrfx_pwm.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/drivers/src/nrfx_saadc.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/hal/nrf_adc.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/hal/nrf_ecb.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/src/ext/nrfx/hal/nrf_nvmc.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_flash.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_i2c.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_reset_cause.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_system_start.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_system.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_uart.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/nrf52_hw_id.c
Compiling repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c
Compiling repos/apache-mynewt-core/kernel/os/src/endian.c
Compiling repos/apache-mynewt-core/kernel/os/src/os.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_callout.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_cputime_1mhz.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_cputime.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_cputime_high.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_cputime_pwr2.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_dev.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_eventq.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_heap.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_mbuf.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_mempool.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_msys_init.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_mutex.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_sanity.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_sched.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_sem.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_task.c
Compiling repos/apache-mynewt-core/kernel/os/src/os_time.c
Compiling repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_arch_arm.c
Compiling repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/os_fault.c
Assembling repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/m4/HAL_CM4.s
Assembling repos/apache-mynewt-core/kernel/os/src/arch/cortex_m4/m4/SVC_Table.s
Compiling repos/apache-mynewt-core/libc/baselibc/src/asprintf.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/atoi.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/atol.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/atoll.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/bsearch.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/bzero.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/calloc.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/fgets.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/inline.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/jrand48.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/lrand48.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/malloc.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memccpy.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memchr.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memcmp.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memcpy.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memfile.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memmem.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memmove.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memrchr.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memset.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/memswap.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/mrand48.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/mynewt.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/nrand48.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/qsort.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/realloc.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/srand48.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/sprintf.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/sscanf.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strcasecmp.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strcat.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/start.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strchr.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strcmp.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strcpy.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strcspn.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strdup.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strlcat.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strlcpy.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strlen.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strncasecmp.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strncat.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strncmp.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strncpy.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strndup.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strnlen.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strntoimax.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strntoumax.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strpbrk.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strrchr.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strsep.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strspn.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strstr.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtoimax.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtok.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtok_r.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtol.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtoll.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtoul.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtoull.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/strtoumax.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/tinyprintf.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/vasprintf.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/vprintf.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/vsprintf.c
Compiling repos/apache-mynewt-core/libc/baselibc/src/vsscanf.c
Compiling repos/apache-mynewt-core/sys/flash_map/src/flash_map.c
Compiling repos/apache-mynewt-core/sys/mfg/src/mfg.c
Compiling repos/apache-mynewt-core/sys/sysinit/src/sysinit.c
Compiling repos/apache-mynewt-core/util/mem/src/mem.c
Archiving apps_boot.a
Archiving boot-thingy-sysinit-app.a
Archiving boot_bootutil.a
Archiving crypto_mbedtls.a
Archiving hw_bsp_nrf52-thingy.a
Archiving hw_cmsis-core.a
Archiving hw_drivers_uart.a
Archiving hw_drivers_uart_uart_hal.a
Archiving hw_hal.a
Archiving hw_mcu_nordic.a
Archiving hw_mcu_nordic_nrf52xxx.a
Archiving kernel_os.a
Archiving libc_baselibc.a
Archiving sys_flash_map.a
Archiving sys_mfg.a
Archiving sys_sysinit.a
Archiving util_mem.a
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/boot-thingy/app/apps/boot/boot.elf
Target successfully built: targets/boot-thingy
* Warning: failed to read repo "mynewt-nordic": open /Users/jacobrosenthal/Downloads/chippd3/repos/mynewt-nordic: no such file or directory
Loading bootloader
Jacobs-Air:chippd3 jacobrosenthal$ newt run split-thingy 0.0.0.1
* Warning: failed to read repo "mynewt-nordic": open /Users/jacobrosenthal/Downloads/chippd3/repos/mynewt-nordic: no such file or directory
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-app.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-loader.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysflash.c
Archiving split-thingy-sysinit-app.a
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/app/apps/blesplit/blesplit_tmp.elf
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-app.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-loader.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysflash.c
Archiving split-thingy-sysinit-loader.a
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph_tmp.elf
c
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.elf
Generating ROM elf 
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/app/apps/blesplit/blesplit.elf
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-loader.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysflash.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-app.c
Archiving split-thingy-sysinit-app.a
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/app/apps/blesplit/blesplit_tmp.elf
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-app.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysflash.c
Compiling bin/targets/split-thingy/generated/src/split-thingy-sysinit-loader.c
Archiving split-thingy-sysinit-loader.a
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph_tmp.elf
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.elf
Generating ROM elf 
Linking /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/app/apps/blesplit/blesplit.elf
App image succesfully generated: /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.img
App image succesfully generated: /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/app/apps/blesplit/blesplit.img
Loading app image into slot 2
Loading loader image into slot 1
[/Users/jacobrosenthal/Downloads/chippd3/repos/apache-mynewt-core/hw/bsp/nrf52-thingy/nrf52-thingy_debug.sh /Users/jacobrosenthal/Downloads/chippd3/repos/apache-mynewt-core/hw/bsp/nrf52-thingy /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph]
Debugging /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.elf
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
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-apple-darwin10 --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"...
Reading symbols from /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.elf...done.
.gdbinit:1: Error in sourced command file:
No symbol "startup" in current context.
os_tick_idle (ticks=1870) at repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c:165
165	    if (ticks > 0) {
Resetting target
0x000000dc in ?? ()
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
os_tick_idle (ticks=1920) at repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c:165
165	    if (ticks > 0) {
(gdb) where
#0  os_tick_idle (ticks=1920) at repos/apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c:165
#1  0x0000891e in os_idle_task (arg=<optimized out>) at repos/apache-mynewt-core/kernel/os/src/os.c:117
#2  0x00000000 in ?? ()
(gdb) p os_msys_init_1_mempool
$1 = {mp_block_size = 112, mp_num_blocks = 22, mp_num_free = 18, mp_min_free = 11, mp_flags = 0 '\000', mp_membuf_addr = 536874208, mp_list = {
    stqe_next = 0x2000246c <ble_hci_ram_evt_hi_pool>}, {slh_first = 0x20000ea0 <os_msys_init_1_data+448>}, name = 0x25169 "msys_1"}
(gdb) p ble_phy_stats
$2 = {s_hdr = {s_name = 0x273f7 "ble_phy", s_size = 4 '\004', s_cnt = 13 '\r', s_pad1 = 0, s_next = {stqe_next = 0x0}}, sphy_isrs = 142238, 
  stx_good = 47390, stx_fail = 0, stx_late = 0, stx_bytes = 347978, srx_starts = 46627, srx_aborts = 1, srx_valid = 46506, srx_crc_err = 120, 
  srx_late = 44, sradio_state_errs = 0, srx_hw_err = 0, stx_hw_err = 0}
(gdb) p ble_ll_stats
$3 = {s_hdr = {s_name = 0x27046 "ble_ll", s_size = 4 '\004', s_cnt = 49 '1', s_pad1 = 0, s_next = {stqe_next = 0x20003d1c <ble_phy_stats>}}, 
  shci_cmds = 63, shci_cmd_errs = 0, shci_events_sent = 7913, sbad_ll_state = 0, sbad_acl_hdr = 0, sno_bufs = 0, srx_adv_pdu_crc_ok = 53, 
  srx_adv_pdu_crc_err = 0, srx_adv_bytes_crc_ok = 962, srx_adv_bytes_crc_err = 0, srx_data_pdu_crc_ok = 46453, srx_data_pdu_crc_err = 120, 
  srx_data_bytes_crc_ok = 919564, srx_data_bytes_crc_err = 3960, srx_adv_malformed_pkts = 0, srx_adv_ind = 0, srx_adv_direct_ind = 0, 
  srx_adv_nonconn_ind = 0, srx_adv_ext_ind = 0, srx_scan_reqs = 43, srx_scan_rsps = 0, srx_connect_reqs = 10, srx_scan_ind = 0, 
  srx_aux_connect_rsp = 0, sadv_txg = 777, sadv_late_starts = 0, sadv_resched_pdu_fail = 0, sadv_drop_event = 0, ssched_state_conn_errs = 0, 
  ssched_state_adv_errs = 0, sscan_starts = 0, sscan_stops = 0, sscan_req_txf = 0, sscan_req_txg = 0, sscan_rsp_txg = 43, saux_missed_adv = 0, 
  saux_scheduled = 0, saux_received = 0, saux_fired_for_read = 0, saux_conn_req_tx = 0, saux_conn_rsp_tx = 0, saux_conn_rsp_err = 0, 
  saux_scan_req_tx = 0, saux_scan_rsp_err = 0, saux_chain_cnt = 0, saux_chain_err = 0, sadv_evt_dropped = 0, sscan_timer_stopped = 0, 
  sscan_timer_restarted = 0}
(gdb) p ble_ll_conn_stats
$4 = {s_hdr = {s_name = 0x2704d "ble_ll_conn", s_size = 4 '\004', s_cnt = 26 '\032', s_pad1 = 0, s_next = {
      stqe_next = 0x2000305c <ble_ll_stats>}}, scant_set_sched = 0, sconn_ev_late = 0, swfr_expirations = 873, shandle_not_found = 0, 
  sno_conn_sm = 0, sno_free_conn_sm = 0, srx_data_pdu_no_conn = 0, srx_data_pdu_bad_aa = 0, sslave_rxd_bad_conn_req_params = 0, 
  sslave_ce_failures = 44, sdata_pdu_rx_dup = 252, sdata_pdu_txg = 46182, sdata_pdu_txf = 261, sconn_req_txd = 0, sl2cap_enqueued = 7821, 
  srx_ctrl_pdus = 25, srx_l2cap_pdus = 30614, srx_l2cap_bytes = 822916, srx_malformed_ctrl_pdus = 0, srx_bad_llid = 0, stx_ctrl_pdus = 19, 
  stx_ctrl_bytes = 171, stx_l2cap_pdus = 15643, stx_l2cap_bytes = 227905, stx_empty_pdus = 30908, smic_failures = 0}
(gdb) x/32wx os_main_stack
0x20000568 <os_main_stack>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
0x20000578 <os_main_stack+16>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
0x20000588 <os_main_stack+32>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
0x20000598 <os_main_stack+48>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
0x200005a8 <os_main_stack+64>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
0x200005b8 <os_main_stack+80>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
0x200005c8 <os_main_stack+96>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
0x200005d8 <os_main_stack+112>:	0xdeadbeef	0xdeadbeef	0xdeadbeef	0xdeadbeef
(gdb) 

...couple of successful uploads later
**** Running: newtmgr -c nimble_bleprph image list *****

Images:
 slot=0
    version: 0.0.0.1
    bootable: true
    flags: active confirmed
    hash: a5cc4e507442d75e130f9f2ae69b569f21eb9da3e74c50a57d6a4fded31c99e0
 slot=1
    version: 0.0.0.2
    bootable: true
    flags: 
    hash: 517d45dace367a948a771e329f9efd890ef4d367f11b3a44b5104aa5455c8a56
Split status: N/A (0)

**** Running: newtmgr -ldebug -c nimble_bleprph image upload /Users/jacobrosenthal/Downloads/chippd3/bin/targets/split-thingy/loader/apps/bleprph/bleprph.img *****

DEBU[2018-02-06 16:18:45.398] Using connection profile: name=nimble_bleprph type=ble connstring=peer_name=nimble-bleprph 
DEBU[2018-02-06 16:18:45.457] {add-oic-listener} [transceiver.go:62] token=[] 
DEBU[2018-02-06 16:18:45.457] Connecting to peer                           
DEBU[2018-02-06 16:18:46.065] Exchanging MTU                               
DEBU[2018-02-06 16:18:46.065] Exchanged MTU; ATT MTU = 104                 
DEBU[2018-02-06 16:18:46.065] Discovering profile                          
DEBU[2018-02-06 16:18:46.58] Subscribing to NMP response characteristic   
 0 / 129192 [---------------------------------------------------------------------------------------------------------------------------]   0.00%DEBU[2018-02-06 16:18:46.61] {add-nmp-listener} [bll_sesn.go:401] seq=66  
DEBU[2018-02-06 16:18:46.611] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:66 Id:5}}} to:
00000000  a0                                                |.|
 
DEBU[2018-02-06 16:18:46.611] Encoded:
00000000  02 00 00 01 00 01 42 05  a0                       |......B..|
 
DEBU[2018-02-06 16:18:46.611] Tx NMP request: 00000000  02 00 00 01 00 01 42 05  a0                       |......B..|
 
DEBU[2018-02-06 16:18:46.76] Received nmp rsp: &{NmpBase:{hdr:{Op:3 Flags:0 Len:6 Group:1 Seq:66 Id:5}} Rc:0} 
DEBU[2018-02-06 16:18:46.76] {remove-nmp-listener} [bll_sesn.go:401] seq=66 
DEBU[2018-02-06 16:18:46.761] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:67 Id:1}} Off:0 Len:129192 Data:[]} to:
00000000  a3 64 64 61 74 61 f6 63  6c 65 6e 1a 00 01 f8 a8  |.ddata.clen.....|
00000010  63 6f 66 66 00                                    |coff.|
 
DEBU[2018-02-06 16:18:46.761] Encoded:
00000000  02 00 00 15 00 01 43 01  a3 64 64 61 74 61 f6 63  |......C..ddata.c|
00000010  6c 65 6e 1a 00 01 f8 a8  63 6f 66 66 00           |len.....coff.|
 
DEBU[2018-02-06 16:18:46.761] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:68 Id:1}} Off:0 Len:129192 Data:[60 184 243 150 36 0 0 0 32 0 0 0 100 248 1 0 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 1 32 181 130 0 0 17 131 0 0 19 131 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]} to:
00000000  a3 64 64 61 74 61 58 48  3c b8 f3 96 24 00 00 00  |.ddataXH<...$...|
00000010  20 00 00 00 64 f8 01 00  02 00 00 00 00 00 00 00  | ...d...........|
00000020  02 00 00 00 00 00 00 00  00 00 01 20 b5 82 00 00  |........... ....|
00000030  11 83 00 00 13 83 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  63 6c 65 6e 1a 00 01 f8  a8 63 6f 66 66 00        |clen.....coff.|
 
DEBU[2018-02-06 16:18:46.761] Encoded:
00000000  02 00 00 5e 00 01 44 01  a3 64 64 61 74 61 58 48  |...^..D..ddataXH|
00000010  3c b8 f3 96 24 00 00 00  20 00 00 00 64 f8 01 00  |<...$... ...d...|
00000020  02 00 00 00 00 00 00 00  02 00 00 00 00 00 00 00  |................|
00000030  00 00 01 20 b5 82 00 00  11 83 00 00 13 83 00 00  |... ............|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  63 6c 65 6e 1a 00 01 f8  |........clen....|
00000060  a8 63 6f 66 66 00                                 |.coff.|
 
DEBU[2018-02-06 16:18:46.761] {add-nmp-listener} [bll_sesn.go:401] seq=69  
DEBU[2018-02-06 16:18:46.761] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:69 Id:1}} Off:0 Len:129192 Data:[60 184 243 150 36 0 0 0 32 0 0 0 100 248 1 0 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 1 32 181 130 0 0 17 131 0 0 19 131 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]} to:
00000000  a3 64 64 61 74 61 58 47  3c b8 f3 96 24 00 00 00  |.ddataXG<...$...|
00000010  20 00 00 00 64 f8 01 00  02 00 00 00 00 00 00 00  | ...d...........|
00000020  02 00 00 00 00 00 00 00  00 00 01 20 b5 82 00 00  |........... ....|
00000030  11 83 00 00 13 83 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 63  |...............c|
00000050  6c 65 6e 1a 00 01 f8 a8  63 6f 66 66 00           |len.....coff.|
 
DEBU[2018-02-06 16:18:46.761] Encoded:
00000000  02 00 00 5d 00 01 45 01  a3 64 64 61 74 61 58 47  |...]..E..ddataXG|
00000010  3c b8 f3 96 24 00 00 00  20 00 00 00 64 f8 01 00  |<...$... ...d...|
00000020  02 00 00 00 00 00 00 00  02 00 00 00 00 00 00 00  |................|
00000030  00 00 01 20 b5 82 00 00  11 83 00 00 13 83 00 00  |... ............|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 63  6c 65 6e 1a 00 01 f8 a8  |.......clen.....|
00000060  63 6f 66 66 00                                    |coff.|
 
DEBU[2018-02-06 16:18:46.761] Tx NMP request: 00000000  02 00 00 5d 00 01 45 01  a3 64 64 61 74 61 58 47  |...]..E..ddataXG|
00000010  3c b8 f3 96 24 00 00 00  20 00 00 00 64 f8 01 00  |<...$... ...d...|
00000020  02 00 00 00 00 00 00 00  02 00 00 00 00 00 00 00  |................|
00000030  00 00 01 20 b5 82 00 00  11 83 00 00 13 83 00 00  |... ............|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 63  6c 65 6e 1a 00 01 f8 a8  |.......clen.....|
00000060  63 6f 66 66 00                                    |coff.|
 
 0 B / 126.16 KiB [---------------------------------------------------------------------------------------------------------------------]   0.00%DEBU[2018-02-06 16:18:48.943] OIC error: disconnected                      
DEBU[2018-02-06 16:18:48.943] {remove-nmp-listener} [bll_sesn.go:401] seq=69 
DEBU[2018-02-06 16:18:48.943] {remove-oic-listener} [.:0] token=[]         
DEBU[2018-02-06 16:18:48.943] goroutine 1 [running]:
mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util.NewNewtError(0xc4200cdf10, 0xc, 0xc)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:77 +0xe8
mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util.ChildNewtError(0x4a590c0, 0xc42015c680, 0xc4201cc000)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/mynewt.apache.org/newt/util/util.go:103 +0x82
mynewt.apache.org/newtmgr/newtmgr/cli.imageUploadCmd(0xc420167440, 0xc42005ba40, 0x1, 0x4)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/newtmgr/cli/image.go:202 +0x40a
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).execute(0xc420167440, 0xc42005e720, 0x4, 0x6, 0xc420167440, 0xc42005e720)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:654 +0x2a2
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc42008bb00, 0xc42012df08, 0xc42012def8, 0xc42015c170)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:729 +0x2fe
mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra.(*Command).Execute(0xc42008bb00, 0x473f830, 0xc42005e420)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/spf13/cobra/command.go:688 +0x2b
main.main()
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/newtmgr/newtmgr.go:111 +0x119

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/sigqueue.go:131 +0xa7
os/signal.loop()
	/usr/local/Cellar/go/1.9.2/libexec/src/os/signal/signal_unix.go:22 +0x22
created by os/signal.init.0
	/usr/local/Cellar/go/1.9.2/libexec/src/os/signal/signal_unix.go:28 +0x41

goroutine 7 [select, locked to thread]:
runtime.gopark(0x4741a38, 0x0, 0x4719c96, 0x6, 0x18, 0x1)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/proc.go:287 +0x12c
runtime.selectgo(0xc420038f50, 0xc42001e240)
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/select.go:395 +0x1149
runtime.ensureSigM.func1()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/signal_unix.go:511 +0x1fe
runtime.goexit()
	/usr/local/Cellar/go/1.9.2/libexec/src/runtime/asm_amd64.s:2337 +0x1

goroutine 8 [chan receive]:
main.main.func1(0xc42005e420)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/newtmgr/newtmgr.go:97 +0x4b
created by main.main
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/newtmgr/newtmgr.go:95 +0x10f

goroutine 35 [select]:
mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble.trap.func1(0xc4201fa1e0, 0xc4201c0260, 0x4a61580, 0xc4201bc240)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble/gatt.go:173 +0xf2
created by mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble.trap
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble/gatt.go:172 +0x192

goroutine 27 [chan send]:
mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble.Connect.func2(0x4a64400, 0xc4201c0830)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble/gatt.go:139 +0x5e
mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble.Scan.func1(0x4a64400, 0xc4201c0830)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble/gatt.go:97 +0x75
created by mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble/darwin.(*Device).HandleXpcEvent
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/go-ble/ble/darwin/device.go:418 +0x1b38

goroutine 52 [select]:
mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb.(*ProgressBar).refresher(0xc420264000)
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb/pb.go:462 +0x109
created by mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb.(*ProgressBar).Start
	/Users/jacobrosenthal/dev/go/src/mynewt.apache.org/newtmgr/vendor/github.com/cheggaaa/pb/pb.go:123 +0xc0
 
Error: disconnected
Jacobs-Air:chippd3 jacobrosenthal$ 

Ensure HAL is clearly specified

We should make sure the contract of each HAL function is clearly specified, both in header files and in the online documentation. The specification should aim to leave no questions unanswered for someone using the HAL or creating an implementation.

The specification indicate the defined behavior for particular conditions and argument values. When practical, instances of undefined behavior should be called out.

For example, for hal_flash_write():

  • What gets returned when an invalid flash_id argument is specified? (-1)
  • What happens when the specified region of flash is already written? (undefined)
  • What happens when 0-byte write is performed? (no-op; 0 returned)

...and so on.

Issues when building for NRF52810

I think I might have found a bug with the new nrfx stuff. If you try using the nrf52810 or nrf52840, you'd have to add '-DNRF52810_XXAA' on the bsp's pkg.yml instead of the old '-DNRF52'

Now when I build something, I get some definition collisions since many of the bsp's still use #include <nrf52.h> which, if I understand correctly, now should be #include <nrf.h>
So both get included and things get redefined, unless I'm doing something wrong.

There's also hw/mcu/nordic/nrf52xxx/include/mcu/cortex_m4.h, which has an include for NRF52840_XXAA, but otherwise defaults to nrf52.h

hw/drivers/nimble/nrf52/src/ble_hw.c includes nrf52_bitfields.h, which also breaks. I see nrf.h includes the appropriate ones for that too, so replacing it should be fine.

TSL2561, i2c transaction seemed to be stopped too soon

Reading code, I2C transaction seemed to be marked as finished to soon during the register read.
Would have expected 0 for the last parameter (like what is done in mpu6050)

rc = hal_i2c_master_write(itf->si_num, &data_struct,
OS_TICKS_PER_SEC / 10, 1);

rc = hal_i2c_master_write(itf->si_num, &data_struct,
OS_TICKS_PER_SEC / 10, 1);

nrf52840 hal spi is broken

The current hal spi for the nordic nrf52840 is broken as it assumes SPI pins will use port 0 (pins 0 - 31). If pins greater than 31 are used incorrect ports will be accessed.

Split status: non-matching (1) when (near?) out of memory

I keep randomly running into this and just figurd it out. When split targets are low memory on one or the other image, they can show as Split status: non-matching (1) after you test into the app

$ newt target show split-microbit
targets/split-microbit
    app=@apache-mynewt-core/apps/blesplit
    bsp=@apache-mynewt-core/hw/bsp/bbc_microbit
    build_profile=optimized
    loader=@apache-mynewt-core/apps/bleprph
    syscfg=BLE_LL_CFG_FEAT_LE_ENCRYPTION=0:BLE_SM_LEGACY=0:BLE_SM_SC=0:LOG_LEVEL=255:MSYS_1_BLOCK_COUNT=19
$ newtmgr -cnimble_blesplit image list
Images:
 slot=0
    version: 0.0.0.1
    bootable: true
    flags: active confirmed
    hash: dced80ca9c6c18500c8035d31afb3d41c900e4de7defeaa1c27c083f13125d7c
 slot=1
    version: 0.0.0.1
    bootable: false
    flags: active confirmed
    hash: d04aae5bf5bc8ae495e1d59b6211600a9de983ab851be2cbe6d9c759b86d68d7
Split status: non-matching (1)

Clearly it 'runs' enough to respond to an image list command, but it also doesnt think its matchin. But if I decrease block count and give some more breathing room:

$ newt target show split-microbit
targets/split-microbit
    app=@apache-mynewt-core/apps/blesplit
    bsp=@apache-mynewt-core/hw/bsp/bbc_microbit
    build_profile=optimized
    loader=@apache-mynewt-core/apps/bleprph
    syscfg=BLE_LL_CFG_FEAT_LE_ENCRYPTION=0:BLE_SM_LEGACY=0:BLE_SM_SC=0:LOG_LEVEL=255:MSYS_1_BLOCK_COUNT=18
$ newtmgr -cnimble_blesplit image list
Images:
 slot=0
    version: 0.0.0.1
    bootable: true
    flags: active confirmed
    hash: 9ed01981c27d6aa45003a322ec4091ebcc62173a1a84e79bdbc803e5c1d9a219
 slot=1
    version: 0.0.0.1
    bootable: false
    flags: active
    hash: 3e74b1cd8f2e76629160cfd6f91e9ce6726f4ca289f9c8707718873911a5d148
Split status: matching (2)

Maybe a feature not a bug? Documenting here either way.

Test package lflags ignored by `newt test`

If you add the following to a test package:

pkg.lflags:
- "-foo"
and then test the package with newt test, the flag does not get passed to gcc during linking.

Newt currently only reads lflags from the following package types:

target
app
bsp
compiler
At the very least, the test package's lflags should be used when a unit test is linked via newt test. Alternatively, it may make more sense to gather the lflags from all constituent packages during the link phase.

JSON library's array count not incrementing

Firstly, there is almost no documentation regarding json utilization.

After following the example and documentation of mJSON which is not entirely the same as mynewt's JSON library. I was able to get the code working partially.

Which this code, am getting the following output

000001 Buffer Initiated 000002 JSON Read 0! 000003 PRN = 10, elevation = 45, azimuth = 196 Complete
blinky.zip

Need to have a "SRAM retention" section for code

Need to have linker sections for low power operation, and a function that restores when a system comes out of low power state, along with retained RAM areas, that can do operation and checking, when in super low power states.

nRF52-DK DFU Error

I am trying to follow this tutorial, but I have a bug when trying to do
newtmgr image list -c mybleprph

It returns me:
2018/02/12 10:31:16 Unhandled event: xpc.Dict{"kCBMsgId":4, "kCBMsgArgs":xpc.Dict{"kCBMsgArgState":5}}
And then nothing.

Do you have any idea of where the problem comes from?
I think it is related to the fact that I am on Mac OS High Sierra.

I have found that you are using paypall/gatt like library for DFU over BLE with MacOS/Linux.
While googling the error, I discovered that it is an error that go-ble/ble, and moogle19/ble have fixed here and partially here

Do you know how I can change the library used by newtmgr to connect over ble, or where the sources used by newtmgr library are located?

more than 31 bytes in advertsing and scanning

hello, I am using btshell and trying to send more than 31 bytes but not able to send. it shows invalid mfg_data.. but if I put less than 31 bytes in mfg_data it accepts. is there any alternative way to send more than 31 bytes? is there anything which I am missing?
Thank you in advance

bootloader docs inconsistent

There are two locations in the docs that discuss the nature of the images to be run by the bootloader.

./boot/bootutil/design.txt:    * Build to run from a fixed location (i.e., not position-independent).
./docs/os/modules/bootloader/bootloader.rst:-  Build to run from a fixed location (i.e., position-independent).

I believe that the first one (bootutil/design.txt) is the correct statement (well, at least it's internally self-consistent).

split documentation doesn't build on nrf51dk target, FLASH overflowed

Jacobs-MacBook-Air:charm jacobrosenthal$ newt build split-nrf51dk
...
Linking /Users/jacobrosenthal/Downloads/charm/bin/targets/split-nrf51dk/app/apps/splitty/splitty_tmp.elf
Error: /usr/local/Cellar/gcc-arm-none-eabi-49/20150925/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: /Users/jacobrosenthal/Downloads/charm/bin/targets/split-nrf51dk/app/apps/splitty/splitty_tmp.elf section `.text' will not fit in region `FLASH'
/usr/local/Cellar/gcc-arm-none-eabi-49/20150925/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 13080 bytes
collect2: error: ld returned 1 exit status

Just turning off logging doesnt get us there anymore:

syscfg.vals:
    BLE_LL_CFG_FEAT_LE_ENCRYPTION: "0"
    BLE_SM_LEGACY: "0"
    LOG_LEVEL: 255
Jacobs-MacBook-Air:charm jacobrosenthal$ newt build split-nrf51dk
...
Linking /Users/jacobrosenthal/Downloads/charm/bin/targets/split-nrf51dk/app/apps/splitty/splitty_tmp.elf
Error: /usr/local/Cellar/gcc-arm-none-eabi-49/20150925/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: /Users/jacobrosenthal/Downloads/charm/bin/targets/split-nrf51dk/app/apps/splitty/splitty_tmp.elf section `.text' will not fit in region `FLASH'
/usr/local/Cellar/gcc-arm-none-eabi-49/20150925/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 2896 bytes
collect2: error: ld returned 1 exit status

This is subjective but this got me there anyway

syscfg.vals:
    BLE_LL_CFG_FEAT_LE_ENCRYPTION: "0"
    BLE_SM_LEGACY: "0"
    STATS_NEWTMGR: 0
    LOG_NEWTMGR: 0
    CONFIG_NEWTMGR: 0
    LOG_LEVEL: 255
Jacobs-MacBook-Air:charm jacobrosenthal$ newt size split-nrf51dk
Size of Application Image: app
  FLASH     RAM 
     40   13614 *fill*
    534    1456 apps_splitty.a
     20       0 boot_split_app.a
    196     432 hw_bsp_nrf51dk.a
    118      32 mgmt_newtmgr_transport_nmgr_shell.a
   4864     774 sys_shell.a
     96       0 split-nrf51dk-sysinit-app.a
    480       0 libgcc.a

objsize
   text	   data	    bss	    dec	    hex	filename
   6316	      4	  15904	  22224	   56d0	/Users/jacobrosenthal/Downloads/charm/bin/targets/split-nrf51dk/app/apps/splitty/splitty.elf
Size of Loader Image: loader
  FLASH     RAM 
    257     255 *fill*
     72       0 split-nrf51dk-sysinit-app.a
     88       0 split-nrf51dk-sysinit-loader.a
    881      93 apps_bleprph.a
   1203     104 boot_bootutil.a
    479      26 boot_split.a
   1252       0 crypto_mbedtls.a
    405       0 encoding_base64.a
   1026       0 encoding_cborattr.a
   2118       0 encoding_tinycbor.a
   1780       0 fs_fcb.a
    508     496 hw_bsp_nrf51dk.a
     52       0 hw_cmsis-core.a
   3349     716 hw_drivers_nimble_nrf51.a
    248       0 hw_drivers_uart_uart_hal.a
    338       0 hw_hal.a
   3918      81 hw_mcu_nordic_nrf51xxx.a
   7721    4981 kernel_os.a
   2560      50 libc_baselibc.a
   2097      24 mgmt_imgmgr.a
    200      20 mgmt_mgmt.a
    776     100 mgmt_newtmgr.a
   1320      44 mgmt_newtmgr_nmgr_os.a
    488     106 mgmt_newtmgr_transport_ble.a
  29301    2142 net_nimble_controller.a
  32243    2786 net_nimble_host.a
    662     218 net_nimble_host_services_ans.a
    338     215 net_nimble_host_services_gap.a
    200      62 net_nimble_host_services_gatt.a
   1531     648 net_nimble_host_store_config.a
     86       0 net_nimble_host_util.a
     95       0 net_nimble.a
    668     101 net_nimble_transport_ram.a
   1859     193 sys_config.a
   1941     103 sys_console_full.a
    600     128 sys_flash_map.a
    487     133 sys_id.a
   1130      30 sys_log_full.a
    392      12 sys_mfg.a
    636     140 sys_reboot.a
    270      32 sys_stats_full.a
     30       5 sys_sysinit.a
   1223       0 time_datetime.a
    438       0 util_cbmem.a
    620       0 util_crc.a
    234       0 util_mem.a
   2060       0 libgcc.a

objsize
   text	   data	    bss	    dec	    hex	filename
 110148	    984	  12660	 123792	  1e390	/Users/jacobrosenthal/Downloads/charm/bin/targets/split-nrf51dk/loader/apps/bleprph/bleprph.elf
Jacobs-MacBook-Air:charm jacobrosenthal$ 

Need persistent storage system other than config_*

Config framework is good for... configuration items, however we should have a persistent storage mechanism that allows us to store binary data into FCB. Also, FCB should be able to be shared between config, and this more general persistent storage mechanism.

Persistent storage mechanism should support binary data, and writing + appending to entries.

timezone daylight saving time, int16_t or boolean

It looks like tz_dsttime was originally designed to hold the offset value in seconds, but is used as a boolean.
For bluetooth (current time service), it would be better to use tz_dsttime as a second-offset, as bluetooth can have DST of 0, 30min, 60min, 120min [1]

os_time.h

   struct os_timezone {
       int16_t tz_minuteswest;
       int16_t tz_dsttime;
   };

datetime.c:

 tz->tz_dsttime ? 3600 : 0

[1] https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.dst_offset.xml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.