commit | bce78ce39bcc18af23d356fbff185e7a989d62f9 | [log] [tgz] |
---|---|---|
author | Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl> | Thu Sep 07 14:55:31 2017 +0200 |
committer | Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl> | Thu Sep 07 21:09:28 2017 +0200 |
tree | a12da69af0214fdf8c102f8032c1894422c2024f | |
parent | 22295dd446c85162035f9f9cdb9e6251a12b5dd0 [diff] |
nimble/ll: Increase stack for ble_ll_task Default stack size for ble_ll_task is too low. Failing scenario can be reproduced using optimized bleprph build for nRF51 (M0). We have following call stack: os_eventq_put() at os_eventq.c:99 0x8d7e ble_hs_enqueue_hci_event() at ble_hs.c:431 0x14204 ble_hs_hci_rx_evt() at ble_hs_hci.c:357 0x14d4a ble_hci_trans_ll_evt_tx() at ble_hci_ram.c:95 0x1b860 ble_ll_hci_event_send() at ble_ll_hci.c:79 0xec90 ble_ll_conn_comp_event_send() at ble_ll_conn_hci.c:250 0xd6a2 ble_ll_adv_send_conn_comp_ev() at ble_ll_adv.c:2,849 0xb490 ble_ll_conn_created() at ble_ll_conn.c:2,511 0xc0e4 ble_ll_conn_slave_start() at ble_ll_conn.c:4,076 0xd2e6 ble_ll_adv_conn_req_rxd() at ble_ll_adv.c:2,341 0xb3f0 ble_ll_adv_rx_pkt_in() at ble_ll_adv.c:2,456 0xb3f0 ble_ll_rx_pkt_in() at ble_ll.c:720 0xa43a ble_ll_event_rx_pkt() at ble_ll.c:982 0xa43a os_eventq_run() at os_eventq.c:178 0x8e38 ble_ll_task() at ble_ll.c:1,025 0xa2ae 0x0 The os_eventq_put() causes a context switch (interrupt) and registers put on stack overwrite memory outside stack - we're 4 bytes (a single register) off here. The overwritten memory is a g_dev_addr so our address changes unexpectedly after successful connection. This works fine on debug build and on nRF52 due to differents stack usage. For example, on optimized build for M0, gcc aligns uint8_t on stack for faster access thus increases its usage if there are local uint8_t variables in function (like in ble_ll_conn_comp_event_send). This patch increases stack size by 10 elements (40 bytes) to have some free space left in case something extra pops up.
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:
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:
For more information on the Mynewt OS, please visit our website here. If you'd like to get started, visit the Quick Start Guide.
Mynewt is being actively developed. Some of the features we're currently working on:
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. 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.
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:
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.
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.
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 dev@mynewt.apache.org.
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/.
Bugs can be filed on the Apache Mynewt Bug Tracker.
Where possible, please include a self-contained reproduction case!
Feature requests should also be filed on the Apache Mynewt Bug Tracker. Please introduce it as a ticket type “Wish.”
We love getting newt tests! Apache Mynewt is a huge undertaking, and improving code coverage is a win for every Apache Mynewt user.
Contributing to documentation (in addition to writing tests), is a great way to get involved with the Apache Mynewt project.
Pull requests to the apache-mynewt-site repository on Github are the best way to submit documentation. For more information on contributing to the documentation, the FAQ has some more information.
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.
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.