Commit Graph

84 Commits

Author SHA1 Message Date
Alberto Escolar Piedras 2324d5daa1 doc nrf54l15bsim: Clarify the L10 and L05 are also covered
Clarify that one can simulate equally well the nRF54L10 and L05
variants with this target.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 13:30:49 -05:00
Alberto Escolar Piedras 5e6c28bfa3 doc nrf54l15bsim: Remove experimental warning
This target simulated is reasonably tested.
Let's stop warning about it being experimental.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-16 13:30:49 -05:00
Alberto Escolar Piedras 24c2c43bcd boards nrf52_bsim: Fix sample used as example
Let's fix the sample used in the example. The peripheral_hr and
central_hr are meant to be run with each other.
Let's also use the :zephyr:code-sample: directive to refer to the
samples so we get a link.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-15 08:10:08 -06:00
Alberto Escolar Piedras a8d28928ed boards: nrf54l15bsim doc: Clarify around entropy and crypto
Let's explicitly mention we are enabling the native_posix entropy
driver for this board (the real nrf54l15dk does not have an entropy
driver in Zephyr yet).
And correct a bit the wording around mbedtls as for the real target we
don't have mbedtls with HW acceleration.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-11-01 09:56:18 -05:00
Benjamin Cabé 14d0a19cc2 doc: fix occurrences of broken zephyr_file: links
In preparation of adding a check for dead references, this commit fixes
currently broken zehpyr_file: links.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-30 09:43:50 -07:00
Alberto Escolar Piedras 1c7540883f boards nrf_bsim: Add NVIC_GetPendingIRQ() equivalent
Add a substitute for NVIC_GetPendingIRQ()

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-24 17:01:50 +01:00
Alberto Escolar Piedras c4e6ec89a7 boards nrf_bsim: Provide IRQ_PRIO_LOWEST
Some apps use it, so let's provide it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-24 17:01:50 +01:00
Krzysztof Chruściński ec224fde28 boards: native: nrf_bsim: Add include path to common
Add include path to nordic/soc/nordic/common where some internal
headers for nordic devices are kept (e.g. dmm.h).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-21 18:40:57 -05:00
Benjamin Cabé 05d59f7207 boards: Set full_name for all boards
Full name was set based on the information available either in board
documentation or in Twister files.
Whenever applicable, vendor name was dropped from the full name so that
all boards have a consistent naming scheme.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-10 20:22:21 -04:00
Pieter De Gendt de93f95622 boards: native: Add display to native board features
Add a 'display' entry for the native sim/posix supported features.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-10 14:58:13 -04:00
Dominik Lau 8941a2100c samples: drivers: added a simple touch controller sample
The sample is supposed to help examine the issues with touchscreen.
It draws a plus in last touched position.

Signed-off-by: Dominik Lau <dlau@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2024-10-09 18:11:21 +01:00
Alberto Escolar Piedras afbba5fb9b boards native_sim docs: Clarify which SDL version is needed
One needs the 32bit version of the SDL development library when
building for 32bit native_sim, and for the 64bit native_sim the
64bit version. Let's clarify this.

Also fix the SDL2 link.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-07 13:39:00 +02:00
Alberto Escolar Piedras 3ee9b40a5a eeprom sim: Enhance & refactor native part so it works w emb libCs
For the parts of the simulator which are dedicated for the native
platforms (POSIX arch based):
* Refactor the parts that interacts with the host, so it is possible to
  use it also with embedded libCs
* Enhance it with more options to allow:
  * Keeping the content just in RAM
  * Erasing the EEPROM file at exit
  * Clearing the file at boot
* Also show in the command line help the default file name.

As part of this:

* Update the kconfig dependencies, so we allow building it with other
  C libraries in the native targets
* Update the table in the native_sim docs to indicate all C libraries
  are supproted now

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-02 09:48:12 +02:00
Alberto Escolar Piedras d67d64de91 boards/native/doc: Update architecture description
The architecture description was quite out of date in some parts,
specially those which changed with the introduction of the native
simulator.
Let's update it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-27 14:30:39 +01:00
Alberto Escolar Piedras 5efe751240 boards native: Add function to remap embedded address
Add a function which can be used to remap embedded device address,
into addresses which can be used in the simulated native boards.

For the nrf_bsim boards we provide an actual implementation.
For other boards, we provide an optional dummy version which does
nothing.
It is up to each board implementation to decide if they want to
provide one or use the dummy.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-26 03:34:26 -04:00
Ivan Iushkov e35781419b dts: nordic: Add Channel Sounding support to nrf-radio
- Added `cs-supported` property to nrf-radio devicetree
- Added `HAS_HW_NRF_RADIO_CS` Kconfig option which is set if
`cs-supported` property is enabled
- Enabled `cs-supported` property for nrf54-series devices
- Disabled `cs-supported` on nrf54l15bsim because it is not
yet supported

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2024-09-26 03:32:03 -04:00
Alberto Escolar Piedras 50f2800d80 boards nrfbsim docs: Explain relation between native sim and nrfbsim
Add a section to the docs ellaborating on the relationship between
Zephyr, the native simulator, the nRF HW models and BabbleSim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-19 03:27:22 -04:00
Benjamin Cabé df294e34e1 doc: sphinx-lint: fix bad usage of "default role"
Fixes bad usage of single backticks in lieu of double backticks for
rendering inline literals, or simple '*' for italics.

When appropriate, a better construct than double backticks has been
selected (ex. :file:, :kconfig:option:, :c:func:, ...), or proper :ref:
have been used if the original intention was to have a link.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-13 11:42:51 -05:00
Alberto Escolar Piedras ecb23433c7 boards: nrf_bsim: Move ipc backend next to .data
To avoid possible linker warnings, when the linker may end up placing
this section in a segment with text and therefore with execute
permissions, with let's move it next to the .data section.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-12 14:47:57 +02:00
Alberto Escolar Piedras 11cde13b94 board: nrf54l15bsim: Disable native_posix entropy seeding
Let's disable the default seeding done by the native_posix
entropy driver to allow the normal simulation initialization
of the random number generation to take place.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-05 16:56:33 -04:00
Florian Grandel 2d8b272ab5 tools: net-tools: place net-tools inside tools
Updates references to the net-tools project  to refer to the correct
placement of net-tools under tools.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-09-05 12:34:09 -05:00
Jordan Yates 51c0cb9f5c dts: common: nordic: default memory partitioning
Add default memory partitioning for the nRF53 and nRF91 series devices.
As these partitions refer to TF-M and the TF-M layouts cannot be
modified, use the partitioning scheme from TF-M.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-09-04 12:52:31 +02:00
Alberto Escolar Piedras c2c17ea733 boards: nrf54l15bsim: Compare it to the DK instead of the PDK
The nrf54l15dk is now avaliable in the tree.
Let's compare the simulated board to this one instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-04 09:52:57 +02:00
Alberto Escolar Piedras 8a7c16c9da boards: nrf54l15_bsim: Update docs including AAR,CCM, ECB
These peripherals are now included. Let's mention them
and remove the warning about them being missing.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-04 09:52:57 +02:00
Alberto Escolar Piedras b03db5e4c9 boards: nrf54l15_bsim: Actively set psa-rng to disabled
This target does not yet support the PSA random generator.
Lets explicitly set it to disabled, to even if the
SOC definition sets it to "okay" it is not built in
by default.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-04 09:52:57 +02:00
Alberto Escolar Piedras f2711b20b6 boards: nrf54l15bsim: DTS cleanup
Remove 3 delete-node directives which do not apply to this
SOC.
They made it in originally thru a copy paste mistake
from the nrf5340bsim dts file.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-04 09:52:40 +02:00
Gerard Marull-Paretas 12199258d8 boards: remove MBOX_NRFX_IPC default from nRF5340 based boards
It is no longer needed, Kconfig option is enabled based on DT status.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-16 11:20:08 +01:00
Alberto Escolar Piedras 0be493ca7a boards/native/nrf_bsim/common/cmdline.h: Update comments
Replace native_posix w native_sim in the comments,
and account for the fact that we have several nrf bsim targets now

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-16 09:21:18 +01:00
Alberto Escolar Piedras 4ea61a794b docs: boards native: Remove mentions of native_posix
native_posix is deprecated. Let's remove its mentions
from the general docs and figures.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-16 09:21:18 +01:00
Alberto Escolar Piedras 84ce8221bb native_posix docs: Warn users about the deprecation
So they switch to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-13 18:18:10 -04:00
Alberto Escolar Piedras b969dc93fc native_posix: deprecate with planned removal for 4.2
native_posix has been replaced with native_sim.
Users have been encouraged to switch since 3.6.

We deprecate it now, and plan to remove it in 4.2.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-08-13 18:18:10 -04:00
Yuval Peress c394b2e6f8 test: Add i2c emulation for targets
Update i2c_emul.c to support i2c_target_register and i2c_target_unregister
function calls as well as support address forwarding in emulation.
Address forwarding helps us test IPCs in native sim. Instead of having to
emulate 2 separate cores, we can forward read/write requests from one bus
to another bus (effectively creating a loop). This way the same image can
simulate both the controller and the target.

Signed-off-by: Yuval Peress <peress@google.com>
2024-08-09 08:40:51 -04:00
Gerard Marull-Paretas 4a1834cef7 boards: nrf53: remove redundant cpunet initialization code
This is now handled at SoC level, avoiding code duplicates.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-08-01 08:56:56 +01:00
Kacper Dalach 32eb346e05 posix: can: if name from command-line
This commit introduces the ability to set the CAN
interface from command-line. This is helpful
if we want to run multiple instances of the app
with different CAN interfaces without making
separate compilations for each instance.

Signed-off-by: Kacper Dalach <dalachowsky@gmail.com>
2024-07-27 20:49:38 +03:00
Alberto Escolar Piedras 7826f7cd20 boards: nrfbsim: Fix testargs with non host libC
Ensure that we call the host libC when allocating space
for a possible set of test arguments even if we are
building Zephyr with an embedded libC.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-07-06 17:03:26 +02: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
Swift Tian 99175e1443 boards: dts: Add MSPI controller to native_sim
Add the MSPI emulator controller node in the board dts.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-06-14 21:07:00 -04:00
Johan Hedberg 6e584a4773 Bluetooth: drivers: Convert IPC driver to new API
Convert the ipc.c HCI driver to the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg bb91aa0b7f Bluetooth: drivers: Convert userchan driver to new API
Convert the HCI User Channel driver to use the new HCI driver API.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg db753c1474 boards: nrf52_bsim: Add support for using UART as HCI
Add support for using an UART instead of the native controller. This is
accomplished with a custom DTS overlay for the tests that require it.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Johan Hedberg 97c3a1e4be Bluetooth: drivers: hci: Get rid of Kconfig choice
The drivers should be independent after the move to the new HCI driver
API. Having them as a choice also has unexpected consequences with some
drivers being unexpectedly enabled.

Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
2024-06-11 19:42:49 -04:00
Alberto Escolar Piedras 4b64e001fe boards nrf54l15bsim: DT: Set radio status as ok
Set the radio status as ok as the SOC/CPU DT include
does not do it for us.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-04 14:04:57 -05:00
Alberto Escolar Piedras 329dbeae0a boards: nrf54l15bsim: Mention CLOCK
As now we have a sufficient model of the CLOCK peripheral,
let's mention it in the docs, and correct the warning
about not supporting the BLE stack.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-04 14:04:57 -05:00
Alberto Escolar Piedras e998741427 boards nrf54l15bsim: Default to build BT Controller if BT
Just as for the other simulated targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-04 14:04:57 -05:00
Alberto Escolar Piedras 61db56915f boards nrf54l15bsim: Set clock status as ok in DT
So the nRF clock driver is built in as in real
targets.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-04 14:04:57 -05:00
Alberto Escolar Piedras 68adc77cbd boards nrf_bsim: Add NVIC_GetEnableIRQ()
Provide a replacement for CMSIS' NVIC_GetEnableIRQ()
as some applications use it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-03 15:27:48 -04:00
Alberto Escolar Piedras fa9a5962b5 boards nrf54l15bsim: Update docs as we now have RADIO
Mention that we have the RADIO peripheral,
but no encryption accelerators yet.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-30 04:49:22 -07:00
Alberto Escolar Piedras 64a53d0921 boards nrf54l15bsim//cpuapp: Don't remove RADIO in DT
The RADIO models now contain the radio,
let's stop removing it, but as they do not support DFE,
let's disable DFE.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-30 04:49:22 -07:00
Swift Tian d65d298280 boards: native: fixed i2c dependency loop
This was discovered when trying to add select GPIO to emulator Kconfig.

Signed-off-by: Swift Tian <swift.tian@ambiq.com>
2024-05-24 18:03:44 -04:00
Alberto Escolar Piedras cb7f20f436 boards nrf54l15bsim: Update docs with RRAMC, FICR and UICR mention
This board HW models now include the RRAMC, FICR and UICR.
Let's update the docs accordingly.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-22 13:44:54 -05:00