Commit graph

45420 commits

Author SHA1 Message Date
Simon Glass e43c181934 emul: spi: emul_bmi160: Move logging to access functions
Move the logging for transactions to the functions that actually access
registers and sample data. This avoids needed to repeat this code when
I2C starts calling these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass c953c32cbd emul: spi: emul_bmi160: Rename 'spi' to 'bus'
Update the language to refer to a bus instead of SPI. This will make it
more applicable with I2C support is added.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 1f1f695ae2 drivers: sensor: bmi160: Rename 'spi' to 'bus'
This member holds the SPI bus pointer. Change its name to make that
more obvious and so that it can be used for an I2C bus also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 28f8ddae0b drivers: sensor: bmi160: Use only one read/write function
At present there are three separate read functions and two write
functions. This makes it harder to provide an interface that can work
with either SPI or I2C.

Use bmi160_read() for all reads and create a new bmi160_write()
function for all writes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 226cacbc3d drivers: sensor: bmi160: Move SPI config to config
At present this driver only supports a single instance. It sets up some
of its config in the init routine. It is better to put config in
constant data so that multiple instances can be supported and RAM space
is minimised.

Update the driver accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass 57fdcd4018 drivers: sensor: bmi160: Use 'data' for the data pointer
Currently a 'bmi160' pointer is used to point to the driver data. This
confusing, as the driver uses both data and config. Rename the variable
to 'data' like the bme280 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass a32f87b1e0 drivers: sensor: bmi160: Define accessors for the bmi160
Add inline functions to obtain the data and configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Simon Glass c3823b9144 drivers: sensor: bmi160: Shorten the structs a bit
This driver uses verbose names for the config and data structures, which
makes it harder to see which one we are talking about. Shorten it, like
the bme280 driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-27 16:41:30 +01:00
Torsten Rasmussen ad78766139 cmake: dts: getting realpath for system includes for dts.
Fixes: #28893

Now using get_filename_component(REALPATH) to ensure full path with
symlinks and `..` resolved.

Having `..` in path causes the gcc generated dependency file to contain
`\` in path on windows. This confuses ninja.
The result is that ninja consider the file missing, and thus invokes a
CMake run to create the file, resulting in endless loop.

By ensuring that full path (containing `/` which is already ensured)
when calling gcc, then all paths will be posix style, making ninja
happy.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-10-27 16:40:19 +01:00
YouhuaX Zhu 70b3e55bd9 Test: Refine annotaion and test code for sensor subsys.
1. Add more detail info to make the purpose and process
of the test cases more clear which include test goal,
test step, input, judging criteria, constraints, etc.,
and these can be seen in our Zephyr documentations.
2. Add some negative test code.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-10-27 10:43:59 -04:00
Marcin Niestroj 5fa69327f2 drivers: modem: ublox-sara-r4: allocate in modem_cmd_handler with K_NO_WAIT
All net_bufs allocated to modem_cmd_handler's data->rx_buf are consumed
synchronously in ublox-sara-r4.c in the same thread. This means that
allocating them with timeout makes no sense, because timeout
will *always* be hit when there are no more buffers in net_buf_pool.

Get rid of the unnecessary timeout, as it doesn't help and just slows
down processing of incoming data, increasing possibility of data
overrun.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:32:51 -05:00
Marcin Niestroj 94caa8f2fd drivers: modem: gsm: allocate in modem_cmd_handler with K_NO_WAIT
All net_bufs allocated to modem_cmd_handler's data->rx_buf are consumed
synchronously in gsm_ppp.c in the same thread. This means that
allocating them with timeout makes no sense, because timeout
will *always* be hit when there are no more buffers in net_buf_pool.

Get rid of the unnecessary timeout, as it doesn't help and just slows
down processing of incoming data, increasing possibility of data
overrun.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:32:51 -05:00
Marcin Niestroj b3272f3fe8 drivers: wifi: esp: allocate in modem_cmd_handler with K_NO_WAIT
All net_bufs allocated to modem_cmd_handler's data->rx_buf are consumed
synchronously in esp.c in the same thread. This means that allocating
them with timeout makes no sense, because timeout will *always* be hit
when there are no more buffers in net_buf_pool.

Get rid of the unnecessary timeout, as it doesn't help and just slows
down processing of incoming data, increasing possibility of data
overrun.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:32:51 -05:00
Marcin Niestroj 318cbe649a drivers: modem: cmd_handler: rework reading from interface
So far a dedicated buffer was used for data read from modem
interface. New net_bufs were allocated and filled later, which means
that data was lost when no more net_bufs were available in the pool.

Prevent data loss by allocating net_buf before attempting any read on
modem interface. Process incoming data in a loop as long as reading from
interface results in new data. Also remove dedicated buffer
(data->read_buf) and directly fill net_buf content instead. As a side
effect there are less memory copy operations and RAM usage is reduced.

Pre-allocated net_buf is now always appended to data->rx_buf. When there
was no (more) data read from interface to such net_buf, then this empty
net_buf will be on the end of data->rx_buf fragment list. Update
skipcrlf() and findcrlf() implementations to explicitly check for each
net_buf length, instead of blindly assuming them to have at least single
byte.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:24:38 -05:00
Marcin Niestroj 3d659a35bb drivers: modem: cmd_handler: split cmd_handler_process() implementation
cmd_handler_process() does two major things:

 - reads data from modem interface and fills data->rx_buf,
 - processes data in data->rx_buf.

Split implementation accordingly to two separate functions, which
improves readability (less automatic variables to follow at once) and
simplifies refactoring of each action.

No functional change was intended in this commit.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-27 09:24:38 -05:00
Ying ming 783155ad99 test: atomic operation : add code description
The existing testcase's doxygen describes are the general
implementation idea of a function.On this basis, adding
more descriptive statements to describe which conditions need
to be preset when running the testcase, which test techniques
are applied, and describe the testcase Design steps in detail.
Make it more readable.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-10-27 09:14:08 -04:00
YouhuaX Zhu f83041f2e8 Test: Refine annotaion and testcase for poll.
1. Add more detail info to make the purpose and process
of the test cases more clear which include test goal,
test step, input, judging criteria, constraints, etc.,
and these can be seen in our Zephyr documentations.
2. Add some negative test code.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-10-27 09:06:35 -04:00
YouhuaX Zhu 4772d40d5f Test: Refine annotaion and testcase for pipe.
1. Add more detail info to make the purpose and process
of the test cases more clear which include test goal,
test step, input, judging criteria, constraints, etc.,
and these can be seen in our Zephyr documentations.
2. Add more negative testcase.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-10-27 09:05:47 -04:00
Kumar Gala 8a8d38e054 dts: bindings: Fix duplicate description in STM32 DMA bindings
The DMA bindings had duplicate description: keys.  Merge the two
descriptions into one to fix the issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-27 07:56:20 -05:00
Meng xianglin 91dea98c5e test: power: run test case on more platforms
remove "platform_allow" to enable test case run on more platforms,
only a few archs and platforms are excluded.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2020-10-27 08:41:34 -04:00
Fabio Utzig ab9602d401 doc: allow macro resolving in \deprecated usage
Breathe>=4.23.0 renders \xrefitem, including its specializations like
\deprecated, so add the proper `()` to symbols existing in previously
declared \deprecated messages so they are properly resolved.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-10-27 13:09:24 +01:00
Fabio Utzig c8dfc3de3c doc: remove anon union/struct from known issues
Previous Breathe versions had issues parsing anonymous unions/structs
which was fixed recently, so those can be removed from .known-issues.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-10-27 13:09:24 +01:00
Fabio Utzig 8cd7ed1980 doc: bump breathe requirement to >=4.23.0
Breathe>=4.23.0 brings in basic xrefitem rendering support and fixes
issues parsing anonymous struct/unions. This version also adds a config
knob for showing or hiding enumerator values, so set it to generate
documentation compatible with previous versions.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-10-27 13:09:24 +01:00
Torsten Rasmussen 90f56dbabf cmake: extend target_ld_options() to support grouping of flags
Fixes #28456

This commit extends `target_ld_options()` with a NO_SPLIT flag.

Specifying `NO_SPLIT` will ensure that all linker flags will be applied
together when testing the compiler and linker.
This allows a caller to ensure that flags are tested together.

This fixes the RISC-V case where the flags `-mabi` and `-march` were
omitted because they were tested individually.

Note, the update of `target_ld_options()` will allow the same flag on
`zephyr_ld_options()`

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-10-27 13:09:02 +01:00
Andrzej Puzdrowski 5bac6234aa changelog: MCUBoot changes
Added changelog for changes introduced by
latest MCUBoot upgrade.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:41 +01:00
Andrzej Puzdrowski 67be2ea0fc manifest: synch MCUBoot to upstream c625da4
MCUBoot was synchronized up to:
https://github.com/JuulLabs-OSS/mcuboot/commit/c625da4

- Removed the flash_area_read_is_empty() port implementation
function
- Added watchdog feed on nRF dvices.
See CONFIG BOOT_WATCHDOG_FEED option.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:41 +01:00
Andrzej Puzdrowski 508c0356ab doc/reference/peripherals/flash: extract internal API doc
Divided doxygen API documentation into zephyr-internal API and
user API.
This make sense as user shall not use zephyr-internal API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:07 +01:00
Andrzej Puzdrowski 0b50839c7d doc/reference: Added clarification on flash offset relation
Added information about that offsets are expressed in relation to
the flash memory beginning address.

This info was missing which cause misunderstanding of the concept
while contributing.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-27 12:52:07 +01:00
Viktor Sjölind 1b3abc096c net: lwm2m: Start notify sequence numbers on 0
Some LWM2M backends/servers, such as emxq, expect the sequence numbers
to begin on 0.

This change is in line with how other lwm2m clients, such as Anjay and
Wakama, starts the notification sequence.

Signed-off-by: Viktor Sjölind <viktor.sjolind@endian.se>
2020-10-27 11:25:22 +02:00
Maciej Perkowski 060e00d9c5 sanitycheck: Add checking of zephyr version
Adds function checking the version of zephyr, used for reporting

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-10-26 14:19:34 -04:00
Maciej Perkowski 725d19b79e sanitycheck: Add info about zephyr version to the xml reports
This commit adds posibility to save zephyr version in the xml reports.
It adds 'properties' attribute to testsuite attribute. 'properties'
can contain multiple 'property' attributes. Zephyr version is added
as such 'property'.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-10-26 14:19:34 -04:00
Vinayak Kariappa Chettimada b3c9565891 Bluetooth: controller: Remove redundant condition compile
Remove a redundant condition compile.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-26 17:40:08 +01:00
Vinayak Kariappa Chettimada c74438cdfa Bluetooth: controller: Fix arguments unused without Extended Scanning
Fix arguments unused when not enabling Extended Scanning
which was introduced in
commit 0cef1e43c9 ("Bluetooth: controller: Extended
Scanning Coded PHY duration and period").

Fixes #29442.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-26 17:40:08 +01:00
Steve Winslow 4143d79498 samples: smp: pi: Fix path in build instructions
This fixes the documentation instructions for building the SMP Pi
sample program, which incorrectly listed an underscore instead of
a path separator slash.

Signed-off-by: Steve Winslow <steve@swinslow.net>
2020-10-26 17:25:37 +01:00
Jukka Rissanen c0d636aedf samples: net: echo-server: Set handler thread name
It is useful to see the name of the handler thread for debugging
purposes so set it when starting the handler thread.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-26 11:03:03 -05:00
Jukka Rissanen a1b0a98fbf net: context: Add locking to IPv6, CAN and packet socket bind
The commit 93e5181f ("net: context: Add locking for concurrent
access") added net_context locking to only IPv4 sockets.
That is not enough and we need locking also to other supported
socket address families like IPv6, SocketCAN and packet socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-26 11:03:03 -05:00
Kumar Gala 1928428f19 ci: Add some disk usage reporting
Add some disk reporting to try and help debug random failures due to
disk space being used up.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-26 10:24:13 -05:00
Robert Lubos 7cfc612de7 CODEOWNERS: Add entries for CoAP, LwM2M and MQTT headers
Add myself as a reviewer for the aforementioned headers.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-10-26 15:42:05 +01:00
Joakim Andersson 999a91e30d Bluetooth: host: Fix application conn param update not started
Fix application conn param update submitted before the timeout of
CONFIG_BT_CONN_PARAM_UPDATE has expired being ignored when
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-10-26 16:16:35 +02:00
Joakim Andersson 21b8e08caa Bluetooth: host: Rename update_work to deferred_work
Rename the update_work handler to deferred_work since this handler
is being multiplexed for different kinds of deferred work, not just
updating the connection parameters.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-10-26 16:16:35 +02:00
Joakim Andersson 77b11d6b0c Bluetooth: host: Move auto-initiation of peripheral conn param update
Move auto-initiation of the peripheral connection parameter update,
this handling would only submit the delayed work with the timeout once
all other auto initiated procedures had completed. This behavior means
that the delay would not be set on when the connection was established
but instead relative to the previous procedures.
Based on the connection interval used, the instant(s) used, and the
number of auto procedures this delay becomes indeterminate.

Submit the work once connected, the constraint that existed in the
zephyr link layer earlier about requesting only one control procedure
at a time has been removed.

This also brings all the handling of the timeout work to the connection
state handling, which makes it easier to track this behavior in code.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-10-26 16:16:35 +02:00
Joakim Andersson f4888b1ff6 Bluetooth: host: Allow conn param update delay of 0 milliseconds
Allow the application to set a conn param update delay of
0 milliseconds.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-10-26 16:16:35 +02:00
Joakim Andersson f2a23ee166 Bluetooth: host: Document peripheral bt_conn_le_conn_update behavior
Document the behavior of the bt_conn_le_conn_update API when the
local device is the peripheral role.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-10-26 16:16:35 +02:00
Cassini Zhuang 3d3119b1e7 drivers/i2c: i2c_gpio:init at POST_KERNEL
This is to make the gpio-i2c initialization occur after the GPIO pin
clock initialization.

Signed-off-by: Cassini Zhuang <cassini.zhuang@hansonggroup.com>
2020-10-26 09:01:09 -04:00
Andrew Boie 5e18b5512b tests: mem_protect: rewrite memory domain tests
This suite now uses far less memory and is much simpler.
We still maintain coverage of all the memory domain APIs
and ensure that the maximum number of partitions can be
applied.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 08:58:00 -04:00
Andrew Boie e26f21c96c tests: mem_protect: merge two duplicate tests
The tests test_mem_part_auto_determ_size and
test_mem_part_auto_determ_size_per_mpu are supposed to
just be checking the construction of automatic memory
partitions.

test_mem_part_auto_determ_size had a bunch of extraneous
stuff covered by other test cases and reserved three
different thread stacks.

These two tests have been drastically simplified and
combined.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 08:58:00 -04:00
Andrew Boie 54aa0f0c81 tests: mem_protect: delete duplicate test
test_mem_part_inherity_by_child_thr duplicates logic already
present in test_permission_inheritance. That test puts a
buffer called 'inherit_buf' in 'inherit_memory_partition'
and shows that it is accessible by a child thread by
writing to it.

Delete this unnecessary test.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 08:58:00 -04:00
Andrew Boie ae69f87fac tests: mem_protect: improve main.c organization
Tests are now grouped in the C file they occur in.

test_mark_thread_exit_uninitialized no longer occurs twice.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 08:58:00 -04:00
Andrew Boie 4ae0f9b867 tests: mem_protect: update bss vars test
ztest_mem_partition is fine for this test. We can also run it
in user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 08:58:00 -04:00
Andrew Boie 8022aabbe8 tests: mem_protect: move partition tests
Some tests only evaluate characteristics of k_mem_partitions.
Move these to a separate C file.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 08:58:00 -04:00