Add support for SoF events to the USB SAM device driver. When
CONFIG_USB_DEVICE_SOF is enabled, enable the corresponding interrupt
and call the callback function from there.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reel Board doesn't enable BT by default like many of the nRF52
boards do. So let's make enabling BT a bit easier, by selecting
the BT_CTLR config when BT is enabled. This allows a sample
overlay to merely set:
CONFIG_BT=y
And the end result should be close to correct.
Signed-off-by: Michael Scott <mike@foundries.io>
The nRF51822 and nRF52832 does not support 802.15.4, so remove this
statement from documentation.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
When running sanitycheck for reel_board which selects
CONFIG_NRFX_TWIM it fails the following tests:
tests/misc/test_build/test_newlib
tests/kernel/errno/kernel.common.errno.newlib
tests/lib/mem_alloc/libraries.libc.newlib
/zephyr/drivers/i2c/i2c_nrfx_twim.c:144:3: error: expected declaration
specifiers or '...' before '(' token
(bitrate == I2C_BITRATE_STANDARD ? NRF_TWIM_FREQ_100K \
^
/zephyr/drivers/i2c/i2c_nrfx_twim.c:151:3: note: in expansion of macro
'I2C_NRFX_TWIM_FREQUENCY'
I2C_NRFX_TWIM_FREQUENCY( \
^~~~~~~~~~~~~~~~~~~~~~~
/zephyr/drivers/i2c/i2c_nrfx_twim.c:184:1: note: in expansion of macro
'I2C_NRFX_TWIM_DEVICE'
I2C_NRFX_TWIM_DEVICE(0);
^~~~~~~~~~~~~~~~~~~~
/zephyr/drivers/i2c/i2c_nrfx_twim.c:154:3: error: expected declaration
specifiers or '...' before string constant
"Wrong I2C " #idx " frequency setting in dts"); \
^
/zephyr/drivers/i2c/i2c_nrfx_twim.c:184:1: note: in expansion of macro
'I2C_NRFX_TWIM_DEVICE'
I2C_NRFX_TWIM_DEVICE(0);
^~~~~~~~~~~~~~~~~~~~
zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/build.make:62: recipe
for target
'zephyr/drivers/i2c/CMakeFiles/drivers__i2c.dir/i2c_nrfx_twim.c.obj'
failed
To fix this, let's replace the use of static_assert() with a more
generic macro: BUILD_ASSERT_MSG() This should work across minimal
libc, newlibc and c++.
Signed-off-by: Michael Scott <mike@foundries.io>
Such sent flag is in a union in net_pkt, shared with a gptp flag.
Tweaking it when the family is not AF_INET or AF_INET6 will generate
corrupted gptp packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Instead of redoing what Ethernet L2 already does, let just create the
gptp message without any Ethenet header. Which one will be done as
sending phase by Ethernet L2 relevantly.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Like ARP, GPTP works on top of Ethernet but is considered as a layer 2
protocol, so we cannot set an AF_* family type. Instead let's have a bit
telling that current packet is a gptp message (family has to be
AF_UNSPEC).
The bit is unionized with a TCP related bit: TCP cannot be present on an
AF_UNSPEC packet so there will not be any collision.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Many tests use either Ethernet or Dummy L2 and as such require
modifications towards the driver API on their fake devices.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
As for Ethernet, up to ieee802154 L2's send to actually sent the packet.
It's currently unoptimized as 6lo compression, 15.4 fragmentation and so
on will reallocate net_buf etc... but it's the first step towards
removing ll reserve space and more.
Applying changes to Openthread L2 as well.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now instead of such path:
net_if_send_data -> L2's send -> net_if tx_queue -> net_if_tx -> driver
net_if's send
It will be:
net_if_send_data -> net_if tx_queue -> net_if_tx -> L2's send -> driver
net_if's send
Only Ethernet is adapted, but 15.4 and bt will follow up.
All Ethernet drivers are made compatible with that new scheme also.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Now that sending is done at last time, in one pass, no need to go
through net_if_send_data here.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Currently, first part is done in L2's send, then the next one in
ethernet device driver net_if send function. That last one was already
moved to a L2 based implementation. Let's just move forward and place
the whole logic of the L2's send in that second function.
This is the first step, ethernet centric only, to move towards a
one-pass sending logic in net stack. In future, net_if's send will
disappear.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Current code generating Ethernet header is scattered all over the place,
sometimes in functions that are supposed to check something (and not
filling the header). Not to say about innefficiency.
Src ll address does not need to be set in L2 as net_if.c handles that
already.
Broadcast dst ll address is the same in ipv4 or ipv6, thus factorizing.
In each case, multicast is filled in only at the relevant place.
This is the first step towards changing L2 sending logic, when L2 send
API function will be the only point of sending. The redirection from
driver to L2 again (which finally uses the right device API function to
send) it a temporary hack.
This simplifies the code but will also enable using statically
allocated net_buf and ethernet header payload buffer afterwards.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is currently unoptimized, as all frags are allocated with relevant
ll reserve for such header space. However, this is the first step
towards getting rid of that ll reserve concept everywhere.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Remove adhoc handling of BLE connection setup, rely on net_config for
that. Remove board-specific configs, instead have prt.conf and overlay
configs. Perform TLS setup once before main loop, to avoid errors.
Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
Change adds CPU stats module for tracing hooks. Module provides
information about percent of CPU usage based on tracing hooks
for threads switching in and out, interrupts enters and exits.
cpu_stats only distinguishes between idle thread, non idle
thread and scheduler.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Removed kconfig option for setting logging thread priority
and fix it to K_LOWEST_APPLICATION_THREAD_PRIO.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Helper macro, MPU_ALIGN() is used by script
gen_app_partitions.py, so the macro needs to be available,
if the APP Shared memory feature is to be used. This commit
defines MPU_ALIGN() in the ARC linker.ld script.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The sensor signal cannot be cleared by the application, so enabling
level triggers causes the system to hang as the callback is invoked
repeatedly. We want notification when the alarm state is entered, and
when it's exited, so use a double edge.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
To be properly layered.
This call is used to signal to user an input buffer overload. Take
a chance to output just a single character in this case, to avoid
amplification and possible output buffer overflow either.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This patch proceeds with the separation of older serial console
subsystem into device-independent console subsytem and buffered
serial device ("tty") API.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The macro RB_FOR_EACH_CONTAINER has a loop where the condition to stop
is whether the node is null or not. Explicitly checking it.
MISRA-C rule 14.4
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The function that checks if an object is valid is essentially a boolean
function. Just changing its return type to reflect it.
MISRA-C rule 14.4
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The builtin_*_overflow functions when available return a
boolean. Change internal definitions to return same type.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Description is improved, guidelines for when increase is required are
provided, together with associated overheads information.
Fixes: #11007
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Don't say that pool is empty, say that allocation failed, because
that's what happened (because the pool is full apparently).
Partially addresses #11007.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>