When the device driver model got introduced, there were no concept of
SYS_INIT() which can be seen as software service. These were introduced
afterwards and reusing the device infrastructure for simplicity.
However, it meant to allocate a bit too much for something that only
required an initialization function to be called at right time.
Thus refactoring the devices structures relevantly:
- introducing struct init_entry which is a generic init end-point
- struct deviceconfig is removed and struct device owns everything now.
- SYS_INIT() generates only a struct init_entry via calling
INIT_ENTRY_DEFINE()
- DEVICE_AND_API_INIT() generates a struct device and calls
INIT_ENTRY_DEFINE()
- init objects sections are in ROM
- device objects sections are in RAM (but will end up in ROM once they
will be 'constified')
It also generate a tiny memory gain on both ROM and RAM, which is nice.
Perhaps kernel/device.c could be renamed to something more relevant.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
By this commit USB audio class implementation is introduced
to Zephyr.
The Zephyr USB audio device class follows bellow
documentations:
- Universal Serial Bus specification rev2.0 (usb20.pdf)
- Universal Serial Bus Device Class Definition for Audio Devices
(audio10.pdf)
- Universal Serial Bus Device Class Definition for Audio Data Formats
(frmts10.pdf)
- Universal Serial Bus Device Class Definition for Terminal Types
(termt10.pdf)
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This commit adds support for receiveing data from ISO OUT endpoint
for NRF devices. NRF USB IP core does not generate IRQ when
data are received on ISO OUT endpoint and it must be synchronized
with SOF event.
Enable SOF handling by default if usb audio is configured
with NRF devices.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This commit adds support for bluetooth in nRF52820 SoC.
Bluetooth radio related files created and added to Zephyr.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
Print detailed information about a given net_pkt. This is
useful if there is a memory leak and you want to see more
detailed information about the data inside the buffer.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit renames the Kconfig `FP_SHARING` symbol to `FPU_SHARING`,
since this symbol specifically refers to the hardware FPU sharing
support by means of FPU context preservation, and the "FP" prefix is
not fully descriptive of that; leaving room for ambiguity.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Add program download (firmware update) support according to the CAN in
Automation (CiA) 302-3 draft standard proposal v4.1.0.
The implementation supports a Zephyr specific vendor command allowing
external confirmation of a newly booted firmware image. If this is not
desired, the application can confirm the image by other means.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add a disk access driver for the stm32 sdmmc component. The driver is
based around the stm32 cube HAL and uses the blocking API.
Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
Added support for Qemu User Networking and tested with
qemu_x86 model. The support is kept simple assuming that
the TAP interface will always be preferred for more
sophisticated / practical use cases.
QEMU User Networking is implemented using "slirp", which
provides a full TCP/IP stack within QEMU and uses that
stack to implement a virtual NAT'd network. As this
support is built into QEMU, it can be used with any model
and requires no admin privileges on the host machine,
unlike TAP.
Added documentation to facilitate the user.
Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
The LLDP packet was created but its type was not set to LLDP
and was sent as ARP message.
Fixes#25084
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add OpenThread configuration option, which allows to configure and start
OpenThread stack operation manually. This mode should be used in NCP
devices, as well as is needed for certification purposes, where
OpenTread stack have to be configured by the test framework and not
initialize and join the network on its own.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The testsuite was always forcing minimal logging. This is problematic
as it does not allow user to see full logging string. Allow user to
override the minimal logging if needed, the default is still to
enable minimal logging.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Added special flag that can be used to indicate that optional
arguments are passed without any parsing (e.g. quotation marks
removal). Modified execute command to parse command line buffer
argument by argument.
After this change it is possible to forward whole command to
command handler (using select).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
If a ztest test case creates child thread(s), and one of the
descendent threads invokes ztest_test_pass(), ztest_test_fail(),
or ztest_thread_skip(), only that descendent thread will be
aborted.
Then ztest will try to run the next scenario on the ztest_thread
which is already in use. This was causing corruption issues on
SMP systems, and possibly other subtle, hard-to-debug
situations.
This patch ensures that ztest_thread is always dead before
re-using it, as run_test() now attempts to join on it instead
of using a semaphore.
The ztest_test_* functions now ensure that the ztest_thread
is always aborted, in addition to the current thread.
This isn't perfect. If the testcase spawned other threads,
they will keep running. The most robust way to fix this is to
iterate over all non-essential threads in the system and abort
them. Unfortunately, Zephyr doesn't have a facility to do
this safely.
It would also be simpler to re-use thread objects if
k_thread_create() could detect whether the thread was already
active and abort it, but this is currently not possible
since k_thread_create() can be used with uninitialzed
thread object memory and no checks are possible. This
may be improved in the future, see #23030.
Fixes: #22738
Partial fix for: #24713
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
When using extended advertising the connection can be established on
different PHY. In order to have an updated value of the current PHY
we need to read the PHY of the connection in the connection complete
event.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add application control of initiating phy change procedure and it's
parameters.
The reasons for allowing the application control over the PHY:
- Allow changing to Coded PHY.
- Application may change PHY to react to changes in environment
to balance throughput and range.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add application control of initiating data length procedure and it's
parameters.
The reasons for allowing the application control over the data length:
- Bandwidth control adjusted based on number of active connections.
- Changing data length before switching to coded phy.
- Applying workarounds for interoperability problems.
- Controlling order of ATT MTU and data length procedures.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add Kconfig option so that the application can disable automatic
initiation of the data length procedure. This is symmetric with the
PHY auto initiation kconfig option.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Refactor setting the maximum data length parameters supported on in
auto data length procedure. This makes setting the data length of the
connection a re-usable function.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
With BT_CTLR_USER_TICKER_ID_RANGE it is possible for vendors to add a
number of ticker nodes for proprietary purposes. The feature depends on
BT_CTLR_USER_EXT.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Frame format was validated, but its length should be also validated
relevantly against the format.
Fixes#24970
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit introduces dedicated return type for custom_handler.
Relevant code is updated to fulfill the API documentation.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
This exception allows USB Audio Class to properly respond to the
interface requests.
This commit is temporary solution and shall not be considered as
valid solution for other classes.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Code using this API to set a key to a value that is a string literal
produces errors in C++ because the passed pointer is not const
qualified, allowing the possibility that the callee modifies the
referenced string literal memory. Add the required const qualifiers
since the set function does not change the passed to it.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
At present it is not possible to write a printf()-like function in
board code which outputs to the shell. Add shell_vfprintf() to permit
this.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is useful to run tests which generate shell output and check that it
is correct. Update the existing 'dummy' backend to support this.
It works by retaining the output in a small buffer so that it can be
read and checked by the test.
Signed-off-by: Simon Glass <sjg@chromium.org>
The numbers should have been the sum of HCI commands count and ACL TX
buffers but instead the buffer size was used which makes the pool holds
substatially more buffer than necessary.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add control over the use name option to advertise shell parameters as
an optional argument.
The argument count for extended advertise parameters had not been
updated for the maximum directed advertise parameter count.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Implement the BT_LE_ADV_OPT_USE_NAME when using bt_le_ext_adv_* APIs
to start the advertiser.
When starting an extended connectable advertiser the name must be
included in the advertising data, since scan response data is
not allowed in this configuration.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Remove setting state flags in bt_le_adv_start_ext since they are set
by le_ext_adv_param_set, except for BT_ADV_PERSIST flag.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Only persist advertising when the bt_le_adv_start API is used to start
the advertiser. For multiple advertising set a connectable advertiser
can only be started if there is a connection object available for the
advertiser. Leave the decision on which advertising set should be
advertising up to the application instead of suspending advertising
when no connection object is available.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear. As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Flash drivers may impose alignment requirements on the destination
buffers due to use of DMA transfers. In particular Nordic QSPI flash
API requires that addresses, sizes, and buffers all be 4-byte aligned.
Align the ready/copy buffer to satisfy this requirement.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Flash drivers may impose alignment requirements on the destination
buffers due to use of DMA transfers. In particular Nordic QSPI flash
API requires that addresses, sizes, and buffers all by 4-byte aligned.
Align the page buffer to satisfy this requirement.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>