There is clearly no reason `cpu.h` should `#include <stdio.h>`.
Also add an export pragma to `cpu_conf.h`, as portable code is
expected to include `cpu.h` (which exists across MCU families in RIOT),
and not `cpu_conf.h` (which only exists for some MCU families).
Only call this instruction if a debug session is active otherwise it will trigger a hardfault
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
19368: debug: add DEBUG_BREAKPOINT() macro, set breakpoint on failed assertion r=benpicco a=benpicco
19529: cpu/stm32/periph/dac: optimize setting DAC r=benpicco a=Enoch247
### Contribution description
The current implmentation right shifted the 16 bit value passed into `dac_set()` down to the 12 bits that the DAC is actually capable of. This patch drops the shift and instead writes the 16 bit value to the DAC's left aligned 12 bit wide data holding register.
### Testing procedure
do something like:
``` c
#include "perip/dac.h"
int main(void)
{
dac_set(DAC_LINE(0), 0xffff/2);
return 0;
}
```
- observe DAC's output is half of vref
### Issues/PRs references
- none known
19531: tests/unittests: allow passing `UNIT_TESTS` via env r=benpicco a=kaspar030
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Joshua DeWeese <jdeweese@primecontrols.com>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
Newer picolibc versions require some additional symbols defined in the
linker script to correctly manage alignment constraints on thread
local storage.
Signed-off-by: Keith Packard <keithp@keithp.com>
The hard fault handler would normally call core_panic() which in turn
calls ps() - this already helps debugging a lot of crashes caused by
a thread stack overflow.
With the breakpoint in place, the code will not advance to this, leaving
users unknown of this feature in the dark.
On top, the breakpoint is not very helpful if thread stacks are already
corrupted.
Let's just drop it for simplicity's sake - it's not there for any other
architectures.
For RISC-V and Cortex-M-not-3, triples are known and have worked in some
configuration, but do not work at the moment and stay disabled until the
reference platforms (native, M3) have been established well.
This introduces KCONFIG_BOARD_CONFIG and KCONFIG_CPU_CONFIG variable for
boards and CPUs (including common directories) to add default
configuration files to be merged. The current approach, as it uses
Makefile.features, would include boards first, not allowing them to
override CPU configurations.
cpu/cortexm_common/thread_arch.c:262: error (comparePointers): Comparing pointers that point to different objects
cpu/cortexm_common/thread_arch.c:266: error (comparePointers): Subtracting pointers that point to different objects