Commit graph

80599 commits

Author SHA1 Message Date
Mariusz Skamra 93abc2ad76 Bluetooth: att: Reset ATT timer when retrying on security error
If the remote responds with and security related error the stack tries
to increase the security level to satisfy the remote permissions.
This fixes missing ATT timer reset on security related ATT Error
Response as the ATT operation is considered as complete.

< ACL Data TX: Handle 0 flags 0x00 dlen 7
      ATT: Read Request (0x0a) len 2
        Handle: 0x0084
        TMAS: Role
> ACL Data RX: Handle 0 flags 0x02 dlen 9
      ATT: Error Response (0x01) len 4
        Read Request (0x0a)
        Handle: 0x0084
        Error: Insufficient Authentication (0x05)
          TMAS: Role
           Error code: 0x05
< ACL Data TX: Handle 0 flags 0x00 dlen 6
      SMP: Security Request (0x0b) len 1
        Authentication requirement: Bonding, No MITM, SC, No Keypresses
= bt: bt_att: ATT Timeout

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-06-24 18:55:17 +02:00
Théo Battrel a996159362 Bluetooth: Host: Fix connection reference leak
If connection reference is acquired from `bt_conn_lookup_addr_le` but
`bt_gatt_ccc_cfg_is_matching_conn` return false the connection was not
unreferenced properly. This commit fix the issue by unreferencing the
connection if the condition is false.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-06-24 18:55:04 +02:00
Mariusz Skamra d72c17684c Bluetooth: tbs_client: Fix possible NULL pointer dereference
This fixes notification callback that can be called with NULL conn
parameter when peer is being unpaired.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-06-24 18:54:56 +02:00
Mariusz Skamra 6f0dc490e7 Bluetooth: vocs_client: Remove unused subscribe_cnt variable
This removes unused subscribe_cnt from bt_vocs_client.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-06-24 18:54:56 +02:00
Mariusz Skamra a7231a4ca4 Bluetooth: aics_client: Remove unused subscribe_cnt variable
This removes unused subscribe_cnt from bt_aics_client structure.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-06-24 18:54:56 +02:00
Mariusz Skamra 5452ef378f Bluetooth: tbs_client: Remove unused subscribe_cnt variable
This removes unused subscribe_cnt from bt_tbs_instance.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-06-24 18:54:56 +02:00
Jason Yuan 570bcd3c83 test: adc: current sense amplifier
adds tests for the current sense amplifier binding macro and rescaling
function.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Jason Yuan fe20701bd8 drivers: afe: current sense amplifier
adds DT macro initializer and scaling function for current sense
amplifier.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Jason Yuan fcb4c23b95 dts: bindings: afe: add current sense amplifier
Add bindings for a current sensor using a shunt resistor and amplifier.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Jason Yuan a79df5eed1 test: adc: current sense shunt
adds tests for the current sense shunt binding macro and rescaling
function.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Jason Yuan 154ad7544d drivers: adc: current sense shunt
adds DT macro initializer and scaling function for current sense shunt.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Jason Yuan 7b73beab43 dts: bindings: adc: add shunt sensor
Add bindings for a current sensor using a shunt resistor.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Jason Yuan 40957389ff test: adc: voltage divider
adds tests for the voltage divider binding macro and rescaling function.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Jason Yuan 67bdd17808 drivers: adc: voltage divider
adds DT macro initializer and scaling function for voltage divider.

Signed-off-by: Jason Yuan <jasonyuan@google.com>
2023-06-24 18:54:33 +02:00
Iuliana Prodan f7c1f91148 samples: openamp_rsc_table: move arch specific config from project
The CONFIG_PLATFORM_SPECIFIC_INIT is ARM specific, so move this to
board config file, rather than project config.
It should be no restriction to run the openamp_rsc_table sample on other,
non-arm, platforms.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2023-06-24 08:23:13 -04:00
Vincent van Beveren bd0d98bb9e tests: posix: fs: Add tests for stat command
This commit adds tests for the stat command. Stat on the
root of the filesystem is not yet supported.

Signed-off-by: Vincent van Beveren <v.van.beveren@nikhef.nl>
2023-06-23 17:04:34 -04:00
Vincent van Beveren 2ae521a5f5 posix: fs: Fixes stat command to return file information
Fixes #58911. Previously the stat command returned
information on the filesystem, but not the file itself.
Because block size is still set this function is
backwards compatible with the previous faulty
behavior.

Signed-off-by: Vincent van Beveren <v.van.beveren@nikhef.nl>
2023-06-23 17:04:34 -04:00
Anas Nashif 7584c17374 intel_adsp: restructure dmic headers and move regs to soc
The ifdefs in in dmic headers is getting out of control and makes
maintainence very ddifficult, especially when having to maintain out of
tree SoCs sharing the same data and information.

Keep header clean and per SoC and share some common registers in one
place instead avoiding confusion and making it easier to read and
maintain.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-23 14:27:44 -04:00
Anas Nashif d6ce537be8 doc: kernel: update thread priorities diagram
cooperative priorities are negative, 0 is not a cooperative priority.
Looks like the docs are showing an outdated diagram for some reason, try
to update that with a refresh.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-23 14:27:22 -04:00
Conor Paxton 05136cde61 boards: riscv: add I2C Controllers to PolarFire SoC Icicle board
Microchip's PolarFire SoC contains two identical I2C peripherals in the
microprocessor subsystem. Enable both by default.

Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
2023-06-23 12:31:36 -04:00
Conor Paxton a810d27935 drivers: i2c: add Microchip PolarFire SoC I2C driver
This patch adds driver support for Microchip's PolarFire SoC I2C. This
initial support implements the Controller API only.

Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
2023-06-23 12:31:36 -04:00
Conor Paxton ea42995f2e dts: riscv: introduce PolarFire SoC I2C interface
Add support for Microchip's PolarFire SoC I2C interface
Signed-off-by: Conor Paxton <conor.paxton@microchip.com>
2023-06-23 12:31:36 -04:00
Yuval Peress 10be3a1263 rtio: Implement a NO_RESPONSE flag for SQEs
When added, the SQE's completion will not generate a CQE.
Fixes #59284

Signed-off-by: Yuval Peress <peress@google.com>
2023-06-23 12:31:09 -04:00
Yuval Peress 8e5cae7fa3 ztest: Allow 'before' functions to run in privilaged mode
When writing a test suite, it's more common to want the 'before'
hook to run in privilaged mode, even when the test is run in userspace.
Reconfigure ztest to first run the test thread callback in privilaged
mode and only enter userspace after the test rule and suite's 'before'
functions ran.

Signed-off-by: Yuval Peress <peress@google.com>
2023-06-23 12:30:46 -04:00
Andy Sinclair e484ab2fa8 boards: shields: npm1300_ek: Specify regulator initial modes
The npm1300_ek overlay has been updated to explictly specify
the initialisation modes for the dual purpose LDO / LDSW outputs.

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-06-23 15:43:00 +00:00
Ethan Duckett 3b6409e34e dts: stm32g4: fix clk-lse driving-capability
Altered LSE in stm32g4.dtsi to same value as other ST DTS files.

Signed-off-by: Ethan Duckett <ethan.duckett@brillpower.com>
2023-06-23 15:14:16 +00:00
Anas Nashif c62e55973b intel_adsp: remove deprecated cache macros
SOC_DCACHE_FLUSH and SOC_DCACHE_INVALIDATE are not being used anywhere.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-23 11:14:08 -04:00
Florian Grandel c88a9ef272 segger: rtt: disable unsupported shell/log features
The RTT backend of the shell does not support several of the more
advanced terminal features. This commit proposes to inactivate these
features by default when RTT is selected as shell backend.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-23 14:42:41 +02:00
Francois Ramu e216dcfc3d samples: drivers: quadspi flash of the stm32 boards
This enables the samples/drivers/spi_flash on quad-spi flash
to run on any stm32 target with external NOR quad flash.
The SPI_FLASH_MULTI_SECTOR_TEST test case is possible with
quadspi too.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 10:51:06 +00:00
Francois Ramu 7f8342775f samples: drivers: jesd216 jedec ID and SFDP from quad-flash
This adds the support jedec configuration to run
the jedec sample application. So target board can display
the content of the quad-NOR flash.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 10:51:06 +00:00
Francois Ramu 529f9ed0c2 boards: arm: stm32l475 disco yaml has the quadspi NOR
This commit adds the support of the quadspi to the board
definition .yaml file

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 10:51:06 +00:00
Francois Ramu a13ccdad9c boards: arm: stm32l496 disco enables the quadspi NOR
This commit enables the 64Mbit quadspi NOR (mx25r6435)
mounted on the stm32l496g_disco kit.
Use the DMA transfer for QSPI: request 7 on channel3 of DMA2.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 10:51:06 +00:00
Francois Ramu c7b82096a4 boards: arm: stm32h747i disco board enables QSPI interface
The stm32h474i_disco has a twin NOR flash made of two
MT25QL512 64MBytes quad-NOR devices.
Here, the partition is fully adressing the memory size.
The 1st NOR device is selected (U3 on the schematics).

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 10:51:06 +00:00
Francois Ramu 06b8f4b994 drivers: flash: stm32 qspi driver with read SFDP ID from quadflash
This commit adds the jedec216 read sfdp and Read ID
function API. The qspi commands are issued to the
quad flash device.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 10:51:06 +00:00
Alberto Escolar Piedras 7ee41b8776 soc inf (native): Refactor into a top and bottom
Where the bottom is the only one which interacts with
the host operating system.
And the top the only one that interacts or is aware
of the hosted operating system (Zephyr).

The bottom uses the native simulator CPU
start/stop emulation.
By now we replicate its code as a provisional measure,
until the native simulator becomes standard.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-06-23 12:16:26 +02:00
Alberto Escolar Piedras bd66c1d953 arch POSIX: Refactor into a top and bottom
Where the bottom is the only one which interacts with
the host operating system, and does not necessarily
need to know about the Zephyr OS.
This is in preparation for the native simulator,
which which the bottom is also fully Zephy agnostic.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-06-23 12:16:26 +02:00
Andy Sinclair d79cf205c6 samples: shields: npm1300_ek: Added LED to example
Updated shield sample to drive LED

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-06-23 08:55:13 +00:00
Andy Sinclair 198d5b889f boards: shields: npm1300_ek: Added LED support
Updated overlay to include LED support

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-06-23 08:55:13 +00:00
Andy Sinclair 7bc99e246c drivers: led: npm1300: nPM1300 LED driver
Added LED driver for nPM1300 PMIC

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-06-23 08:55:13 +00:00
Fabio Baltieri bb5f421ade gpio: npm1300: lower init priority
Lower the priority of the npm1300 gpio driver. The GPIOs are used by
some regulator nodes in the default shield config, but regulators are
initialized before the gpios. Lowering the GPIO priority to sort thigs
out.

Found with the build time priority checking feature:

$ west build -p -b nrf52dk_nrf52832 samples/shields/npm1300_ek \
  -DCONFIG_CHECK_INIT_PRIORITIES=y
...
ERROR: /soc/i2c@40003000/pmic@6b/regulators/LDO2 POST_KERNEL 76 <
  /soc/i2c@40003000/pmic@6b/gpio-controller POST_KERNEL 80
ERROR: /soc/i2c@40003000/pmic@6b/regulators/LDO1 POST_KERNEL 76 <
  /soc/i2c@40003000/pmic@6b/gpio-controller POST_KERNEL 80
ERROR: /soc/i2c@40003000/pmic@6b/regulators/BUCK2 POST_KERNEL 76 <
  /soc/i2c@40003000/pmic@6b/gpio-controller POST_KERNEL 80
ERROR: /soc/i2c@40003000/pmic@6b/regulators POST_KERNEL 75 <
  /soc/i2c@40003000/pmic@6b/gpio-controller POST_KERNEL 80
ERROR: /soc/i2c@40003000/pmic@6b/regulators POST_KERNEL 75 <
  /soc/i2c@40003000/pmic@6b/gpio-controller POST_KERNEL 80
ERROR: /soc/i2c@40003000/pmic@6b/regulators POST_KERNEL 75 <
  /soc/i2c@40003000/pmic@6b/gpio-controller POST_KERNEL 80

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-06-23 09:23:22 +02:00
Daniel DeGrasse 8620efe562 boards: arm: mimxrt1040_evk: document M.2 WiFi module debugging issue
Document issue with M.2 WiFi module, where debug connection fails using
external debugger. Current workaround is to remove J80 jumper when using
onboard debugger, or remove M.2 module entirely.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-06-23 09:22:45 +02:00
Francois Ramu e802779d86 drivers: clock control: stm32h5 set the clock freq for voltage scaling
According to the stm32h5x product specifications, the values of the
voltage ragulator depends on the system clock as follows:
• VOS0 (Vcore = 1.35V) with CPU and peripherals running at up to 250 MHz
• VOS1 (Vcore = 1.2V) with CPU and peripherals running at up to 200 MHz
• VOS2 (Vcore = 1.1V) with CPU and peripherals running at up to 150 MHz
• VOS3 (Vcore = 1.0V) with CPU and peripherals running at up to 100 MHz

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 09:22:06 +02:00
Francois Ramu a5532f9fd9 drivers: dma: stm32 dmamux device must be initialized after dma
Add specific init priority for the stm32 DMAMUX device higher
than the CONFIG_DMA_INIT_PRIORITY, to be sure that the DMAMUX
 initialization always comes after the stm32 DMA device init.
Its default value is set to 41 when the DMA_INIT_PRIORITY is
KERNEL_INIT_PRIORITY_DEFAULT (=40).

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-06-23 09:21:59 +02:00
Emil Gydesen 192e425b90 Bluetooth: Host: Add NULL check for addr in unpair
unpair may be called from bt_unpair where addr is NULL.
One such case is the `bt clear all` shell command which
calls bt_unpair with addr = NULL, and the addr is just forwarded
to unpair which does not check for NULL.

bt_unpair allows for the addr to be NULL to clear all, but only
if SMP is enabled.

Modified the checks in bt_unpair to increase readability
and ensure that unpair is not called with NULL.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-06-23 09:21:35 +02:00
Piotr Dymacz d25626c74b boards: arm: efr32_thunderboard: add 'zephyr,bt-c2h-uart'
Include 'zephyr,bt-c2h-uart' in 'chosen' node to make it possible to use
HCI raw mode over UART. This was tested with 'efr32bg22_brd4184b' board
running 'hci_uart' sample with Linux machine as a host (kernel 6.2).

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-06-23 09:21:13 +02:00
Florian Grandel 897f7789b6 boards: cc1352p1_launchxl: fix antenna mux config
The antenna MUX configuration should explicitly define PULL states as
giving no value will leave the GPIO register in an unspecified state.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-23 09:20:55 +02:00
Florian Grandel b245012ca2 drivers: ieee802154: cc13/26xx_subg: R-to-P link workaround
A known issue exists that does not allow a CC13/26x2R device to
establish a link to a CC13/26x2P device unless the capacitor array is
tuned to a non-default value in the P device.

See SimpleLink(TM) cc13xx_cc26xx SDK 6.20+ Release Notes, Known Issues.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-23 09:20:55 +02:00
Florian Grandel 7232c38828 drivers: ieee802154: cc13/26xx_subg: fix PHY overrides
PHY overrides have been checked against the latest version of TI's
SmartRF(TM) Studio. The result was regression tested (PER/performance)
against LAUNCHXL-CC1352P1 boards.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-23 09:20:55 +02:00
Florian Grandel fe03bb5f1a drivers: ieee802154: cc13/26xx_subg: fix subg_start() return value
The radio API should indicate errors when the interface is started.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-23 09:20:55 +02:00
Florian Grandel 122a10fdaa drivers: ieee802154: cc13/26xx_subg: fix header len const
The length field in the header refers to the size of the MAC so it
shouldn't rely on constants describing PHY header length. While
currently both constants have the same value this will no longer be true
for enhanced PHYs and/or MAC frames as the number of FCS bytes may then
be four.

Also introduces an assertion that ensures that the given package buffer
does not exceed the TX buffer's length. An assertion is enough as the
package buffer is allocated at compile time.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-23 09:20:55 +02:00