Commit f55358bcbf changed all hex values to
use lowercase characters. Update the test accordingly.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This makes using instrumentation with any sample/board combination
much easier, as it eliminates the need to define a custom dt overlay.
Trigger/stopper functions need to be configured at build time.
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
When pykwalify was changed to jsonschema in commit 58bf2dc the optionality
of 'click-through' was lost. Fix this by making sure there's always a value
in the dictionary, eliminating the following error when the key is missing:
if blob['click-through'] and not args.auto_accept:
~~~~^^^^^^^^^^^^^^^^^
KeyError: 'click-through'
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
The AnyNode class has a `size` property which hides the value sourced from
JSON key 'size', resulting in the script displaying nonsense. Consume the
proper value by directly accessing the __dict__ which holds it instead of
relying on the dot operator.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Add boolean_strict_init.cocci to detect improper boolean initialization
and assignment using integer literals (0/1) instead of true/false.
This enforces Zephyr coding guideline #59 (MISRA C:2012 Rule 10.1)
which states that operands shall not be of an inappropriate essential
type.
Rules added:
- rule1_init: detects bool var = 0/1 initialization
- rule2_assign: detects bool_var = 0/1 assignment
The original boolean.cocci (Rule 14.4) remains disabled due to
performance issues on large files causing CI timeouts. See PR #34773.
Enable boolean_strict_init.cocci in guideline_check.py so CI runs this
check on changed files.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Apply chnages from dts-linter 0.3.9.
Improve compliance with DTS Coding Style which says that:
4) Hex values in properties, e.g. “reg”, shall use lowercase hex.
The address part can be padded with leading zeros.
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
Update DTS linter apply lowercase hex values in DTS files
Improve compliance with DTS Coding Style which says that:
4) Hex values in properties, e.g. “reg”, shall use lowercase hex.
The address part can be padded with leading zeros.
This need dts-linter 0.3.9
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
when --file-type is provided without --file, automatically select
the corresponding build artifact (zephyr.hex, zephyr.bin, or
zephyr.elf) instead of requiring the user to specify both flags.
the validation that --file-type requires --file is preserved in
core.py, but run_common.py now auto-populates --file before the
validation runs.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Exclulde `tests/posix/` when running coccinelle checks for reserved names
since POSIX implements much of the reserved names.
This avoids the following failure in CI
```shell
Error: tests/posix/xsi_single_process/src/putenv.c:12: WARNING: \
Violation to rule 21.2 (Should not used a reserved identifier) - putenv
```
Signed-off-by: Chris Friedt <chris@fr4.co>
The generated lists have a trailing semicolon, which for CMake would
indicate a trailing empty item.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assign a platform to the test so Twister doesn't
pick up multiple platforms.
This reduces the test time by ~2 minutes.
Before: 9 passed in 265.88s (0:04:25)
After: 9 passed in 140.24s (0:02:20)
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
Move a check to run earlier in a for-loop to minimize doing unnecessary
work like creating TestInstance class instances.
This is a very minor optimization when the number of testsuites are low.
But starts to count when there are a lot of testsuites.
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
TLS sections (e.g. .tdata/.tbss) use addresses as TLS offsets and can
overlap normal VMA ranges. Avoid using TLS section address ranges for RAM
bucketing and classify TLS symbols using section flags instead.
Signed-off-by: Jon Ringle <jringle@gridpoint.com>
Introduce a new Zephyr runner, `lldbac`, providing interactive debugging
for both nSIM (simulator) and physical hardware using the run-lldbac
tool from Synopsys ARC MWDT.
This runner provides integrated debugging support:
- debug: Interactive debugging with integrated server management,
Available for both simulator and hardware (integrated mode)
- flash: Flash and run on physical hardware,
Available for hardware only (simulator should use arc-nsim)
Key features:
- Hardware mode: Flash and debug on physical hardware using JTAG flags
- Simulator mode: Interactive debugging on nSIM using run-lldbac with
--nsim flag (props or --tcf). Enable with --simulator flag.
- Board-driven config: Boards can specify defaults in board.cmake
- TCF support: Optional --tcf for simulator mode (mutually exclusive
with --nsim-props)
- GUI support: Optional --gui flag for VS Code debugging
- Postconnect support: Execute commands after connection via
--postconnect-cmd and --postconnect-file for hardware initialization
- Board JSON: Optional --board-json for complex board configurations
Hardware configuration (flag-based):
- --jtag-device: JTAG device name (optional, auto-detected)
- --jtag: JTAG adapter type (default: jtag-digilent)
- --jtag-frequency: JTAG clock frequency (default: 500KHz)
- --postconnect-cmd: Command to execute after connection
(can be used multiple times)
- --postconnect-file: File containing commands to execute after
hardware initialization
- --board-json: Path to board.json file for board configuration
Simulator configuration:
- --simulator: Enable simulator mode (required)
- --nsim-props: nSIM properties file path
- --tcf: Tool Configuration File (alternative to --nsim-props)
Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
Currently apply_filters is parsing & validating a snippet YAML
file multiple times, duplicating expensive work.
Do the work once per testsuite instead of for each testsuite
multiplied by number of toolchains.
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
Exit from twister in case of user's error e.g. empty list
of tests provided by user instead of throwing unhandled
exception.
Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
When running check_compliance downstream the prefix path is not correct.
This need to be relative to zepphyr base.
This PR ensure that the prefix is set correctly when invoking dts-linter
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
In C, character literals have type int, so using sizeof() on a
character literal evaluates to sizeof(int) and can easily lead to
subtle size miscalculations.
Add a new checkpatch warning to flag sizeof() usage on character
literals and suggest using an explicit cast instead.
Signed-off-by: Somil Gupta <somil24559@iiitd.ac.in>
For Windows, if the build dir is under same drive with zephyr base, the
generated link shall be relative url like posix style.
If they are in different drive, url is meaningless. So just use raw link
format so that some editors can directly jump to.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
When the LLEXT subsystem detects that a symbol is marked for export from
the main image, but the symbol group in which the export belongs is not
enabled, add a marker in a special section in addition to not placing the
symbol in the final export table.
Add a post-build script which consumes the special section as post-build to
dump information about all discarded symbols in a build artifact, and also
check for common errors (missing Kconfig symbol / improperly named groups).
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Move ELF-related utilities from the "llext_prepare_exptab" script to a
dedicated "llext_elf_toolkit" which can be reused by other LLEXT scripts.
While at it, also improve documentation of class SectionDescriptor.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
add dt_node_array_prop_has_val function and
extend dt_nodelabel_array_prop_has_val to be
used with string-arrays.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Fixes this function so that it returns the unit address of the
node, without having to rely on odd tricks to locate various parent
nodes and check that they have reg addresses and perform additions
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
When YAML binding files specify values in hexadecimal notation, this
information was previously lost during parsing as PyYAML converts hex to
regular integers.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This change introduces generating definitions corresponding to
`*-map` property, which was currently discarded.
For `*-map` properties are made able to be treated as a variation
of phandle-array, assign sequential cell names for each group of
specifiers (child_specifier_0, child_specifier_1, ...,
parent_specifier_0, ...).
The `*-map` data is like a two-dimensional array, so it is difficult to
handle with the existing APIs, so we will also provide new APIs.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
1. Load and validate the schema only once
2. Use CSafeLoader if it's available
3. Read YAML files in binary mode
This reduces the execution time of snippets.py from ~380ms
down to ~160ms when I build samples/basic/blinky for
nrf52dk/nrf52832
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
The value os board qualifiers in CMake and Kconfig differs.
CMake has a leading '/', as example:
CMake: BOARD_QUALIFIERS=/nrf52840
Kconfig: BOARD_QUALIFIERS=nrf52840
This was also discussed in
https://github.com/zephyrproject-rtos/zephyr/pull/69740
This commit aligns the value of the CMake variable BOARD_QUALIFIERS to
the value of BOARD_QUALIFIERS (CONFIG_BOARD_QUALIFIERS) in Kconfig.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Align the OpenOCD runner with the JLink runner by adopting the
framework's standard file selection mechanism:
- Add file=True to RunnerCaps to enable --file and --file-type args
- Deprecate --use-hex, --use-elf, --use-bin flags (still work with
warning)
- Use FileType enum instead of string comparisons
- Support --file for custom file paths (like JLink)
- Store hex_name and bin_name alongside elf_name for consistency
Also remove the framework constraint that --file-type requires --file,
allowing boards to specify a preferred file format via board.cmake
without providing a custom file path.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
When running twister on Windows host, the build will fail from
cmakecache.py with error as:
UnicodeDecodeError: 'cp950' codec can't decode byte 0xe2 in
position 3444: illegal multibyte sequence
Signed-off-by: Sharon Lin <slin@atmosic.com>
jsonschema is more strict when it comes to typing and only allows
strings for 'serial' in hwmap-schema.yaml.
Since 'serial' is not a required key in the schema, this commit
removes the 'serial' key from generated hardware maps when the
'serial' value is empty /unknown.
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>