Commit Graph

58293 Commits

Author SHA1 Message Date
Daniel Leung 5040f94dd6 boards: esp32: add note on using GDB stub
This adds note to the board documentation about using GDB stub
on the esp32 board.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung bdc812c15a doc: debug: expand documentation on gdbstub
This expands the documentation on GDB stub, and adding
hints on porting to new architectures.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 5d19da4507 soc: esp32: add support for GDB stub
This adds the SoC specific bits to enable GDB stub,
mainly the description for the register file, and
memory regions.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung dc34f6c84d xtensa: introduce support for GDB stub
This adds basic support for GDB stub on Xtensa. Note that
this only provides the common bits on the architecture side.
SoC support is also required to fully enable GDB stub on
each Xtensa SoC.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 31f148a88e debug: gdbstub: add stubs to support breakpoint/watchpoint
This adds the architecture interface so that the GDB stub can
deal with breakpoints and watchpoints. By default, weak
functions are implemented to indicate breakpoints and
watchpoints are not supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung c4099f6754 debug: gdbstub: allow aligned memory access
Some architectures may require memory accessed to be aligned to
certain size and cannot be accessed byte-by-byte during memory
read/write in GDB stub. This adds the ability to specify
the alignment via kconfig. The existing byte-by-byte access is
retained as it is simplier code.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 48da4dbb2a debug: gdbstub: add bits to restrict memory read/write
This adds bits for architectures, SoCs or boards to restrict
memory access in GDB stub. This is mainly to make sure
GDB stub only read/write to memory that can be legally accessed
without resulting in memory faults.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 650a629b08 debug: gdbstub: remove start argument from z_gdb_main_loop()
Storing the state where this is the first GDB break can be done
in the main GDB stub code. There is no need to store the state
in architecture layer.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 6eaaaa9acc debug: gdbstub: introduce gdb_bin2hex()
Adds a new function gdb_bin2hex() to convert binary into
hexadecimal string representation. This is similar to
bin2hex() but does not force a null character at the end
of the output buffer. This avoids an issue where the last
character of the hexadecimal string is replaced with
null character before sending to GDB.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 917b3cf7c0 samples: debug/gdbstub: update instructions to run
This corrects the directory pointing to sample in the README
file. Also changes the TCP port number for the second serial
port exposing the GDB stub. This allows QEMU itself to expose
GDB interface through port 1234, and Zephyr's GDB stub at
port 5678.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 413f859a36 debug: gdbstub: continue debugging for recoverable errors
There is no need to bail out of the debugging session if there
are recoverable errors, for example, erroneous GDB packet
received, cannot write to certain registers, etc. So simply
send an error message to GDB and continue the GDB stub main
loop for more debugging.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 9486cf7482 x86: gdbstub: remove ARCH_GDB_NUM_REGISTERS
Common GDB Stub no longer uses ARCH_GDB_NUM_REGISTERS.
So remove it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung e76d385e49 debug: gdbstub: add arch-specific funcs to read/write registers
This adds architecture-specific functions to read/write registers.
This allows architecture to have a sparse representation of
the register file as not all registers are saved during context
switches. This saves some runtime space, and provides some
flexibility on what architectures can do.

Remove from header the need to define ARCH_GDB_NUM_REGISTERS as
it is no longer used in the common gdbstub code.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung e1180c8cee x86: gdbstub: add arch-specific funcs to read/write registers
This adds some architecture-specific functions to read/write
registers for the GDB stub. This is in preparation for the actual
introduction of these functions in the core GDB stub code to
avoid breaking the build in between commits.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung 7fafd971f7 debug: gdbstub: ignore GDB packet exceeding buffer
If an incoming GDB packet is bigger than what the buffer can hold,
stop putting the extra characters into the buffer. This will still
read till the end to acknowledge the packet but will return error
instead. This allows the GDB session to continue instead of hanging
or timed out due to packets not being acknowledged.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel Leung f5f9a75142 debug: gdbstub: add kconfig for buffer size
This adds a kconfig to specify the buffer size for GDB packet
I/O. Some architectures may need a bigger buffer for the general
register packet, and we don't want it to overflow our buffer.

This also changes the packet read/write buffer to be allocated
outside of stack. Since the buffer can be large enough that it
won't fit inside the stack.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Daniel DeGrasse 662a131713 soc: rt6xx: Default flexspi logging to disabled
RT600 uses the mcux flexspi driver, which can produce RWW hazards when
calling code linked into flash (such as the logging subsystem). Disable
logging in flexspi driver by default for RT600 series.

Fixes #40744

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-30 13:54:06 -06:00
Stephanos Ioannidis e996db8138 tests: cpp: libcxx: Set minimum RAM requirement for full newlib test
This commit sets the minimum RAM requirement for the full newlib test
(`cpp.libcxx.newlib`) to 24 KiB so that only the target platforms that
can provide sufficient RAM area for the newlib heap are selected.

In case of the newlib full variant, the minimum required newlib heap
size, specified by CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE, is 8192.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-11-30 14:36:44 -05:00
Stephanos Ioannidis d67c1f389d riscv: Fix C++ exception handling info linking
The RISC-V architecture linker script was including `cplusplus-ram.ld`
linker script before `__data_region_start`, and this caused the content
of `.gcc_except_table` section to be not copied to the RAM by the
`z_data_copy` function; leading to the C++ exception handling
malfunction.

This commit relocates the `cplusplus-ram.ld` linker script inclusion
such that the contents of the relevant sections are properly copied by
the `z_data_copy` function.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-11-30 14:36:44 -05:00
Flavio Ceolin e9fb33ebff drivers: clock_control: Opaque type for clock rate
Add an opaque type that is platform specific to be used when setting a
clock rate.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-30 14:04:38 -05:00
Flavio Ceolin 2c9fdbfb17 drivers: clock_control: Add API to set the clock rate
Add a new API to set the clock rate synchronously and asynchronously.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-30 14:04:38 -05:00
Antonio Tessarolo cc1cd4d65b arm: Nxp imx6sx added PWM support
This commit adds support for IMX6SX PWM.
The PWM module is the same module present on the IMX7D and so dts
bindings has been renamed following the one present on linux.

Signed-off-by: Antonio Tessarolo <anthonytexdev@gmail.com>
2021-11-30 11:54:11 -06:00
Kim Bøndergaard ee6c552805 boards: frdm_k64f: Solve conflict between UART3 and enet
Arduino compatible boards should have a working UART on pin 0 & 1.
On frdm_k64f this is handled by uart3

Unfortunately pinmuxing of uart3 was destroyed when enabling NETWORKING,
because the uart3 RX/TX pins was reconfigured for 1588 timers.

1588 timers are enabled by the enet child node, ptp which by some reason
is enabled by default.
1588 timers aren't needed in most cases when ethernet is being used,
so this fix ensures ptp is by default disabled. Likewise pinmuxing of
the 1588 timer functionality is now dependant of ptp being active

Signed-off-by: Kim Bøndergaard <kim.boendergaard@escoglobal.com>
2021-11-30 11:08:15 -06:00
Daniel DeGrasse 0aeb69ee8c boards: mimxrt10xx: Added support for LPSPI DMA on RT10xx series
Add support for LPSPI DMA mode on RT1064, RT1060, RT1050, RT1024,
RT1020, RT1015, and RT1010 evaluation boards. Update tests to match.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-30 10:57:17 -06:00
Daniel DeGrasse ca80f2e2ea dts: mimxrt1010: Correct DMA channel count for RT1010 SOC
RT1010 SOC has 16 DMA channels on its EDMA controller. Update
devicetree to reflect this.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-30 10:57:17 -06:00
Daniel DeGrasse 7b74dbb405 drivers: spi_mcux_lpspi: Added DMA support to NXP LPSPI driver
Adds DMA support to NXP's LPSPI driver. This can be enabled by selecting
the KConfig symbol CONFIG_SPI_MCUX_LPSPI_DMA, and requires the LPSPI
instances enabled in the devicetree to have valid DMA instances
assigned.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-30 10:57:17 -06:00
Lukasz Majewski aa464a9d67 spi: Fix the Pcs setup for NXP's K6xF processors
Without this change, when DTS SPI device node has node ID = <0>, the
value of 0 is assigned during SPI configuration and written to
whichPcs member in master_config structure.
This value wrongly overrides the default value read from NXP's DSPI
HAL (kDSPI_Pcs0 = 1U << 0).

Such situation occurs on ip_k66f board, where the DSA device -
controlled via SPI has the node ID equal to 0 (i.e. reg = <0>).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-11-30 09:55:46 -06:00
Andrzej Puzdrowski 81b1e7fdac modules: Hooks Kconfig for MCUboot's bootutil
Mcuboot's bootutil libraries has option to use hooks which
allows to customize its behavior while proceeding on images
date. This patch introduces configuration options required for
enabling that option.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-11-30 12:08:03 +01:00
Dominik Ermel 1ccd9f0060 mgmt/mcumgr/lib: Reduce taskstat to Zephyr supported statistics
The commit adds CONFIG_OS_MGMT_TASKSTAT_ONLY_SUPPORTED_STATS
Kconfig option that disables code filling in task statistics, for
mcumgr command `taskstat`, that are not collected or supported by
Zephyr.
Setting this option to y will skip following statistics in response:
"runtime", "cswcnt", "last_checkin" and "next_checkin".

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-30 11:48:44 +01:00
Dominik Ermel c4a6137834 drivers/flash/nrf_qspi_nor: Fix qspi_sfdp_read error path
The commit fixes processing of a return value from the ANOMALY_122_INIT
call.

Fixes #39923

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-30 11:46:22 +01:00
Dominik Ermel 2a232bdee3 doc: releases: Note on MCUMGR SMP packet length calculation
The commit adds note on MCUMGR SMP over serial update that corrects
problem where CRC16 length was not added to a packet length.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-30 11:44:26 +01:00
Dominik Ermel 0e7e08e186 mgmt/mcumgr: Fix serial packet length not including CRC16
The length field of packet has not been including the length of
CRC16 field.

Fixes #39546

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-30 11:44:26 +01:00
Dominik Ermel d788bc6df0 mgmt/mcumgr: Correct packet length information
The packet length should include length of CRC16.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-30 11:44:26 +01:00
Anas Nashif 8d40928b2a actions: twister: determine nodes in python script
Improve calculation of matrix and move calculations from workflow to the
testplan script. We now generate a file that can be parsed by the action
with the data needed to start twister with the right number of nodes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-29 20:06:24 -05:00
Anas Nashif d52212b09a actions: fix filtering for clang action
Do not invoke --integration when dealing with one platform only and
generate testplan only for the needed platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-29 20:06:24 -05:00
Carlo Caione 26856ca878 test: device: Specify address and size cells.
The test is wrongly assuming that all the archs have #address-cells =
<1> and #size-cells = <1> at the DT root. This is not always true, and
it makes the test failing for AArch64. Fix the wrong assumption.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-29 19:41:27 -05:00
Anas Nashif d4962db828 tests: m2gl025_miv: exclude slow platform from some tests
This platform is slow on some tests and times out on non-hardware
related tests, so exclude it or increase timeout for some of the tests
to avoid false negatives in the test results due to timeouts.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-11-29 19:39:38 -05:00
Flavio Ceolin 54176127ec pm: Fix idle post ops on multicore
Post operations have to be tracked per cpu.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-29 19:37:55 -05:00
Flavio Ceolin 623ed5ae29 pm: Remove invalid comments
Remove comments referencing an old function / behavior.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-29 19:37:55 -05:00
Flavio Ceolin 00252b8d9e pm: Fix documentation section
pm_power_state_next_get does not belong the pm subsys hooks section.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-29 19:37:55 -05:00
Flavio Ceolin 72262475f4 pm: idle: Remove not necessary branch
Remove a constant branch calling directly pm_save_idle.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-29 19:37:55 -05:00
Jakob Krantz f20250cc5a Bluetooth: host: Add endian handling of rssi in adv. IQ report.
When populating bt_df_per_adv_sync_iq_samples_report the
rssi was not wrapped in sys_le16_to_cpu.

Signed-off-by: Jakob Krantz <jakob.krantz@u-blox.com>
2021-11-29 18:56:13 -05:00
Jakob Krantz 2f6b9ce406 Bluetooth: host: Expose per adv evt counter in CTE IQ report.
Allows the application to access the periodic advertising counter.

Signed-off-by: Jakob Krantz <jakob.krantz@u-blox.com>
2021-11-29 18:56:13 -05:00
Robert Lubos 2eb67b2fe4 tests: net: Add custom 802154 L2 tests
Add some basic custom 802154 L2 tests, verifying that a custom L2 can be
integrated with Zephyr properly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-29 18:55:13 -05:00
Piotr Pryga 5dd5902f67 Bluetooth: controller: Add missing NULL assign to df_cfg in ll_adv_set
ll_adv_set stores poitner to direction finding TX configuration.
When ll_reset is executed the pointer was not NULL assigned.
That lead to erroneous behavior e.g. df_cfg->is_enabled was set
to TRUE even the functionality was not enabled.
DF configuration is stored in memory pool. The memory pool uses
free elements to store its internal data. On reset whole pool is
expected to be free, so ll_adv_set->df_cfg may not point to any
element allocated from memory pool.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-11-29 18:29:43 -05:00
Francois Ramu 701d6bd087 drivers: watchdog: stm32G0 window watchdog during debug
This commit is enabling the Debug support clock
like the stm32L0 or F0, the APB peripheral clock enable register 1
has a bit to clock DBGMCU before use.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-29 18:26:47 -05:00
Francois Ramu 4145c83c82 drivers: watchdog: stm32MP1 window watchdog during debug
This commit is controlling the WWDG during the Stop mode in debug.
WWDG1 is frozen while the core is in Debug mode, setting the bit
of the DBGMCU APB1 peripheral freeze register (DBGMCU_APB1FZ2)
for the stm32MP1 soc devices.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-29 18:26:47 -05:00
Francois Ramu 0d84e7b2bc drivers: watchdog: stm32H7 window watchdog during debug
This commit is controlling the WWDG during the Stop mode in debug.
WWDG1 is frozen while the core is in Debug mode, setting the bit
of the DBGMCU APB3 peripheral freeze register (DBGMCU_APB3FZ1)
for the stm32H7 soc devices.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-29 18:26:47 -05:00
Erwan Gouriou aad0f000c6 include/dt-bindings/pinctrl: stm32: Remove c pinmux api leftover
Following definitive transition to dts pinmux then pinctrl api
remove C pinmux api leftover definitions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-29 18:26:29 -05:00
NingX Zhao cb4a629bc8 tests: removing incorrect testcases of poll
These two test cases both are fault injection test cases,
and there are designed for testing some negative branches
to improve code coverage. But I find that this branch
shouldn't be tested, because the spinlock will be locked
before a procedure performs here, and then it will trigger
an assert error and the process will be rescheduled to the
handler function, and terminated the current test case,
so spinlock will never be unlocked. And it will impact
the next test case in the same test suite(the next testcase
will be never get spinlock).

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
2021-11-29 18:26:02 -05:00