Add _i2c_map_dt_bitrate() that maps from a bitrate to the I2C zephyr
cfg bit fields used in i2c_configure().
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Clarify that the clock-frequency is the bitrate at boot and introduce
defines that .dts files can use to set the clock-frequency.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Added a define to use in code that provides the amount we need to shift
the speed settings in the i2c config params.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Older value of 256 was introduced in 1.7 times. Testing on
BOARD=96b_carbon with 2 weeks old codebase however showed that TX
thread stack however can grow to 324 bytes. Finally, with the
latest master, following stacks are reported on BLE disconnect
(with CONFIG_INIT_STACKS enabled):
rx stack (real size 1024): unused 452 usage 572 / 1024 (55 %)
tx stack (real size 384): unused 16 usage 368 / 384 (95 %)
Two outcomes:
1. TX stack needs increase.
2. Over time, the stack usage grows, plus variations in SPI
drivers should also be taken into account.
So, increase the stack size to 416 bytes, to leave some headroom
beyond the immediate values seen on 96b_carbon.
Jira: ZEP-2510
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Currently, the HTTP_NETWORK_TIMEOUT setting is hard-coded as 20 seconds.
Not every application may want to wait that long, so let's change this
to a CONFIG option: CONFIG_HTTP_CLIENT_NETWORK_TIMEOUT
NOTE: This also removes HTTP_NETWORK_TIMEOUT from the public http.h
include file. It was not being used externally to HTTP client sources.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Partial implementation of the IEEE 1003.1 pthread API, including
mutexes and condition variables in their default behaviors, and
pthread barrier objects. The rwlock and spinlocks abstractions are
not supported in this commit (both only make sense in the presence of
multiple SMP processors).
Note that this is the IPC mechanisms only. The thread creation API
itself is unsupported: Zephyr threads work differently from pthreads
and don't port cleanly in all cases. Likewise the "_INITIALIZER"
macros from pthreads don't work cleanly here, and _DECLARE macros have
been provided to statically initialize pthread primitives in a manner
more native to Zephyr
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Add cross-referenced information on the 96b_carbon and
96b_carbon_nrf51 pages which disambiguates between the two "boards".
Also describe how to flash 96b_carbon_nrf51 with
samples/bluetooth/hci_spi and 96b_carbon with samples/bluetooth/ipsp
to support a Bluetooth HCI stack on 96Boards Carbon (the physical
board).
While we're here, make the documentation page for 96b_carbon match the
format in doc/templates/board.tmpl.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Various of the printk messages in this sample app don't have
newlines. Let's fix the output by moving to SYS_LOG_xxx() macros
instead, which don't need them anyway. This also makes it easier to
tell errors apart from other messages, etc.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
On 96Boards Carbon, Bluetooth is provided by a secondary nRF51 chip
connected to SPI_1, so enable this peripheral and its driver when BT
is selected.
Similarly, provide BT_SPI_* configs to integrate with the BT HCI SPI
driver. The files these config values apply to only get built when
CONFIG_BT=y, but this configuration can't be handled in the "if BT"
section in 96b_carbon's Kconfig.defconfig. This is because BT_SPI is
a choice value, and thus doesn't support a default setting.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Some targets (e.g. STM32-based boards) only have SPI drivers using the
new API. To support both these and existing, legacy SPI drivers in the
SPI HCI driver, abstract out the SPI API into shim routines.
There are no behavioral differences due to this patch. The next patch
will add support for the new API.
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Add a sample application that allows a Zephyr-based Bluetooth
controller to interface with an HCI driver via SPI. This sample
implements the same BT SPI protocol already as Zephyr's HCI SPI
driver.
Currently, the sample only supports the legacy SPI API.
Provide a single configuration file, avoiding board-specific
files. Some board-specific configuration information must be provided
via other means:
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_PIN
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Since Extended Scanner Filter Policies is an independent feature from
Controller-based Privacy, split it out so it can be built independently
and included without it.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
A TCP FIN message is passed on to user apps as a tcp_received_callback
with a NULL pkt parameter. This means the connection is closing and
the app should do whatever cleanup it needs as there will be no further
callbacks for the current TCP connection.
Currently, if a HTTP client request doesn't receive a "body" which
the HTTP parser can use to trigger on_message_complete, then the request
will end up timing out and most apps will think an error has occurred.
Instead, let's handle the TCP FIN message and return the waiting
semaphore, leaving the app to deal with whatever has been set in the
current HTTP context response data (IE: http_status).
This fixes using HTTP client to send POST data to servers which
only respond with HTTP_OK status and no body.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Unless offset was specified, it should default to 0, whereas
previously, value from the last command was used.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Per ZEP-1958, Phase 2 of adding CC3220sf LaunchXL support,
was to "deprecate the CC3200 launchxl support in Zephyr
(redundant to the CC3220)."
Effectively, the CC3220 SOC replaces the CC3200.
This patch removes the following:
* the imported CC3200 SDK
* CC3200 SOC, board, DTS files.
* adjusts other files where cc3200 was mentioned.
Also, it fixes explicit references to CC3200 in generic
CC32xx driver files.
Jira: ZEP-1958
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
Since Advertising Extensions are not supported yet by Zephyr, clarify
the extend of Bluetooth 5.0 support in the subsystem.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
"Network Application Support" itself is renamed from "Network
Applications" and also includes net_app API.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This adds a test that attempts to submit a work with 0 timeout thus
causing it to immediatelly be submitted to the queue so it is pending
execution which is then cancelled with k_delayed_work_cancel.
Note this can only be done with coop threads with the same or higher
priority otherwise the work_q thread is wakeup before
k_delayed_work_cancel takes place, thus why test_delayed_cancel uses
K_HIGHEST_THREAD_PRIO.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This has been a limitation caused by k_fifo which could only remove
items from the beggining, but with the change to use k_queue in
k_work_q it is now possible to remove items from any position with
use of k_queue_remove.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes use of POLL_EVENT in case k_poll is enabled which is
preferable over wait_q as that allows objects to be removed for the
data_q at any time.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
- .text, .text.*, .literal, .literal.* had no matching input section
rule and were being passed to the output binary verbatim. These
are all now in the output "text" section as intended.
- various rules in the data section were unnecessarily using KEEP().
- SW_ISR_TABLE wasn't included in linker script anywhere and was
ending up in its own section, and not the data section as intended.
- noinit section didn't exist at all, now defined.
Issue: ZEP-2508
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Whenever privacy is enabled, we support the Extended Scan Filter
Policies functionality, and therefore we must show it in the bitfield of
LE supported features for the controller.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
make this consistent with flash size check. This issue caused platforms
with 8k to be completelty ignored.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Check if any board files have changed and build more tests with this
board to uncover any build regressions.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When retrying sanitycheck with --only-failed, do not use --subset
argument which can reduce the number of tests to be run (failed tests)
to 0.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
ll_radio_state_is_idle() returns bool, not an error value - this means
it is non-zero on success.
Jira: ZEP-2445
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>