Commit graph

41120 commits

Author SHA1 Message Date
Flavio Ceolin
b5bb4cd085 doc: security: Add hardening tool information
Add basic reference to hardening tool.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-02-06 23:05:38 -05:00
Anas Nashif
8ec53cf870 west.yml: hal_nxp: update to latest state of module
Update to the latest merged commit in the module and remove reference to
pull request which was merged by mistake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-06 20:38:07 -05:00
Brooks Prumo
e426c0c4e1 tests: Remove erroneous # before extern "C"
A few test header files have C++ guards around them, but are incorrect.
Those files had a leading `#` placed before `extern`, which is
incorrect.  This commit simply removes those leading `#` characters.

Signed-off-by: Brooks Prumo <brooks@prumo.org>
2020-02-06 19:45:21 -05:00
Kumar Gala
c58ca61a66 samples: flash_shell: Enable on all platforms with a flash driver
Try and build the flash_shell on all platforms that have a flash driver
rather than a limited set of know platforms.  This hopefully acts as a
build coverage test for all the flash drivers.

The flash shell requires around 10K of memory so limit it to systems
with 12K or more.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 19:18:51 -05:00
Kumar Gala
0e42d4838e flash: sam: Limit flash driver to SAME70 SoCs
The SAM flash driver was developed for the SAME70 SoCs and hasn't ever
been validated on the other SAM families (SAM3X, SAM4S).  If we try and
build on one of the other SoC families we get build errors.  So limit it
to just SAME70 for now.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 19:18:51 -05:00
Kumar Gala
afc449ec79 flash: sam0: Fix build issue.
Fix stale DT define that causes driver not to build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 19:18:51 -05:00
Kumar Gala
7bfc98e6e1 flash: nxp_lpc: Fix build issue with LPC Flash driver
The flash driver wasn't getting built in the NXP HAL.  Pull in version
of HAL that fixes that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 19:18:51 -05:00
Ulf Magnusson
fad697aed9 scripts: gen_defines.py: Add out_dev() flag for deprecated macros
Add a 'deprecation_msg' string/flag to out_dev(). When 'deprecation_msg'
is passed, all generated macros include

    __WARN(<deprecation_msg>)

which prints a custom warning if the macro is used.

Meant to be used when improving the output format.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-06 17:27:49 -06:00
Kumar Gala
8a11a17dee boards: adafruit_trinket_m0: Remove tweak to flash address
The board ships with a write protected bootloader so the flash base
address was artifically adjusted to skip that bootloader.  With commit
018bf777e7:

    boards: arm: Make Adafruit boards use their DT-defined code partion.

We shouldn't need to artifically adjust the flash anymore.  So remove
this, nice side effect is it fixes a dts compile warning.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 13:34:30 -06:00
Kumar Gala
2fd7876aa7 ci: github: west: Add a GH workflow to run the west command tests
Replace running west command tests in run_ci.sh with a github workflow.
This provides some benefits in that we can run the west command tests on
multiple python versions and host OSes (linux, mac and windows).

Also have the benefit that the tests are only run on modifications to
files in scripts/west_commands/ or scripts/west-commands.yml.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 08:34:43 -06:00
Martí Bolívar
1c80d79fdd scripts: west_commands: skip bossac tests unless on linux
That's the only platform the tool is available.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-06 08:34:43 -06:00
Alberto Escolar Piedras
88f36bb796 doc: getting_started: Add missing native_posix dependencies
For some time now we are building also the C++ samples in
native_posix in CI.
For those who want to run the whole suite locally, they
require g++-multilib, which was missing in the Ubuntu list
=> Add it.

Similarly the display sample is built in CI for
native_posix64, so add the 64bit SDL dev library to both
the Ubuntu and Fedora lists.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-02-06 08:52:17 -05:00
Andrei Emeltchenko
05822fcd95 logging: log_backend_adsp: Cleanup logging
Fix syntax error in comments and remove unneeded headers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-06 15:39:23 +02:00
Andrei Emeltchenko
a14cba891e soc: intel_apl_adsp: Remove LOG_IMMEDIATE default
Use standard log settings. Since default LOG_IMMEDIATE has changed to
output one character we have one character ring buffer slots which
limit amount of logs stored.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-06 15:39:23 +02:00
Andrei Emeltchenko
2eb257913a soc: intel_apl_adsp: Fix memory corruption
sizeof(sram) is the size of the whole structure.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-06 15:39:23 +02:00
Andrei Emeltchenko
d64b3fb505 boards: up_squared_adsp: Update logging tools
Add debug and do not split on newline, fixes hexdump logs.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-06 15:39:23 +02:00
Andrei Emeltchenko
d4e769c389 boards: up_squared_adsp: Update logging frontend
Update frontend moving general library code to appropriate place.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-06 15:39:23 +02:00
Andrei Emeltchenko
7d74a19639 boards: up_squared_adsp: Remove ignore_tag
Remove unneeded tag bluetooth. Those tests and samples use (should use)
depends_on: ble or whitelist platforms.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-06 15:39:23 +02:00
Arnaud Pouliquen
2669040f9d checkpatch: suppress mailback option in conf file
Suppress mailback conf to allow to use the -g parameter.
With the -g option it is possible to check coding style for multi
commits in the git tree without extracting them.
For instance the './scripts/checkpatch.pl --strict --git HEAD-4' command
checks the last 4 patches of the current branch.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2020-02-06 08:31:53 -05:00
Jukka Rissanen
6009045902 drivers: modem: Fix gpio compile errors with modem shell
Compile errors because of missing include file and typos
when accessing variables in the modem_pin struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 12:33:20 +02:00
Martin Lesund
e12757e9e9 net: lwm2m: implement utc_offset and timezone
Implemented UTC_OFFSET and TIMEZONE to device.

Signed-off-by: Martin Lesund <martin.lesund@nordicsemi.no>
2020-02-06 10:19:47 +02:00
Jukka Rissanen
cb4bf32f2c drivers: modem: gsm: Add support for getting modem info
Add callbacks to get the modem information which can then be
shown by modem shell.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 10:19:25 +02:00
Jukka Rissanen
fe6ebd5b75 samples: net: modem: Add net and modem shells
Enabling modem and net shells which is useful for debugging
things.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 10:19:25 +02:00
Alexander Wachter
7c3a4e6baa samples: canbus: isotp: Add sample code for the ISO-TP lib
This commit adds sample-code for the ISO-TP library

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-06 10:16:29 +02:00
Alexander Wachter
10ed5d55d0 doc: networking: Add ISO-TP documentation
This commit adds the documentation for the ISO-TP library

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2020-02-06 10:16:29 +02:00
Alexander Wachter
3650f21bd8 tests: subsys: can: Add tests for iso tp
This commit adds testing for CAN ISO-TP

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2020-02-06 10:16:29 +02:00
Alexander Wachter
55baaf0365 can: isotp: Add ISO-TP library
This commit adds a ISO-TP (ISO15765-2) library.
The library makes use of net buffers and spawns a workqueue thread.
The CAN device that is passed to bind and send can be used concurrently
beside this library.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2020-02-06 10:16:29 +02:00
Carles Cufi
07ecb817ff samples: net: google_iot: Fix logging warnings
Clean up the logging warnings due to invalid formatting.

Fixes #22510.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-06 10:00:49 +02:00
Alexander Wachter
fd9733e2d9 canopen: CO_driver: Fix Coverity issues (NULL deref, dead code)
There were two dereference after NULL check and logical dead code.

Fixes #22434
Fixes #22443
Fixes #22435
Coverity-CID: 207978
Coverity-CID: 207977
Coverity-CID: 207964

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-06 09:58:46 +02:00
Luiz Augusto von Dentz
6a66879050 Bluetooth: shell: Advertise when registering HRS service
This makes simulate command advertise with proper UUID so the likes of
central_hr can connect to it when simulating:

hrs simulate on
Registering HRS Service
Connected: 00:aa:01:01:00:24 (public)
Start HRS simulation

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-02-06 08:43:09 +02:00
Wentong Wu
9d1614477e tests: tracing: add test cases for tracing infrastructure
Add test cases for currently supported backends (UART, USB
and POSIX) of tracing infrastructure.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Wentong Wu
4f4b8ef4ea tracing: add TRACING_TEST Kconfig option
Add Kconfig option TRACING_TEST which can be used to
customize tracing packet format (currently supporting
string format and data format) for testing purpose.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Wentong Wu
aa5d45d7cc tracing: add TRACING_ISR Kconfig
Add TRACING_ISR Kconfig to help high latency backend working well.

Currently the ISR tracing hook function is put at the begining and
ending of ISR wrapper, when there is ISR needed in the tracing path
(especially tracing backend), it will cause tracing buffer easily
be exhausted if async tracing method enabled. Also it will increase
system latency if all the ISRs are traced. So add TRACING_ISR to
enable/disable ISR tracing here. Later a filter out mechanism based
on irq number will be added.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Wentong Wu
10a669ea87 tracing: ctf: adapt ctf implementation to tracing infrastructure
Adapt ctf implementation to tracing infrastructure.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Wentong Wu
c35fa6caa6 scripts: add script for usb backend to receive tracing data
Add script for usb backend to receive tracing stream data. This
script, trace_capture_usb.py, is based on pyusb, so install it
correctly before using the script.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Wentong Wu
b4449a0c2c scripts: add script to capture tracing data with UART backend
Add script to capture tracing stream data with UART backend. This
script is developed based on pyserial, so install it correctly
before using the script.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Wentong Wu
8ccc04de6a tracing: add infrastructure for collection of tracing data
First, this commit adds user interface in tracing_format.h which
can trace both string format and data format packet.

Second, it adds method both for asynchronous and synchronous way.
For asynchronous method, tracing packet will be buffered in tracing
buffer first, tracing thread will output the stream data with the
help of tracing backend when tracing thread get scheduled.

Third, it adds UART and USB tracing backend for asynchronous
tracing method, and adds POSIX tracing backend for synchronous
tracing way.

Also it can receive command from host to dynamically enable and
disable tracing to have host capture tracing data conveniently.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00
Jacob Siverskog
6c218ac2c6 doc/reference/runtime_conf: improve example snippets
Improve settings example snippets by ordering things so that they
actually compile.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2020-02-05 20:32:52 -05:00
Kumar Gala
de70e9c5ba scripts/sanitycheck: be more fair with dividing subsets
Since we do interger division to determine how many items are in each
set, its possible we can have bad rounding error and the last set having
a much larger amount of items compared to all other sets.

For example, total = 3740, sets = 300:
	per_set = 3740 / 300 = 12.466 = 12
	last_set = 3740 - 299 * 12 = 152

So instead of doing simple division, we add on extra item to the early
sets and we've exhausted the rounding error:

	num_extra_sets = total - per_set * sets
		   140 = 3740 - 12 * 300

So the first 140 subsets will have 13 per_set, and the last 160 will
have 12 per_set.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 18:57:49 -05:00
Vincent Wan
115949a97f sockets: tls: set TLS_CREDENTIALS when using non-native stack
When is NET_SOCKETS_SOCKOPT_TLS set, it should set TLS_CREDENTIALS
even when NET_NATIVE=n, so that platforms that use socket offloading
can continue to set TLS credentials.

We are now setting this via 'imply' instead of 'select', so that
prj.conf can opt out if necessary.

Fixes #22390

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 18:47:54 -05:00
Steven Slupsky
d93fadc099 drivers: i2c_slave: eeprom: fixes incorrect declaration
This commit fixes an incorrect declaration of the buffer_size member
of the i2c_eeprom_slave_config struct.

Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
2020-02-05 18:46:35 -05:00
Kumar Gala
6f51ef8a4c boards: em_starterkit: cleanup dts warnings
Fix the following device tree warnings:

unit-address and first reg (0x20000) don't match for iccm@0
unit-address and first reg (0x80010000) don't match for dccm@80000000

Since the em_starterkit_em7d_normal has a different base address for
iccm & dccm, and most of the em_starterkit variants have different sizes
for iccm & dccm.  Just define the nodes in the specific
em_starterkit*.dts file and remove them from emsk.dtsi.  This removes
the issue reported in the warning.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 17:10:54 -05:00
Kumar Gala
b921955e44 boards: arc: nsim: cleanup dts warnings
Fix the following device tree warnings:

unit-address and first reg (0x40000) don't match for iccm@0
unit-address and first reg (0x80040000) don't match for dccm@80000000

Re-work iccm and dccm reg address and size to be based on #defines.
This allows the nsim_sem_normal.dts to override defaults that are set in
nsim.dtsi.  Utilize DT_ADDR macro to take a 'unit-address' still value
and convert it into a hex value (just prepending 0x).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 17:10:54 -05:00
Kumar Gala
dacf211d36 dts: introduce macro's to help with changing unit-addr
Since there are times that we include a base .dtsi file and change the
reg address we tend to end up with warnings that the reg address and
unit-address don't match.  To handle this introduce a simple DT_ADDR(x)
macro that will prepend '0x' to a 'unit-address' style address.

  #define DCCM_ADDR 80000000 /* in unit-address format */

  dccm0: dccm@DCCM_ADDR {
     reg = <DT_ADDR(DCCM_ADDR) 0x1>;
     ...
  };

This allows the dts file to override the value of DCCM_ADDR and than to
have the unit-address of the node and the reg address match.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 17:10:54 -05:00
Kumar Gala
76f2987e66 boards: xtensa: fix device tree build warnings
Fix warnings of the following form:

unit-address and first reg (0x30000) don't match for partition@10000
unit-address and first reg (0x200000) don't match for partition@1F0000

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-05 17:10:54 -05:00
Tobias Svehagen
8a9c9d43bf drivers: modem: Add support for different line endings
This makes it possible to handle devices that use different line
endings.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-02-05 23:31:56 +02:00
Henrik Brix Andersen
6881da0afa samples: canbus: canopen: reduce default timeout in main thread
Reduce the default timeout in the CANopen sample from 50 milliseconds
to 1 millisecond. This vastly improves performance of the sample and
matches the example code present in the CANopenNode stack.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 14:37:27 -06:00
Henrik Brix Andersen
6b702888e5 canbus: canopen: process RPDOs in real-time thread
Add processing of RPDOs to the high-priority CANopen processing
thread.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 14:36:05 -06:00
Henrik Brix Andersen
e5f3279abb adc: common: handle gain of 128 in adc_gain_invert()
Add missing entry for ADC_GAIN_128 in the adc_gain_invert() function.

This fixes 4420c5ed40.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 14:28:09 -06:00
Gerson Fernando Budke
b5e028b72f boards: sam4s_xplained: Add spi supported in yaml file
Added spi supported in sam4s_xplained board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-05 14:25:23 -06:00