February 14, 2017 (Final)
February 10, 2017 (Planned)
Enhancement/Fixes to existing features
Newt Tool enhancements
newt run <unittest-pkg>
This allows debug of a package test library. It builds the test executable such that a failed test triggers a failed assert and runs it in gdb. When a test fails, gdb halts at the point of failure.
newt -j <jtag_cmd> load <image_name>
It allows you to pick which JTAG adapter to connect to in situations where you have multiple boards hooked up to your system. Additional parameters can also be passed using the -j flag from newt command line to download/debug scripts.
Note: JLink download/debug scripts do not support this yet.
Example: newt -j "cmsis_dap_serial 00000000AZE000001423" load boot_zero
This chooses the board with that serial number on the USB device while uploading the "boot_zero" image.
newt uses Go exec library to execute external commands correctly
Newt no longer invokes shell (/bin/sh) to execute external commands such as creating directories and copying files. Instead, it now uses the Go exec library to fork and execute child processes.
Specifically, the compiler.yml definitions indicated command line options as a space-delimited sequence of strings in the path settings. For example, the Cortex M4 assembler specified the following path:
This compiler definition has now been changed to the following:
Newt generates priority violation error for incorrect configuration setting overrides
When a setting defined by a package was overridden by a package of the same or lower priority, newt would silently ignore the override. Newt now generates a priority violation error.
NimBLE stack enhancements
NimBLE can now use RTC for OS time tick
Previously, NimBLE used SysTick to provide the OS time tick. The option to use RTC has been introduced for more power efficiency.
BLE host guarantees resources to send failure messages when resources are not sufficient to send affirmative response
Most request handlers reuse the request buffer for the response. This is done to prevent out-of-memory conditions. However, there are two handlers which do not reuse the request buffer:
1. Write request.
2. Indicate request.
Both of these handlers attempt to allocate a new buffer for the response prior to processing the request. If allocation fails, the request is not processed, and the request buffer is reused for the transmission of an "insufficient resources" ATT error response.
NimBLE host API supports a new generic type device address
The public API now uses the "ble_addr_t" (with additional helpers/symbols) type to pass complete device address via API instead of separate type and address value.
AuthReq/KeyDist validation in pairing request/response fixed
The reserved bits in AuthReq and key distribution flags shall be ignored on reception so that non-zero values do not make pairing command invalid. This is to ensure compatibility with future specs.
- Bluetooth Specification 4.2, Vol 3, Part H, Section 3.5.2
- Bluetooth Specification 4.2, Vol 3, Part H, Section 3.6.1
Dedicated type for UUIDs for consistent handling
Dedicated types for UUIDs of different lengths have been introduced instead of using a byte array containing the 128-bit representation for all cases. It makes the handling of UUIDs more efficient because of lower memory requirements to store UUIDs and removal of extra code.
A generic UUID type ("ble_uuid_t") is used only as a pointer to access actual UUID types (16-bit, 32-bit, 128-bit). When registering services using new API, only the UUID pointer is stored for all attributes (there is *no* copy of value made). Also, there is no implicit conversion from 128-bit to 16-bit UUID inside Nimble.
Below are some examples on how to use the new UUID API.
Log index field increased to 32 bits
The index field for log entry has been changed from 16 bits to 32 bits. The index is the only criterion for selecting the start point of the read if a zero value is specified in the "newtmgr logs show" command. The timestamp is still used as the primary key if a nonzero value is specified. At boot time, Mynewt determines the next log index to use by reading the last entry from all persisted logs. Previously, if there was no persisted last entry, a garbage value would be used. This has been fixed now and 0 is used if all logs are empty.
The "logs show" command retrieves all entries whose index is greater than or equal to the specified index value. Prior to this change, the command only retrieved entries whose index is greater. This change was made so that there is a reliable means of getting an entry with an index of 0.
File Allocation Table (FAT) file system support
Mynewt is no longer limited to a single filesystem (FS) and "hardcoded" block device per driver. Support for accessing multiple devices and filesystems has been added. A package has been added that can be conditionally included
The user is required to map a disk to the filesystem it uses as shown below. It adds a name for the disk, what FS is used (FS's are registered when loaded), and what "disk" ops should be used for that named device.
To access a file/dir, the user has to call the registered disk as a prefix as shown below. When only a single FS is used on the project, the disk prefix is optional but the disk register is not.
Note: fatfs_open, nffs_open are still operational and does not require specifying the disk. Backwards compatibility is maintained.
Apache Mynewt has imported the code for lwIP, the lightweight TCP/IP protocol stack and can build images with Inet services and network interfaces defined.
Currently, the mn_socket abstraction can be used to write IP applications. Basic functionality been tested on the simulator and with WINC1500 wifi chip.
OIC 1.1 Support
Mynewt supports the OIC 1.1 core specification which specifies the framework (architecture, interfaces, protocols and services) to enable OCF profiles implementation for Internet of Things (IoT) usages. Mynewt starts with IoTivity-Constrained, a reference implementation of OCF standards for resource-constrained devices and optimizes the code further for both flash and RAM memory usage.
In the OIC framework, devices or entities are exposed as Resources, with their unique identifiers (URIs) and support interfaces that enable RESTful operations (GET / OBSERVE, POST, PUT, DELETE) on the Resources. Every RESTful operation has an initiator of the operation (the client) and a responder to the operation (the server). Mynewt supports both the client and server roles. In a typical scenario, an edge device (e.g. a BLE peripheral device) running Mynewt is an OIC server and the gateway (e.g. the smartphone) is the client.
The framework uses CoAP (RFC 7252) as the primary RESTful messaging protocol since CoAP has UDP binding with reliability and multicast support and built-in discovery. The CBOR (RFC 7049) data format is used to encode the OCF payloads concisely. For security, OIC has DTLS-based authentication, encryption and access control mechanisms required for secure access to the entities.
The sample app "bleprph_oic" included in the Apache Mynewt release shows how to discover and register lighting device over BLE.
- oc_add_device() is used to add a device with the URI "/oic/d", resource type "oic.d.light", and name "MynewtLed"
- app_get_light() to retrieve the status of the LED pin
- app_set_light() to turn on/off the LED pin
Apache Mynewt also exposes /mgmt/oicmgr as an OIC server resource to allow Mynewt devices to receive and respond to "newtmgr" protocol commands encapsulated in CoAP. This essentially provides a mapping of Mynewt's system management APIs into the OIC protocol.
- The URI is "/omgr" and the resource type "x.mynewt.nmgr"
- omgr_oic_get() for newtmgr commands that retreive information from your application, for example, the
- omgr_oic_put() for newtmgr commands that send data to or modify the state of your application, for example, the
Apache Mynewt includes handlers for all four types of operations - CREATE, DELETE, PUT, and GET. Hence, all the OCF standard interfaces defined in Section 22.214.171.124 of the Core Specifications can be defined. The "baseline" and "read-write" interfaces have been defined and used in examples. The "baseline" interface provides a view into all Properties of a Resource including the Meta Properties and the "read-write" interface exposes only those Properties that may be both ‘read’ and “written”.
New board support
Support has been added for the following boards:
- nRF52840 pdk
Known Issues and Limitations
Connection oriented channels in BLE 4.2
Support for Connection-Oriented Channels (including Dedicated Channels) in the Logical Link Control and Adaptation Protocol (L2CAP) is yet to be added. This feature is a prerequisite for supporting the IP Support Profile which can turn devices into IPv6 nodes that can consume or originate IPv6 packets and be discovered by IPv6 routers.
HAL support for nRF52840 is not complete
While basic support for the board and peripherals has been added for this board including the NimBLE stack, the HAL interfaces are still underway.
Single newtmgr reset causes two reboot log entries
The first log entry gets written during processing of the incoming reset command. The second entry gets written at init time during the subsequent reboot.
newtmgr hangs after reset command
Even though the reset after image confirm is successful, newtmgr hangs forever.
Full support for TCP/IP
The following is planned but yet to be added:
- ethernet driver(s) which can be included as packages like our other drivers
- sample app(s) utilizing the above driver(s). One of the sample apps is likely to use the winc1500_wifi app in arduino-zero repository which uses sockets and allows you to start the default inet services. A second sample app that runs OIC over IPv6 is also planned.
- locking to lwip socket adaptation
- abstraction for DNS
- updated documentation
Newt does not limit the size of loader image in case of split images
Start event for cooperative packages sometimes fails to get executed
A cooperative package which uses the default event queue may never get an opportunity to enqueue their start event because the default queue may not be designated when the package is initialized. In such cases, the package's start event fails to get kicked off before OS start.
nrf52 ADC will not work if VDD4 reference is used
bootloader with serial upload is larger than 16K
Currently the bootloader cannot fit into a 16K slot. The code will be optimized for this constraint.
NFFS cannot delete a file or directory when completely full
Deleting a file or directory requires writing an inode to the disk. If the disk is completely full, there is not room for the deletion record, and the delete attempt fails with an FS_EFULL error.