Commit graph

98190 commits

Author SHA1 Message Date
Piotr Pryga
f0f5f28f99 soc: nrf54l15: Fix LFXO INTCAP code calculations
There were two errors in calculations of LFXO INTCAP code:
- The value provided by DTS files is internal desired capacitance.
  The value from DTS has to be "encoded" before use in INTCAP
  calculations formula. The formula for encoding is:
  CAPACITANCE_CODE = (<desired_value> - 4pF) / 0.5
  Subtract of 4 is related with lowest value in the allowed range.
  Division by 0.5 is related with change to steps size.
  In former code the subtration of 4pF was missing.

- The mid_val calcuation was wrong due offset_k left shift by 4.
  It should be left shift by 3 to get total left shift of 9.
  That matches the left shift of former part of the equation.
  Final integer value was calculated by right shift 10, it should
  be right shift 9. Then rounding was done by use of mod by (1 << 10)
  It should be mod by (1 << 9) and compared with (1 << 8), that is
  half of 0-512 range.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-06-25 10:26:11 -04:00
Anas Nashif
e0f8a8f16e twister: remove some of the confusion in terminology
Remove legacy use of 'test case' and replace with `test scenario` where
applicable.
Update terminology and some other parts of twister docs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-25 10:25:51 -04:00
Anas Nashif
6829210775 doc: ztest: Fix confusing terminology and align with twister.
Testcase definition to match what we use in twister.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-25 10:25:51 -04:00
Robert Lubos
ddf9e67169 net: lib: sockets: net_mgmt: Add note about thread priorities
Add a note about the thread priority requirements in the help string of
the Kconfig option enabling net_mgmt sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 10:25:37 -04:00
Robert Lubos
913b06251d samples: net: sockets: net_mgmt: Increase main thread priority
net_mgmt sockets do not implement internal queue but use
net_mgmt_event_wait() internally to receive events. As a consequence,
in case of events burst, some events may be lost if the receiving
thread has lower priority than the net_mgmt thread.

This was visible in the sample, where only DAD event was reported
properly, as IPv6 Add/Remove events were triggered in pair with
corresponding multicast events (from solicited-node multicast
address).

We can mitigate this by increasing main thread priority to be at the
same priority as net_mgmt thread, so that the receiving thread (main)
has a chance to run in between event reports.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-06-25 10:25:37 -04:00
Andrej Butok
fe2e560577 tests: flash_map: Increase the test coverage of supported platforms
- Increase the test coverage of supported platforms.
- Fix test_flash_area_check_int_sha256 for platforms with
  flash program size >32. Increase the supported flash program size
  to 512 (maximum supported by Zephyr platforms now).
- Fix test_flash_area_get_sectors test for platforms
  with maximum number of sectors per image slot >256.
  Increase the support value to 1024.
- Fix possible stack size overflow.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-06-25 10:25:22 -04:00
Alberto Escolar Piedras
9d9cf4d17d drivers/gpio/gpio_rzt2m: Handle trig == GPIO_INT_TRIG_WAKE
Fix a build warning due to the enumerate for the trigger
polarity possibly being (from the point of the compiler)
also GPIO_INT_TRIG_WAKE.
We fix it by simply returning a not valid argument error
which is what most other drivers do if they do something
smart enough.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-25 10:25:04 -04:00
Filip Kokosinski
243783243c MAINTAINERS: introduce the Microchip RISC-V Platforms area
This commit introduces the `Microchip RISC-V Platforms` area. This area
coveres the following current Zephyr targets:
* `m2gl025_miv`
* `mpfs_icicle`

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-06-25 06:08:57 -04:00
Filip Kokosinski
b2a061dc5d MAINTAINERS: add orphaned RISC-V boards back to the RISC-V area
This commit restores the pre-HWMv2 status of RISC-V boards being covered by
the RISC-V area of maintenance.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-06-25 06:08:57 -04:00
Grzegorz Swiderski
282f728752 doc: board_porting: Fix Kconfig.defconfig example
The part that says "Always set CONFIG_BOARD here" is outdated. In HWMv2,
CONFIG_BOARD is set by the build system, and we don't want to encourage
users to set it manually.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-06-25 06:07:21 -04:00
Aaron Ye
a7db1eab6c boards: ambiq: enable twister on apollo4x evb
This commit enables the twister on apollo4p_evb and apollo4p_blue_kxr_evb.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-06-25 06:07:08 -04:00
Aaron Ye
faf229714a soc: ambiq: apollo4x: remove untestable cache kconfig
This commit removes the untestable data and instruction cache kconfig
which causes CI failure.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-06-25 06:07:08 -04:00
Aaron Ye
ae37cc415a boards: ambiq: apollo4p_evb: add missing flash node
This commit adds the missing flash controller node in apollo4p_evb.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-06-25 06:07:08 -04:00
Dawid Niedzwiecki
b584e2c6d0 toolchain: clang: arm: do not use fp instruction when CONFIG_FPU=n
Clang uses floating-point instructions by default, even if -mfpu is not
defined. Disable using FPU when CONFIG_FPU=n.

Using floating-point instructions when FPU is not enabled generates
Usage Fault.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-06-25 06:06:36 -04:00
Manuel Argüelles
123f99c87b tests: drivers: counter: fix skip tests check
When running this test with multiple counter instances enabled that
support different capabilities, if one of the instances does not
support the test required capabilities, the test will be
immediately skipped not giving the chance to run to the subsequent
instances.

Fix this by marking the test as skipped, only of all counter instances
under test were skipped.

Fixes #74358

Signed-off-by: Manuel Argüelles <marguelles.dev@gmail.com>
2024-06-25 06:06:19 -04:00
Eunkyu Lee
e491f220d8 Bluetooth: Host: Add missing buffer length check
Modified to check the length of the remaining data in buffer
before processing the next report. The length check is missing
in the cont routine.

Signed-off-by: Eunkyu Lee <mochaccino.00.00@gmail.com>
2024-06-25 06:06:06 -04:00
Jamie McCrae
11c1f3de61 cmake: modules: extensions: Fix dts watch file processing
Fixes and simplifies the handling of how the dts watch file is
processed

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-06-25 06:05:52 -04:00
Jamie McCrae
f4cfb8cd96 cmake: modules: extension: Fix dts file watch
Fixes an issue in the code that processes the output file of a
compiler to see which files should be watched, the compiler can
combine multiple files into a single line instead of putting them
each on separate lines if the length of the file paths is short,
therefore account for this and split it up into multiple elements

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-06-25 06:05:52 -04:00
Lingao Meng
be96512d82 scripts: spelling.txt: add double prepositions
Add double prepositions to the default spelling check list.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-06-25 06:05:35 -04:00
Lingao Meng
302422ad9d everywhere: replace double words
import os
import re

common_words = set([
    'about', 'after', 'all', 'also', 'an', 'and',
     'any', 'are', 'as', 'at',
    'be', 'because', 'but', 'by', 'can', 'come',
    'could', 'day', 'do', 'even',
    'first', 'for', 'get', 'give', 'go', 'has',
    'have', 'he', 'her',
    'him', 'his', 'how', 'I', 'in', 'into', 'it',
    'its', 'just',
    'know', 'like', 'look', 'make', 'man', 'many',
    'me', 'more', 'my', 'new',
    'no', 'not', 'now', 'of', 'one', 'only', 'or',
    'other', 'our', 'out',
    'over', 'people', 'say', 'see', 'she', 'so',
    'some', 'take', 'tell', 'than',
    'their', 'them', 'then', 'there', 'these',
    'they', 'think',
    'this', 'time', 'two', 'up', 'use', 'very',
    'want', 'was', 'way',
    'we', 'well', 'what', 'when', 'which', 'who',
    'will', 'with', 'would',
    'year', 'you', 'your'
])

valid_extensions = set([
    'c', 'h', 'yaml', 'cmake', 'conf', 'txt', 'overlay',
    'rst', 'dtsi',
    'Kconfig', 'dts', 'defconfig', 'yml', 'ld', 'sh', 'py',
    'soc', 'cfg'
])

def filter_repeated_words(text):
    # Split the text into lines
    lines = text.split('\n')

    # Combine lines into a single string with unique separator
    combined_text = '/*sep*/'.join(lines)

    # Replace repeated words within a line
    def replace_within_line(match):
        return match.group(1)

    # Regex for matching repeated words within a line
    within_line_pattern =
	re.compile(r'\b(' +
		'|'.join(map(re.escape, common_words)) +
		r')\b\s+\b\1\b')
    combined_text = within_line_pattern.
		sub(replace_within_line, combined_text)

    # Replace repeated words across line boundaries
    def replace_across_lines(match):
        return match.group(1) + match.group(2)

    # Regex for matching repeated words across line boundaries
    across_lines_pattern = re.
		compile(r'\b(' + '|'.join(
			map(re.escape, common_words)) +
			r')\b(\s*[*\/\n\s]*)\b\1\b')
    combined_text = across_lines_pattern.
		sub(replace_across_lines, combined_text)

    # Split the text back into lines
    filtered_text = combined_text.split('/*sep*/')

    return '\n'.join(filtered_text)

def process_file(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        text = file.read()

    new_text = filter_repeated_words(text)

    with open(file_path, 'w', encoding='utf-8') as file:
        file.write(new_text)

def process_directory(directory_path):
    for root, dirs, files in os.walk(directory_path):
        dirs[:] = [d for d in dirs if not d.startswith('.')]
        for file in files:
            # Filter out hidden files
            if file.startswith('.'):
                continue
            file_extension = file.split('.')[-1]
            if
	file_extension in valid_extensions:  # 只处理指定后缀的文件
                file_path = os.path.join(root, file)
                print(f"Processed file: {file_path}")
                process_file(file_path)

directory_to_process = "/home/mi/works/github/zephyrproject/zephyr"
process_directory(directory_to_process)

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2024-06-25 06:05:35 -04:00
Jordan Yates
f3beebbc0f doxygen: fix undocumented parameters
Fix several doxygen warnings from undocumented parameters.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-25 06:05:20 -04:00
Maksim Salau
da9b308563 drivers: adc: saadc: Disable burst mode on unused channels
Burst mode enabled on an unused channel causes a freeze during a
conversion consisting of several channels (not including the one with
burst mode enabled).

Discovered on nRF52832 (nRF52-DK) using the following approach:
  channels 0-3 are used for application purposes as a sequence
  channel 4 is used for battery measurements with oversampling

After few successful conversions the sequence (channels 0-3) freezes the
thread while waiting for semaphore to end the conversion.

Signed-off-by: Maksim Salau <maksim.salau@gmail.com>
2024-06-25 09:04:41 +02:00
Lyle Zhu
37d62c6a16 Bluetooth: RFCOMM: check the validity of received frame
Check whether the received frame is complete by
comparing the length of the received data with
the frame data.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2024-06-25 09:03:44 +02:00
Jamie McCrae
28eb135391 doc: release: 3.7: Add note on build system changes
Adds release notes for self submitted build system changes

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-06-24 22:31:12 -04:00
Jamie McCrae
5f2a2d6e22 doc: release: 3.7: Add note on MCUboot changes
Adds release notes for MCUboot

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-06-24 22:31:12 -04:00
Martin Jäger
7bc2806b2c doc: release-notes v3.7: add LoRaWAN section
Inform about newly added support for LoRaWAN fragmented transport and
firmware-upgrade over the air (FUOTA).

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-06-24 22:28:55 -04:00
Flavio Ceolin
ba126b36ea doc: vuln: Add CVE under embargo
Add an entry to CVE-2024-6258

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-24 22:26:11 -04:00
Flavio Ceolin
bf70a80a81 doc: vuln: Add CVE under embargo
Add an entry to CVE-2024-6259

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2024-06-24 22:26:11 -04:00
Daniel Leung
5c4c31cfe0 i3c: ccc: fix missing break in switch in _do__getcaps()
In i3c_ccc_do_getcaps(), there is a missing break statement
in the switch case for GETCAPS_FORMAT_2_CRCAPS. Add it.

Fixes #74764

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-24 22:25:57 -04:00
Luis Ubieda
f21e6278dc boards: croxel_cx1825: fix: Remove arduino support claims
This board is not compatible with the Arduino pinout. Therefore,
this patch removes all Arduino references to avoid confusion and CI
failures.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-24 22:25:45 -04:00
Sreeram Tatapudi
ca674b413e dts: arm: infineon: Update cat1b MPN's
Update cat1b MPN's to reflect the current supported parts

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-06-24 22:25:32 -04:00
Nicolas Pitre
a4ebd5e8db arch/arm64/mmu: move hardware specifics to private header
None of the moved definitions are meant to be used by any code outside
of arch/arm64/core/mmu.c. Move them away from global scope to the
private header where more such definitions already live.

This is especially relevant as the previous commit fixed some of those
definitions which then caused conflicts with some external SDK that
carries a copy of those original buggy definitions.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-06-24 22:24:50 -04:00
Nicolas Pitre
1e27100442 arch/arm64/mmu: use 64-bit mask values with page table descriptors
Inverting a mask whose type has only 32 bits  doesn't produce the
expected result. Fix those to be 64-bit values.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2024-06-24 22:24:50 -04:00
Glenn Andrews
895f246227 Lib: SMF: Add test for stuck handled bit
Update test_lib_self_transition_smf.c to detect the bug that was in
smf_set_handled().

Also delete unneeded test state STATE_D_ENTRY

Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
2024-06-24 14:50:00 -04:00
Glenn Andrews
27d7e38ee0 Lib: SMF: Refactor test_lib_self_transition_smf.c
Make the code less dependent on
magic #defines by using a single enum for test states.

Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
2024-06-24 14:50:00 -04:00
Glenn Andrews
87db81e5cd Lib: SMF: fix stuck handled bit when transitioning
If both `smf_set_state()` and `smf_set_handled()` are called in
a run action, the `internal->handled` bit would not be reset.

This could cause an issue on the next run action by not
propagating events to parents.

Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
2024-06-24 14:50:00 -04:00
Henrik Brix Andersen
adccdd9fa6 boards: nxp: lpcxpresso551s16: enable usbphy1
Enable the USB1 High Speed PHY on the NXP LPCXpresso55S16 development
board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-06-24 14:49:45 -04:00
Henrik Brix Andersen
ca69e06940 dts: arm: nxp: lpc55s1x: add usbphy1 devicetree node
Add devicetree node for the USB1 High Speed PHY present in the NXP LPC55S1x
series.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2024-06-24 14:49:45 -04:00
Andrej Butok
fdfebdd15b soc: lpc: mcxn: fix the flash_fill() fail.
- Fix flash_fill() for lpc55 and mcxnx4.
- Set FLASH_FILL_BUFFER_SIZE to the minimal size of data
  which can be written to a device (by default is only 32).
- Fix the [flash_map.test_flash_area_erase_and_flatten]
  failed test of tests/subsys/storage/flash_map.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-06-24 14:49:32 -04:00
Sylvio Alves
6b4beb9494 drivers: eth_esp32: fix function call as from hal
When external PHY has crystal, ESP32 can be configured
to use custom GPIO as clock source for it. However, due to
latest clock subsystem and hal updates, current driver
fails to build and blocks its usage.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-06-24 14:49:16 -04:00
Sylvio Alves
cc29fc1182 driver: eth_esp32: fix shared clock check
Both MDIO and Ethernet drivers share the same clock subsystem.
After clock control update in #73807, clock_control_on()
now returns -EALREADY for already initialized clock subsystem.
As a result, ethernet driver won't initialize as needed.

Fixes #74440

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-06-24 14:49:16 -04:00
Ali Hozhabri
3b726dee53 Bluetooth: Host: Fix HCI command timeout usage
Fix Bluetooth initialization problem caused by PR#72090
for at least ST boards that are using BlueNRG BLE modules.

For more information, please refer to issue #74528.

Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
2024-06-24 14:48:25 -04:00
Bjarki Arge Andreasen
9d761a1769 drivers: rtc: rtc_ll_stm32: coverity 368806 fix
Replace DIV_ROUND_CLOSEST() with a normal division to simplify
operation and avoid redundant handling of signed integer rounding
as the temp value is an unsigned value. The temp value is in nano
precision, so rounding is largely inconsequencial anyway compared
to the comparatively low precision sync prescaler.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-24 14:48:15 -04:00
Jukka Rissanen
c706b9031c net: if: Make sure interface name can contain terminating null
The minimum length for the network interface buffer is 2 so that we
can have terminating null there.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-24 14:48:03 -04:00
Jukka Rissanen
8c1834a25a net: dns: mdns_responder: Interface name might miss terminating null
The network interface name that is copied to if_req struct might
be missing terminating null.

Fixes #74795
Coverity-CID: 368797

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-24 14:48:03 -04:00
Jukka Rissanen
b1a1a534ff net: websocket: Remove dead code
The zsock_close() is not needed as the fd is always <0 so
the close is never called.

Fixes #74791
Coverity-CID: 366273

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-24 14:47:52 -04:00
Jukka Rissanen
2ed2d38d7d shell: backend: uart: Fix POSIX name conflict
If CONFIG_POSIX_API is enabled, the read() and write() function
names will conflict.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-06-24 12:45:46 -04:00
Francois Ramu
e0c25089e3 samples: drivers spi_flash on the external NORof stm32h5 disco kit
Define the configuration to run the test on the external memory
xspi flash of the stm32h573i_dk disco kit in MemoryMapped Mode
Reading is done with memcopy and erase/write are aborting operation
to send the appropriate command

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-24 12:45:34 -04:00
Francois Ramu
2f0dd2c66f samples: code relocation in external memory of stm32h5 disco kit
Define the configuration to run the code_relocation
application on the external memory xspi flash
of the stm32h573i_dk disco kit in XIP

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-24 12:45:34 -04:00
Francois Ramu
ead5c84547 boards: arm: stm32h573 disco kit can flash on external NOR
Configure the external NOR flash memory to be executable.
Change the board.cmake to add the external loader for
flashing (version that do not mass-erase the external flash).
The address of the external flash is not needed
when flashing a hex file.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-24 12:45:34 -04:00