Commit graph

57915 commits

Author SHA1 Message Date
Michel Haber
9d815e5251 timing: use runtime cycles for cortex-m systick
Use sys_clock_hw_cycles_per_sec() instead of
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC to determine clock cycles.

Signed-off-by: Michel Haber <michel-haber@hotmail.com>
2021-11-16 10:43:18 +01:00
Vinayak Kariappa Chettimada
c025e07557 Bluetooth: Controller: Fix DTM HCI command returned error codes
Fix DTM HCI command returned error codes.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-16 10:42:38 +01:00
Vinayak Kariappa Chettimada
ee40950282 Bluetooth: Controller: Fix missing DTM Tx/Rx reset on HCI Reset Command
Fix missing implementation to reset DTM Tx/Rx reset on HCI
Reset Command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-16 10:42:38 +01:00
Torsten Rasmussen
1594cd38b2 doc: zephyr build process description
Updated the Zephyr build process description to include description of
all Zephyr link stages.

It extends the guide with description of the intermediate binaries as
well as the post-processing of those binaries.
- Unfixed size binary
- Fixed size binary

Post-processing
- Partition alignment
- ISR table generation

Build stages images has been updated and new images showing the
post-processing stages of the intermediate binaries has been added.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-11-16 10:41:59 +01:00
Jordan Yates
44b8a0d199 scripts: gen_handles.py: remove size restrictions
With `gen_handles.py` now running on the first pre-built image,
`zephyr_pre0.elf` there is no requirement for the device handle arrays
to remain the same size after processing.

Remove the padding generated in `gen_handles.py`, as well as the
temporary option `CONFIG_DEVICE_HANDLE_PADDING` which was added to work
around this issue.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-16 10:41:59 +01:00
Jordan Yates
28b2e55321 cmake: rework linker script generation and linker prebuilt stages
This commit reworks the linker script generation and linking stages in
order to better support fixed section location as required by #38836.

Today we have the following generated linker scripts and the elf output
depending on the system configuration:
- linker_app_smem_unaligned.cmd --> app_smem_unaligned_prebuilt.elf
- linker_zephyr_prebuilt.cmd    --> zephyr_prebuilt.elf
- linker.cmd                    --> zephyr.elf

as not all linker scripts may be created and as there is a need for the
possibility to move gen handles earlier then those stages has been
renamed into more generic names so that with this commit we have:
- linker_zephyr_pre0.cmd --> zephyr_pre0.elf
- linker_zephyr_pre1.cmd --> zephyr_pre1.elf
- linker.cmd             --> zephyr.elf

This also means that is the stage zephyr_pre1 is not needed, then build
can go from `zephyr_pre0.elf` to `zephyr.elf`.

The gen_handles.py has been changed so it now uses `zephyr_pre0.elf` as
input. This ensures that the handles array are final when invoking the
next build and linking stages.

To keep the current behavior of generating the isr table and kobj hash
of what was `zephyr_prebuilt` stage the code blocks contolling isr
generation and kobj hash has been relocated to be located after
app_smem and device handle generation.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-11-16 10:41:59 +01:00
Jordan Yates
8d93217af4 cmake: new global property for generated files
Introduce a new global property for source files that are generated from
the initial Zephyr link (app_smem_unaligned_prebuilt). This source list
is used for files which will introduce address shifts into the final
binary, which need to be present in `zephyr_prebuilt.elf` for
`CONFIG_USERSPACE` scripts to correctly generate `zephyr.elf`.

This resolves #38836.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-16 10:41:59 +01:00
Jordan Yates
c03e658369 cmake: update desc of GENERATED_KERNEL_* variables
The previous description of the `GENERATED_KERNEL_*` cmake variables
was incorrect in that these are generated after the second link stage
when `CONFIG_USERSPACE` is enabled.

The sources in these variables are generated from `zephyr_prebuilt.elf`
for inclusion in `zephyr.elf`. However `zephyr_prebuilt.elf` is preceded
by `app_smem_unaligned_prebuilt.elf` when `CONFIG_USERSPACE` is enabled.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-16 10:41:59 +01:00
Anas Nashif
aace2da700 actions: follow namespace for job names
To avoid conflicts in reporting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 15:07:07 -06:00
Anas Nashif
5da807d57d actions: conflict: update version
Use released version instead of master.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 15:07:07 -06:00
Anas Nashif
e50cbdb9f8 actions: compliance: minor improvements
Namespace job names and retry west update if something goes wrong the
first time.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 15:07:07 -06:00
Anas Nashif
e49240941f actions: bluetooth: rename action and make it obvious
Rename to make action file name obvious referring to bluetooth, rather
than the tool used.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 15:07:07 -06:00
Anas Nashif
75b7a35aec actions: bluetooth: fix job names and description
Misc fixes including:
- unique job names
- Change description to mention Bluetooth
- Retry west update
- Use latest unit test publication action

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 15:07:07 -06:00
Joakim Andersson
9b87d6f7fc modules: tfm: Fix cmake warnings for unused variables
Fix cmake warnings for TF-M build system when PSA tests are not enabled.
This produces the following warnings:
"
CMake Warning:
  Manually-specified variables were not used by the project:

    PSA_TOOLCHAIN_FILE
    TOOLCHAIN
"

These warnings can point to cache or config variables being updated in
the TF-M build system so keep this free of warnings.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-15 14:54:48 -05:00
Michał Barnaś
34d449df79 linker: add DWARF-5 debug sections
DWARF-5 standard replaced the location list (.debug_loc) and range
list (.debug_ranges) sections with new sections (.debug_loclists
and .debug_rnglists).
They weren't handled which resulted in many orphan sections
reported as warnings by linker.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2021-11-15 14:52:25 -05:00
Eduardo Montoya
68d34e4adb openthread: upmerge up to commit c02d1110
Regular upmerge.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-11-15 14:45:08 -05:00
Immo Birnbaum
99b7e9d860 boards: arm: qemu_cortex_a9: change board's timing parameters
- Fix the system clock frequency: should be 111.1 MHz instead
of 100 MHz.
- Set ticks per second to 1000 for higher system clock precision.
- Set QEMU icount shift value to 3 so that one instruction gets
executed every 2^3 = 8 ns.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@Weidmueller.com>
2021-11-15 14:44:56 -05:00
Emil Gydesen
c8f08c9e94 Bluetooth: ISO: Update loop variables types in iso.c
Some of the loop variables used `int` where it
makes more sense to use `size_t` or `uint8_t`.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
db29cea01c Bluetooth: ISO: Add CIG state machine
Add a state to the bt_iso_cig struct. This makes
checks for the CIG state easier, and follows the
state machine in the core spec.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
65620363e3 Bluetooth: ISO: Add CIG reconfigure function
Add function to reconfigure and even add additional
CIS to a CIG.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
be1912b66a Bluetooth: ISO: Move validation of CIG parameters to function
Move the validation of specific CIG parameters to its
own function. This is mainly to be able to reuse it for
validationg CIG refconfiguration parameters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
19c032ed78 Bluetooth: ISO: Rename bt_iso_cig_create_param
Renames the struct from bt_iso_cig_create_param to
bt_iso_cig_param as the same struct can, without
modification, be used to update the CIG as well
(function to support that will come in a later commit).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
3f345132e0 Bluetooth: ISO: Move cis/bis param checks to earlier
Move the verification of the individual cis/bis checks to
an earlier point, because we actually start allocating
resources for the groups.

This removes a double check for NULL, while also
allows us to terminate earlier if there were any
issues.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
2b58a94ab2 Bluetooth: ISO: Rename cis/bis in cig/big to cis/bis channels
Rename the field in the struct to x_channels to make
it more clear what the field represents.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
ba0a053f94 Bluetooth: ISO: Change CIG/BIG to use slist instead of array
A CIG may be updated later to include more CIS, and thus a slist
makes more sense.

The BIG doesn't need the change, but it makes more sense to
have similar handling for both.

This change also removes the requirement that the arrays
used to create the CIG/BIG need to static.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Adhipta Putra
2d9a4d13c0 Bluetooth: Controller: Updated code indent to use tabs
Replacing spaces code indent

Signed-off-by: Adhipta Putra <adhipta.putra@nordicsemi.no>
2021-11-15 14:39:43 -05:00
Adhipta Putra
f3654fc4f9 Bluetooth: Controller: Added PDU_CRC_POLYNOMIAL
Replacing RADIO_CRC_POLYNOMIAL

Signed-off-by: Adhipta Putra <adhipta.putra@nordicsemi.no>
2021-11-15 14:39:43 -05:00
Adhipta Putra
8a9711b48f Bluetooth: Controller: Use sys_get_le24 to fetch 24-bit data
Use sys_get_le24 to pass crc init value input

Signed-off-by: Adhipta Putra <adhipta.putra@nordicsemi.no>
2021-11-15 14:39:43 -05:00
Maureen Helm
836651b453 drivers: gpio: Refactor drivers to use shared init priority
Refactors all of the on-chip GPIO drivers to use a shared driver class
initialization priority configuration, CONFIG_GPIO_INIT_PRIORITY, to
allow configuring GPIO drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

Most drivers previously used CONFIG_KERNEL_INIT_PRIORITY_DEFAULT or
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, therefore the default for this new
option is the lower of the two, which means earlier initialization.

Driver-specific options for off-chip I2C- or SPI-based GPIO drivers are
left intact because they often need to be initialized at a different
priority than on-chip GPIO drivers.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-11-15 14:38:55 -05:00
Anas Nashif
a5c2a6169b actions: footprint: fix csv formatting
Fix formatting of plan.txt CSV file and make it parseable by script.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-15 11:12:05 -05:00
Nicolas Pitre
5aeb809374 lib/os/heap-validate: code cleanup
Remove code duplication, use common code idiom, etc.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-11-15 11:03:57 -05:00
Nicolas Pitre
f13387d8d2 lib/os/heap: fix a type
Rationale in commit b1eefc0c26 ("lib/os/heap: straighten up our type
usage").

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-11-15 11:03:57 -05:00
Eug Krashtan
806ce3723d net: coap: add response code 4.29
Extend coap.h with response code "Too Many Requests" according
to RFC 8516

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2021-11-15 10:14:42 -05:00
Gerard Marull-Paretas
fc4e8b016d tracing: macros: improve Doxygen
- Include macros in the `subsys_tracing` group
- Hide internal macros/helpers
- Fix incorrect usage of @def
- Add missing parameter docs

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-15 10:12:56 -05:00
Gerard Marull-Paretas
c8b5b0c6fc tracing: format: improve Doxygen
- Add APIs to the `subsys_tracing` group
- Add some missing documentation
- Minor header file style fixes

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-15 10:12:56 -05:00
Gerard Marull-Paretas
ffebac6578 tracing: improve Doxygen structure
- Add tracing to the subsys group
- Use `subsys_tracing` "namespace"
- Some minor header style improvements

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-15 10:12:56 -05:00
Christopher Friedt
6735f11bac Bluetooth: Audio: otc: update print format specifier for atomics
Atomics changed from `int` to `long` and print format specifiers
must be updated as well.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
ed7eec4c94 tests: kernel: atomics: expand atomic operations to 64-bit
This change updates the atomic tests to validate 32-bits on
32-bit architectures and 64-bits on 64-bit architectures.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
b00619118d west.yml: sof: update audio/sof for long atomic_t
The audio/sof Zephyr module needed print specifiers updated
for the transition from `int` to `long` for `atomic_t`
which supports 32-bit atomics and also 64-bit atomics.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
829eec9ec5 portability: cmsis: use correct type for atomics
With the change of `atomic_t` from `int` to `long` there
were a few places where there was some type aliasing
occuring.

Update CMSIS to use `atomic_t` rather than `int` for all
atomic operations.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
7c6039a1d2 drivers: serial: nrfx: refactor for atomic_t as long
This driver aliases a regular `int` to `atomic_t` but that
should be updated to `long` with the change to `atomic_t`.

Added a comment to highlight that the variable was aliased.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
3e86c627f7 kernel: atomics: update print specifiers for atomic_t
The print specifier for `atomic_t` should be updated
to `%ld`, `%lu`, or `%lx` to account for the type
change of `atomic_t` to `long`.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
80f73a053f doc kernel: atomics: support for 64-bit atomic operations
By redefining `atomic_t` as `long`, the type is 32-bit on
32-bit architectures and 64-bit on 64-bit architectures.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Christopher Friedt
174cb7f9f1 kernel: atomics: support for 64-bit atomic operations
With this change, `atomic_t` is 32-bit for 32-bit architectures
and 64-bit for 64-bit architectures. More specifically,
`sizeof(atomic_t) == sizeof(long)`.

Fixes #39530

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-15 09:59:01 -05:00
Andy Ross
0b400d86c0 drivers/timer/cavs_timer: Fix race in k_cycle_get_64()
In commit 918a574c88 ("clock: add k_cycle_get_64") this driver was
augmented with a count64() method to get a 64 bit cycle output from
the two-32-bit-word device registers.

Unfortunately it appeared to be trying to use a spinlock around the
two (low/high) reads to protect against overflow.  But that doesn't
work: spinlocks protect against other CPU code using the same
spinlock, not against a hardware counter that is incrementing in real
time!

Thankfully there was already a count() routine in place that does a
detect-overflow-and-retry loop to solve this.  Use that.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-11-15 09:54:31 -05:00
Emil Lindqvist
f0af9275ed logging: typecast to stop signed-unsigned comparison
If source_id is -1, which is a valid value, it will be
converted to unsigned since it's compared with an unsigned
which means it will be huge and asserts will trigger. To avoid
this, we typecast the unsigned part to signed.

Resolves #40115

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-11-15 08:53:51 -05:00
Enjia Mai
9ed986ae64 tests: logging: adjust the structure of logging test cases
Adjust the logging test case code to make them the same as other test
cases which deal with the CONFIG_USERSPACE used. It does not change
the original test logic, but just the file structure changed.

It also corrects the duplicated testsuite name of logging testcases.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2021-11-15 10:17:25 +01:00
Anas Nashif
7424126060 boards: qemu_cortex_a9: use SUPPORTED_EMU_PLATFORMS
We moved from EMU_PLATFORM to SUPPORTED_EMU_PLATFORMS.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-14 10:11:06 -05:00
Anas Nashif
c3a1b4e8f3 action: codecov: do not run on weekends
No need to run on weekends, nothing much happens, so lets save some
resources.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-13 17:29:54 -05:00
Anas Nashif
5ce51a91da actions: fix typo in clang action
Fix a minor typo in action and always set variable controlling reports.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-13 17:29:54 -05:00