Commit graph

42565 commits

Author SHA1 Message Date
Daniel Leung 49199641b9 x86: add include guard for offset files
MISRA-C directive 4.10 requires that files being included must
prevent itself from being included more than once. So add
include guards to the offset files, even though they are C
source files.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-24 10:01:12 +02:00
Johann Fischer 4a492bb55e shields: st7789v: explicitly set RGB565 byte-swap
Explicitly set RGB565 byte-swap for st7789v_waveshare_240x240.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-07-23 17:34:59 -05:00
Martí Bolívar 9861e5d22a sanitylib: log test exception tracebacks
This aids in debugging.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 13:36:22 -05:00
Simon Glass 5afdceee8c sensor: shell: Add a 'battery' command
It is useful to show sensor channels for a battery in cohesive block as
it is easier to read. Add a 'battery' command to handle this. It only
supports a single battery, relying on the device-tree alias to select
it.

uart:~$ battery
Temp:  23.55 C
V:     4.31 V
V-desired: 4.40 V
I:    574 mA (CHG)
I-desired:  2000 mA
Charging: Not Allowed
Charge: 100 %
V-design: 3.86 V
Remaining: 6764 mA
Cap-full: 6764 mA
Design: 6910 mA
Time full: 0h:00
Time empty: 0h:00

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Simon Glass ee34aced6a sensor: max17055: Add MAX17055 driver
Add support for the Maxim MAX17055 fueld-gauge sensor.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Simon Glass 9b8c04401d sensor: shell: Show the error code when reading fails
The error code may give a clue as to what is wrong. Add it to the error
message.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Simon Glass 122d8fa6a9 sensor: shell: Allow output for fuel-gauge channels
Add names for more channels so that they can be shown, e.g.:

$ sensor get MAX17055
channel idx=38 gauge_voltage =   4.313906
channel idx=39 gauge_avg_current = 558.000000
channel idx=42 gauge_temp =  23.558558
channel idx=43 gauge_state_of_charge = 100.000003
channel idx=44 gauge_full_cap = 6766.000000
channel idx=45 gauge_remaining_cap = 6766.000000
channel idx=46 gauge_nominal_cap = 6910.000000
channel idx=50 gauge_time_to_empty =   0.000000
channel idx=51 gauge_time_to_full =   0.000000
channel idx=52 gauge_cycle_count =   0.100000
channel idx=53 gauge_design_voltage =   3.860000
channel idx=55 gauge_desired_charging_current = 2000.000000

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Simon Glass 49a3e49936 include: drivers: sensor: Add more channels for batteries
Add some more channels useful for batteries with fuel gauges.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Martí Bolívar 9c92baa73f devicetree: use edt.pickle more
Consolidate creation of edtlib.EDT objects from a build directory's
devicetree into one place by loading it from build/zephyr/edt.pickle
everywhere. A previous commit creates edt.pickle from gen_defines.py.

In addition to probably speeding things up slightly by not reparsing
the devicetree, the main benefit of this approach is creating a single
point of truth for the bindings directories and warnings
configuration, meaning we don't have to worry about them getting out
of sync while being passed around between devicetree creation and
usage time.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 09:19:45 -05:00
Ioannis Glaropoulos 6d9d60ce60 boards: nrf5340: update help text for BOARD_ENABLE_CPUNET symbol
We enhance the help text of the BOARD_ENABLE_CPUNET Kconfig
option, to stress that if the option is used when building
a Non-Secure Application MCU firmware image, the Secure
image counterpart also needs to perform the required GPIO
allocation.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-23 14:07:16 +02:00
Ioannis Glaropoulos 4051f277ef boards: nrf5340: do not attempt to boot NETWORK MCU from Secure image
Building Zephyr with CONFIG_TRUSTED_EXECUTION_SECURE=y implies
building also a Non-Secure image. The Non-Secure image will, in
this case do the remainder of actions to properly configure and
boot the Network MCU. So the (strictly) secure firmware image
does not need to execute the configuration and the booting of
the Network MCU, except for the part that does security
attribution. In the absence of any TrustZone awareness, the
single Application MCU firmware will do all the required
steps to configure and boot the Network MCU.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-23 14:07:16 +02:00
Peter Bigot f45f72c9a4 doc: development_process: document that CI style checks can fail
The CI style checking solution can produce false positives when it's
given code that it mis-parses, or that follows conventions it doesn't
allow.  Document a couple examples, and explicitly note that
maintainers should override the -1 vote if they're encountered.

For those following along in the commit history:

   static uint8_t __aligned(PAGE_SIZE) page_pool[PAGE_SIZE * POOL_PAGES];

checkpatch sees "uint8_t __aligned(PAGE_SIZE)" and infers a prototype
for a function "__aligned" that takes an unnamed parameter of type
"PAGE_SIZE".  So it adds "PAGE_SIZE" as a known type name.

   IOPCTL_Type *base = config->base;

This is common in driver code where the vendor HAL allows typedefs for
structure types.  checkpatch was designed for an environment with
limited use of typedefs; "struct IPCTL_Type" would have been handled
properly.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-23 14:04:44 +02:00
Jan Van Winkel 716eea0b65 scripts: Increased minimal pyelftools version
Increased minimal pyelftools version to 0.26 else
scripts/footprint/size_report will fail to import LocationExpr from
elftools.dwarf.locationlists

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-07-23 07:49:35 -04:00
Kumar Gala 77a56fd725 dts: remove incorrect use of device_type property
For true mmio-sram, arc,iccm, arc,dccm nodes we should not be setting
device_type = "memory".  This should be used for true DRAM regions of
memory and not on SoC SRAMs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-23 06:37:41 -05:00
Maksim Masalski 9ccbfbd84e tests: code review changes
Code review changes.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-23 12:55:47 +02:00
Maksim Masalski 32aa91d803 tests: add new futex test
Add new standalone futex test that verifies next requirements:
-Futex can be placed in user memory using ZTEST_BMEM
-User thread can write to futex value
-User threads can make wait/wake syscalls on it

Added detailed Doxygen tag with information about the test

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-23 12:55:47 +02:00
Vinayak Kariappa Chettimada 10142ab398 Bluetooth: controller: Added some comments for fields in node rx struct
Added internal comments about the use of some of the fields
in the node rx structure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Vinayak Kariappa Chettimada 61e7eb907c Bluetooth: controller: Define struct in node rx for adv term event
Defined struct in node rx for passing event parameters of
Advertising Set Terminated Event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Vinayak Kariappa Chettimada e0613b9638 tests: Bluetooth: bsim: Added tests for adv set terminate event
Added bsim testing for Advertising Set Terminated event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Vinayak Kariappa Chettimada cd0e72a91e Bluetooth: controller: Reworked adv set terminate event
Reworked the implementation of Advertising Set Terminate
event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Dag Bjarvin 46a622837d Bluetooth: controller: Release term event memory on timeout
Release memory allocated to ext adv terminate event, after timeout

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Dag Bjarvin 0df34da5d7 Bluetooth: controller: Terminate event for ext adv
Update to free term event node

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Vinayak Kariappa Chettimada a4eead690d Bluetooth: controller: Adv Set Terminated Evt on duration
Implementation of Advertising Set Terminated Event on
duration sans use of additional variable in advertising
set context structure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Dag Bjarvin 12fdddb80d Bluetooth: controller: Add terminate event for external advertising
Add terminate event for duration timeout, max number of events and
connection.

Signed-off-by: Dag Bjarvin <Dag.Bjarvin@nordicsemi.no>
2020-07-23 11:39:47 +02:00
Andrew Boie 7df42d7c25 include: libc-hooks: add comments
Clarify in documentation under what conditions this partition
is available.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-23 11:01:42 +02:00
Andrew Boie bb0c6dbf62 libc: newlib: remove impossible ifdef
This whole code block is ifdef'ed around
CONFIG_NEWLIB_LIBC_ALIGNED_HEAP_SIZE being NOT defined,
remove as this can never be true.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-23 11:01:42 +02:00
Andrew Boie ca1154d85a libc: newlib: simplfy malloc arena defn
We've come a long way since this was written to implement
generic ram bounds definitions and MPU capabilities,
use them here.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-23 11:01:42 +02:00
Kumar Gala 17d5a47fdc dts: x86: cleanup memory node
* Rename DT_SRAM_SIZE to DT_DRAM_SIZE since that is more correct
* Remove mmio-sram compatible since that is not correct for DRAM.
* Rename node label from sram0 to dram0

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-23 11:01:16 +02:00
Martí Bolívar 006319f043 scripts: kconfigfunctions: add a comment
I can never remember what the contents of the kconfigfunctions dict is
and have to look it up every time. I suspect I'm not alone, and not
everyone who uses these will know how to look up the answer. Add a
comment explaining the value.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 11:00:39 +02:00
Martí Bolívar 24677f93bc kconfig: add dt_path_enabled, dt_alias_enabled
There is already a way to check if a node is enabled based on its node
label, but we don't have an equivalent way to do that for a path or an
alias. Add them. These rely on the same underlying edtlib machinery to
get their jobs done, but are being treated differently within Kconfig
in order to match distinctions between paths and aliases made in the
devicetree.h API.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-23 11:00:39 +02:00
Luiz Augusto von Dentz 75f47a56b5 Bluetooth: Add config option to disable security checks
This adds CONFIG_BT_CONN_DISABLE_SECURITY which can be used to disable
security checks for incoming requests enabling to test accessing GATT
attributes and L2CAP channels that would otherwise require
encryption/authentication in order to be accessed.

It depends on BT_TESTING to indicate to the users that this is a
testing feature which shall not be used in production.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-07-23 11:00:04 +02:00
Andrzej Kaczmarek 38997a5719 Bluetooth: host: Do not set AD on scannable ext adv
Advertising data is not supported on scannable extended advertising
instances.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-07-23 10:58:33 +02:00
Andrzej Kaczmarek d93489035c Bluetooth: host: Add flag to indicate ext adv set
It should be possible to identify whether advertising set uses legacy
or extended advertising to avoid performing operations that are not
supported on either of them.

For example, scannable advertising can have advertising data set only
if legacy PDUs are used.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-07-23 10:58:33 +02:00
Kamil Kasperczyk 06bf2ca707 net: openthread: Added config options for NCP vendor hooks.
New config option that can be used to enable vendor hooks
for NCP component.

Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
2020-07-23 10:44:19 +02:00
Maureen Helm 8c7cef6da0 runners: Implement --erase option in pyocd runner
Implements the common runner option to mass erase before flashing in the
pyocd runner.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-23 10:30:47 +02:00
Anas Nashif e47866c530 sanitycheck: fix --device-testing without serial-pty
serial-pty is an extension that is not supported in the hardware map, so
we need to work around the fact that it is not part of the map when
dealing with normal serial.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-22 16:57:14 -05:00
Daniel Leung 8fe7fbf7ee doc: coding_guidelines: sort list in natural order
Sort the MISRA lists in a more natural ascending numeric order.
So instead of 1.1 - 1.10 - 1.11 - 1.2 - 1.3, we now have
1.1 - 1.2 - 1.3 - 1.10 - 1.11.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-22 17:36:33 -04:00
Marek Porwisz 740e0ccc9e net: openthread: Allow use of custom mbedtls
To allow hardware crypto acceleration custom mbedtls library needs to be
prepared. However current implementation forces the default library to
be used.
This patch allows not using the default library and passing custom
mbedtls target to use with openthread.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-07-22 15:32:30 -05:00
Francois Ramu 4339183292 west.yml: Update to stm32cube/stm32xx latest branches
Updating SHA1 for the modules/hal/stm32 revision

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-07-22 15:24:57 -05:00
Dominik Ermel e3d733f1ba mgmt: smp: Missing socket close in error path
Missing close of socket may cause resource leak, in form of orphaned
socket descriptor, when bind fails.

Coverity CID: 210072
Fixes #26991

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-22 15:22:50 -05:00
Alexander Kozhinov c485207044 boards: arm: yaml: nucleo_h745zi_q_m4
add netif:eth to supported devices
change ram size to 288 as it the size of
  sram0 in h745 SoC

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-07-22 15:19:38 -05:00
Alexander Kozhinov dd9e9c2e71 boards: arm: dts: nuleo_h745zi_q_m4
bringing model and compatible descriptors
  to same style as in case of M7 core
enable UART8 for Cortex-M4 in it's dts

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-07-22 15:19:38 -05:00
Alexander Kozhinov 3b115be91f boards: arm: dts: nuleo_h745zi_q_m7
updating comment on resources

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-07-22 15:19:38 -05:00
Peter Bigot a1babb7f1f drivers: eeprom_slave: add const qualifier to read-only data
The EEPROM device doesn't mutate the source data it's given, so update
the API signature to reflect this fact.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-22 21:41:12 +02:00
Jukka Rissanen 2705a9d61b net: if: Network interface was missing for offloaded drivers
The NET_IF_OFFLOAD_INIT() macro was not converted to use
Z_STRUCT_SECTION_ITERABLE() macros in commit 62580748e5
("net: Use section foreach macros"). This meant that for those boards
that use offloaded network stack, the network interface was not created
and network connectivity was lost.

Fixes #27037

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-07-22 14:17:37 -04:00
Michael Hope b046ca5409 net: tcp2: fix unaligned access in the TCP2 stack
The TCP2 stack does operations directly on the packet data which may
or may not be aligned.  The unaligned access causes a fault on the
Cortex-M0+ so use the UNALIGNED_* macros instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-22 15:08:31 +03:00
Tobias Svehagen 71e7cd3f99 drivers: wifi: esp: Fix issue with incorrect tx timeout
It can happen that the command '>' is received between
modem_cmd_send_nolock and modem_cmd_handler_update_cmds. Since the
command handler for '>' is not set, sem_tx_ready will not be given
and _sock_send will timeout. Make sure the command handlers are set
before the send by also passing them to modem_cmd_send_nolock.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-07-22 15:06:41 +03:00
Michael Hope 045cc2eb2a boards: arm: configure and document the bootloader on the Trinket M0
The Trinket M0 has a Adafruit UF2 bootloader.  Configure and document
how to use it.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-22 13:24:37 +02:00
Michael Hope 8c1f1865af soc: sam0: add support for the BOSSA bootloader
This adds a new config option for SAM0 targets that use the BOSSA
bootloader.  If the CDC ACM driver is also enabled, then the
programmer can automatically reset the board into the bootloader for
programming.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-22 13:24:37 +02:00
Michael Hope 62a236e546 usb: cdc_acm: add a DTE rate changed callback
This is called when the USB host changes the virtual baud rate.

This is used by Arduino style boards to signal that the board should
reset into the bootloader.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-22 13:24:37 +02:00