Commit Graph

88844 Commits

Author SHA1 Message Date
Anas Nashif 740d0c3b50 lib: heap: make multi-heap feature configurable
Make multi-heap configurable via Kconfig and adapt existing tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif d398e9631b lib: heap: build heap_info conditionally
Only build when needed and adapt existing users to pull this in when
needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif 00680bd23a lib: heap: rename with files and use _
be consistent with other files in the same folder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif 2e24e9da9e tests: shared_multi_heap: fix identifier
Adapt identifier and be consistent with other heap tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif 11365fc4f8 tests: move shared_multi_heap to tests/lib
Move shared_multi_heap test under lib alongside all other heap tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif 44381f957a tests: multi_heap: adapt test identifiers
Change identifier to match with other heap related tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif dd2dcbed54 tests: move mheap_api_concept into tests/lib/multi_heap
Move multi-heap tests out of kernel folder along side all other heap
related tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif b9f2ac0270 lib: heap: make heap_print_info static
This should be declated static as it is being only called in this file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif d6d716b32a lib: heap: build heap utilities only on demand
Build the heap features only when needed and based on Kconfigs being
set.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif 4cd9c11692 lib: heap: split heap-validate.c
Split heap-validate.c into smaller chunks. We have been adding all kind
of new APIs under this file and building it unconditionally whether
those APIs are needed/used or not. Many of those APIs have nothing to do
with the validation part.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Anas Nashif 6cb588820f lib: os: move heap to own folder
consolidate all heap related files and implementation into one folder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Simon Hein 64462657c9 doc: irq: fix function link
fix not correct shown function link for irq_connect_dynamic.

Signed-off-by: Simon Hein <Shein@baumer.com>
2023-12-13 20:13:46 +01:00
Jukka Rissanen 477a4a5d34 net: shell: Rename the common.h to be more unique
As the common.h is only meant to be used by the network
shell files, rename it to be more descriptive in order to
avoid possible conflicts with any other common.h file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-13 20:13:39 +01:00
Jukka Rissanen 37c18ddcb1 net: if: Init also dhcpv6 when interface is init
Do dhcpv6 state initialization same way as how dhcpv4 is done
when initializing network interface structure.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-13 20:13:31 +01:00
Jukka Rissanen f4974ca82a net: if: Cleanup network interface init macros
Avoid using #ifdefs when declaring macros twice. This way
there is only one macro that does the initialization.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-13 20:13:31 +01:00
Jukka Rissanen 9bc2815c59 net: buf: Define only one pool initializer macro
Use the IF_ENABLED() macro to define the net_buf pool initializer
macro only once. This way the initializer is only defined in
one place.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-13 20:13:24 +01:00
Adam Wojasinski 2457a942ed boards: arm: nrf5340dk_nrf5340: Add SPI to supported peripherals
The target has board configuration for spi_flash sample but bacause
of the lack of SPI mentioned in supported peripherals Twister
is filtering out the target for sample.drivers.spi.flash test.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2023-12-13 20:13:16 +01:00
Florian La Roche fdcfec0328 drivers: entropy: entropy_esp32.c: remove not necessary cast
This cast already has the correct type on both sides, so it
can be removed.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2023-12-13 20:12:54 +01:00
Florian La Roche 6621e780c9 lib: libc: minimal: proper cast to "(char *)" from "(const char *)"
The string "" is of type '(const char *)', so add a cast over to
'(char *)' to clean up source code.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2023-12-13 20:12:45 +01:00
Johann Fischer 9566419300 samples: usb: use common sample USBD initialization
Use the common USBD sample initialization helper where new USB device
support has already been added.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-12-13 17:52:00 +01:00
Johann Fischer b00a998cf1 samples: usb: add common USB device instantiation and initialization
There is common code for the new USB device support in the samples to
instantiate USB device, descriptors, configuration and initialize USB
device. Add common code that can be used for the simple usecase with a
single USB device and single configuration.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-12-13 17:52:00 +01:00
Johann Fischer 52686a8308 usb: device_next: simplify way to set/change triple code
Usually we want set all values of code triple Base Class, SubClass, and
Protocol at once. Merge existing functions to set code, subcode,
protocol into just one helper to set code triple.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-12-13 17:52:00 +01:00
Luca Burelli 2c7ea1dde5 llext: autoselect CACHE_MANAGEMENT on supported targets
Targets that have a data cache must enable CACHE_MANAGEMENT to allow the
llext API to flush it when loading an extension. This patch forces the
flag to be enabled when the target has a data cache.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2023-12-13 15:22:07 +00:00
Luca Burelli 8887402290 llext: fix: use proper global #define for cache flush
The arch_* functions are architecture-specific and may not be defined in
all targets. Use the global alias defined in the Cache API instead.

Fixes #66382.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2023-12-13 15:22:07 +00:00
Georgij Cernysiov 9f3d9f7594 drivers: spi: stm32: disable cs when spi is done
Deassert CS after SPI is done.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
Co-authored-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-12-13 13:58:03 +01:00
Evan Perry Grove 6df4576249 tests: drivers: Add nucleo_f722ze board support
Add overlays for the adc_api and counter_basic_api tests. Support
Nucleo F722ZE in the dac_api test.

Signed-off-by: Evan Perry Grove <evan@4grove.com>
2023-12-13 13:57:55 +01:00
Evan Perry Grove f93ea05895 boards: arm: Add support for ST NUCLEO F722ZE
Introduce support for ST Nucleo F722ZE, an evaluation board based on
the STM32F722ZET6U microcontroller.

Signed-off-by: Evan Perry Grove <evan@4grove.com>
2023-12-13 13:57:55 +01:00
Evan Perry Grove a54a52b085 dts: arm: Add support for STM32F722 SoC
The STM32F722 is similar to the STM32F723, but lacks the latter's
more advanced USB PHY. Otherwise, they are virtually identical.

Signed-off-by: Evan Perry Grove <evan@4grove.com>
2023-12-13 13:57:55 +01:00
Anders Storrø 25d44a828d Bluetooth: Mesh: Rename prov_dev->provisionee
Renames "prov device" references and options to
"provisionee" to align implementation with Mesh
Protocol specification v1.1, section 5.4.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-12-13 13:57:46 +01:00
Jędrzej Ciupis 00f7c0e445 modules: hal_nordic: nrf_802154: remove magic number
This commit replaces a magic number in the definition of serialization
ring buffer length with a macro provided by the 802.15.4 driver.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-12-13 13:57:24 +01:00
Jędrzej Ciupis 7afeb62e20 drivers: ieee802154: support Key Identifier Mode > 1
IEEE 802.15.4-2020 defines four possible values for Key Identifier Mode
field of the Auxiliary Security Header. The current ieee802154 driver
API only supports two of them: b00 and b01. This commit adds support for
the two remaining Key Identifier Mode values. It's done by replacing a
field that can only hold Key Index into a field that can holds a pointer
to the entire Key Identifier field.

See IEEE 802.15.4-2020, sections 9.4.2.3 and 9.4.4 for further reference.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2023-12-13 13:57:24 +01:00
Marc Herbert 13df15845e cmake: drop ERROR_QUIET in python.cmake
ERROR_QUIET should be used only when the command is actually expected to
fail, otherwise discarding stderr can be extremely time-consuming. See
recent example of time lost in commit 40c2e08e82 ("xcc/cmake: don't
discard stderr; don't (ever!) use ERROR_QUIET")

If some Python interpreter cannot even evaluate `sys.version_info[:2]`,
then we definitely don't want to hide what its stderr says about that.

Fixes commit 94de3e9f60 ("cmake: FindPython3: Adjust python3 program
search")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-13 13:56:59 +01:00
Kevin ORourke fbfd36e81e drivers: clock_control: stm32: Add HSE CSS support
Add support for enabling the clock security system, which can detect
failures of the HSE clock.

Includes tests for nucleo_h743zi and nucleo_g474re.

Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
2023-12-13 13:56:43 +01:00
Marc Desvaux c758f1cc14 drivers: usb: device: usb_dc_stm32 issue USB drivers
Isochronous endpoint issue with USB drivers on STM32G491
we setup an isochronous endpoint and are having an issue
where every other frame sends the desired data sandwiched
between garbage data.

For isochronous the parameter ep_kind into the fonction :
HAL_PCDEx_PMAConfig(PCD_HandleTypeDef *hpcd, uint16_t ep_addr,
uint16_t ep_kind, uint32_t pmaadress) must be PCD_DBL_BUF.

The parameter pmaadress (EP address in The PMA) is like that:
EP address in The PMA: In case of single buffer endpoint
this parameter is 16-bit value providing the address
in PMA allocated to endpoint.
In case of double buffer endpoint this parameter
is a 32-bit value providing the endpoint buffer 0 address
in the LSB part of 32-bit value and endpoint buffer 1 address
in the MSB part of 32-bit value.


Signed-off-by: Marc Desvaux <marc.desvaux-ext@st.com>
2023-12-13 10:40:23 +01:00
Fabiola Kwasowiec 431da79dfa hda: separation of l1 settings to new function
Separating two new functions force and allow l1
to have the current state with separated functions
in the ipc file so that SOF can call these
functions via IPC DMI_FORCE_L1_EXIT. Change related
to the addition of a new parameter to force
DMI L1 exit on IPC request.

Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com>
2023-12-13 10:39:17 +01:00
Robert Lubos 8cb4f09a28 net: tcp: Remove pointless recv callback calls
Calling the registered receive callback when releasing TCP context
doesn't make sense, as at that point the application should've already
closed the associated socket (that's one of the conditions for the
context to be released). Therefore, remove the pointless receive
callback call, while keeping the loop to unref any leftover data packets
(although again, I don' think there should be any packets left at that
point, as they're all consumed in tcp_in()).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-12-13 10:39:03 +01:00
Robert Lubos 6b00b537aa net: tcp: Fix deadlock with tcp_conn_close()
While improving thread safety of the TCP stack I've introduced a
possible deadlock scenario, when calling tcp_conn_close() in tcp_in().
This function shall not be called with connection mutex locked, as it
calls registered recv callback internally, which could lead to deadlock
between TCP/socket mutexes.

This commit moves the tcp_conn_close() back where it was originally
called. I've verified that the thread safety is still solid with the
test apps used originally.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-12-13 10:39:03 +01:00
Jeremy Bettis e268a6ce7d gpio: Add lock around registers and data
Added a spinlock to accesses of registers and struct gpio_ite_data,
except for gpio_ite_isr() function.

Bug #66401

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2023-12-13 09:56:31 +01:00
Jason Kridner 547a75d4d0 Revert "boards: arm: Fix sensor shell sample for beagleconnect_freedom board"
This reverts commit 3769938e78.

Now that gpio_i2c_switch is upstream, this hack should be removed. This
had the unintended effect of disabling the on-board sensors. The issue
was that the board was merged before this driver was upstream, resulting
in the issue this commit "fixed".

This revert also does not move the bus driver under the controller used
by the driver as the sensor bus I2C driver is not an I2C peripheral.

See:
* https://github.com/zephyrproject-rtos/zephyr/pull/64881
* https://github.com/zephyrproject-rtos/zephyr/pull/64693
* https://github.com/zephyrproject-rtos/zephyr/pull/65031

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
2023-12-13 09:42:36 +01:00
Armando Visconti 72620baefe tests: drivers: build_all: add die_temp test case
Add test case for all drivers that are supporting the die temperature
feature, and fix right away all the yet undiscovered issues.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-12-13 09:42:23 +01:00
Jukka Rissanen f9b5dc20f7 drivers: net: loopback: Do not change the original pkt
When we are sending a network pkt, do not tweak the original
packet but the cloned one. The original behavior is ok too, but
logically we should adjust the cloned packet only that is being
received by the stack. This also means that we avoid one extra
copy to tmp variable when sending the packet.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-12-13 09:42:12 +01:00
Mariusz Skamra d3d46a6d80 Bluetooth: has: Fix control point error return code
This fixes the return error code for Preset Write operation that shall
be returned when preset is not writable (or disabled via Kconfig like in
this case).

As per HAS_v1.0; 3.2.2.3 Write Preset Name operation
"If the Writable bit in the Properties field of the preset record which
is identified by the Index parameter is set to 0b0, then the server
shall return an ATT_ERROR_RSP PDU to the ATT_WRITE_REQ PDU with
the Error Code parameter set to Write Name Not Allowed."

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-12-13 09:42:04 +01:00
Alexis LECOQ 7c3853537e dts: boards: stm32h562: Adding USART11
This commit is enabling the USART11 for STM32H562/563 boards.

Signed-off-by: Alexis LECOQ <alexis.lecoq@hidglobal.com>
2023-12-13 09:41:57 +01:00
Daniel Leung 0636e52eff xtensa: rename xtensa_asm2.c to vector_handlers.c
Rename xtensa_asm2.c to have a more meaningful name to actually
reflect the content of the file. This file is mostly about
handling interrupts and exceptions (via the predefined vectors
in Xtensa core).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung b2f20d65b3 xtensa: remove z_arch_get_next_switch_handle
Fold z_arch_get_next_switch_handle() into return_to(). This is
not exactly an arch interface, and is simple enough to be
moved into return_to().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung a819bfb2d5 xtensa: rename z_xtensa to simply xtensa
Rename the remaining z_xtensa stuff as these are (mostly)
under arch/xtensa.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 6d5e0c25a6 xtensa: rename z_xtensa_irq to simple xtensa_irq
This gets rid of the z_ prefix.

Note that z_xt_*() are being used by the HAL so they cannot be
renamed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 8bf20ee975 xtensa: mmu: rename prefix z_xtensa to xtensa_mmu
This follows the idea to remove any z_ prefix. Since MMU has
a large number of these, separate out these changes into one
commit to ease review effort.

Since these are no longer have z_, these need proper doxygen
doc. So add them too.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 711622cbba xtensa: remove get_sreg macro from fatal.c
There is no in-file user. So remove it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00
Daniel Leung 004e68ccea xtensa: move exception handling func to arch internal header
z_xtensa_dump_stack() and z_xtensa_exccause() are both arch
internal functions that should not be exposed in public API.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-12-13 09:41:24 +01:00