Compare commits
186 Commits
collab-rus
...
v3.7.1-rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
321e39a457 | ||
|
|
7be15c0bd9 | ||
|
|
f7e9a609ed | ||
|
|
c480aa3e96 | ||
|
|
713d8c8a62 | ||
|
|
4c806352bd | ||
|
|
efb8a1d030 | ||
|
|
7098b56481 | ||
|
|
1aa25cc633 | ||
|
|
30af4b2696 | ||
|
|
219d0343fa | ||
|
|
064fcfca6b | ||
|
|
3993287ce4 | ||
|
|
c6635808de | ||
|
|
0b41a2713e | ||
|
|
a23758dbb1 | ||
|
|
422657bc7f | ||
|
|
480fa71ca5 | ||
|
|
05acdcfbe4 | ||
|
|
6fc41c1cce | ||
|
|
b258fb0230 | ||
|
|
c125e3b80f | ||
|
|
aa18fb8d1f | ||
|
|
3c242d5eaf | ||
|
|
debf3e0ffc | ||
|
|
739247e680 | ||
|
|
04bbca7464 | ||
|
|
29b2bf89f8 | ||
|
|
96a05d09f2 | ||
|
|
a3315af1d1 | ||
|
|
db2df7129f | ||
|
|
5d466aad19 | ||
|
|
4aa56071f1 | ||
|
|
61c2965c65 | ||
|
|
30b0a75429 | ||
|
|
1f93bd74b3 | ||
|
|
6da35a811a | ||
|
|
c94fee82c1 | ||
|
|
f5e54e6255 | ||
|
|
d662d62ef0 | ||
|
|
a3266a8b62 | ||
|
|
793065cc19 | ||
|
|
22b72e62d3 | ||
|
|
ff72087063 | ||
|
|
29f425f687 | ||
|
|
a126a0858c | ||
|
|
ea219dbb82 | ||
|
|
c69bea047f | ||
|
|
a3f574e5dd | ||
|
|
1c9470285a | ||
|
|
da137a587a | ||
|
|
69f61ebcaa | ||
|
|
65cc5d4d31 | ||
|
|
cd43f1be07 | ||
|
|
32029b8dd0 | ||
|
|
02352b35a2 | ||
|
|
34a68c47d7 | ||
|
|
d1a519e1a5 | ||
|
|
7caed78e47 | ||
|
|
29a84b13ec | ||
|
|
46a13006d0 | ||
|
|
9739759fef | ||
|
|
0e62cd5831 | ||
|
|
2da1ef8677 | ||
|
|
68247afbae | ||
|
|
53a9f6b7ca | ||
|
|
1c3cb74c67 | ||
|
|
bc18a9a7c0 | ||
|
|
5e4e4bf511 | ||
|
|
6a1f9982ff | ||
|
|
b26773fc08 | ||
|
|
53738cf924 | ||
|
|
448cb69a78 | ||
|
|
60fe9f9d91 | ||
|
|
60fb882739 | ||
|
|
110eb533a8 | ||
|
|
3c3d2a26dc | ||
|
|
a0ee633030 | ||
|
|
a62c741720 | ||
|
|
86e62dd482 | ||
|
|
d826a69a88 | ||
|
|
db20aca2c7 | ||
|
|
50227e38f6 | ||
|
|
51b53de08e | ||
|
|
331ad9956a | ||
|
|
f2ef1c8cd8 | ||
|
|
ed1db9695e | ||
|
|
062d4d5e11 | ||
|
|
2b4e3274f2 | ||
|
|
e6599a1e30 | ||
|
|
ef5f7bb9ee | ||
|
|
bff2e8d1a5 | ||
|
|
42bffa7eee | ||
|
|
5c8d7b2671 | ||
|
|
b8fa7eec2e | ||
|
|
d4a551437e | ||
|
|
2d75520b66 | ||
|
|
9f39eb92c5 | ||
|
|
ae03e45bf5 | ||
|
|
574a6dff57 | ||
|
|
7378a05350 | ||
|
|
cc62418d75 | ||
|
|
d800ccea86 | ||
|
|
df9a905979 | ||
|
|
e84c516589 | ||
|
|
57a0dbd729 | ||
|
|
9b58209b01 | ||
|
|
abf93151c2 | ||
|
|
afedbb419e | ||
|
|
22877ed2ae | ||
|
|
6c4a190a31 | ||
|
|
da2d5e6fbe | ||
|
|
7a24c590cf | ||
|
|
c0ed85cb60 | ||
|
|
9584ac74d6 | ||
|
|
01dc4e1adc | ||
|
|
fb270828a6 | ||
|
|
25adea3428 | ||
|
|
4f0e8a80f3 | ||
|
|
7e17f1e4ed | ||
|
|
5bd5bf8530 | ||
|
|
748ccc1661 | ||
|
|
20e7ef389d | ||
|
|
6c4d9e0b59 | ||
|
|
b421ca7b7e | ||
|
|
37cea05f5d | ||
|
|
c823c550b0 | ||
|
|
dcc9255796 | ||
|
|
f5fd647605 | ||
|
|
17f0ec9900 | ||
|
|
5e00ea9e4f | ||
|
|
3125273a78 | ||
|
|
269c91850a | ||
|
|
680779e5f5 | ||
|
|
e06bbce3e7 | ||
|
|
efb3576a54 | ||
|
|
6c454a6edc | ||
|
|
a58f407367 | ||
|
|
fcc3a7e483 | ||
|
|
afb8c8922a | ||
|
|
45a6994f5c | ||
|
|
e41c69a3c5 | ||
|
|
350f9fbc2e | ||
|
|
296983709a | ||
|
|
3cd429f0e0 | ||
|
|
b8010bf19d | ||
|
|
2600eaf6de | ||
|
|
f9770bd48e | ||
|
|
0299538a11 | ||
|
|
5470dc3f62 | ||
|
|
a58e039b6a | ||
|
|
37e5eb997e | ||
|
|
ff02673d6e | ||
|
|
4ac4795945 | ||
|
|
905f22b018 | ||
|
|
fe0b5ab37b | ||
|
|
ab836482f0 | ||
|
|
117fb6c27f | ||
|
|
8fff3c24a4 | ||
|
|
13a8b9dcd3 | ||
|
|
b8c126abfc | ||
|
|
79b78b8201 | ||
|
|
29c3fc13db | ||
|
|
8a98c84647 | ||
|
|
bb65669a94 | ||
|
|
4744f569ef | ||
|
|
ee6c00843a | ||
|
|
a6cbc326e3 | ||
|
|
81e8c6dc5c | ||
|
|
57ef4996f5 | ||
|
|
085bf35912 | ||
|
|
508d402aad | ||
|
|
d947fbb378 | ||
|
|
d698d40bb7 | ||
|
|
67a6217906 | ||
|
|
0807227653 | ||
|
|
bc1c81bc00 | ||
|
|
c5472feea3 | ||
|
|
c5de8ab5d1 | ||
|
|
c394cdb0fa | ||
|
|
ec8dc79124 | ||
|
|
642b308bfc | ||
|
|
3a6653a7a9 | ||
|
|
7d59805274 | ||
|
|
57c1f22178 | ||
|
|
dc7129bd20 |
8
.github/workflows/backport_issue_check.yml
vendored
8
.github/workflows/backport_issue_check.yml
vendored
@@ -2,12 +2,20 @@ name: Backport Issue Check
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- edited
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
branches:
|
||||
- v*-branch
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
name: Backport Issue Check
|
||||
concurrency:
|
||||
group: backport-issue-check-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
runs-on: ubuntu-22.04
|
||||
if: github.repository == 'zephyrproject-rtos/zephyr'
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
elif [ "${{ runner.os }}" = "Windows" ]; then
|
||||
EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out"
|
||||
fi
|
||||
./scripts/twister --force-color --inline-logs -T samples/hello_world -v $EXTRA_TWISTER_FLAGS
|
||||
./scripts/twister --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS
|
||||
|
||||
- name: Upload artifacts
|
||||
if: failure()
|
||||
@@ -77,3 +77,4 @@ jobs:
|
||||
if-no-files-found: ignore
|
||||
path:
|
||||
zephyr/twister-out/*/samples/hello_world/sample.basic.helloworld/build.log
|
||||
zephyr/twister-out/*/samples/cpp/hello_world/sample.cpp.helloworld/build.log
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.16.8
|
||||
0.16.9
|
||||
|
||||
4
VERSION
4
VERSION
@@ -1,5 +1,5 @@
|
||||
VERSION_MAJOR = 3
|
||||
VERSION_MINOR = 7
|
||||
PATCHLEVEL = 0
|
||||
PATCHLEVEL = 1
|
||||
VERSION_TWEAK = 0
|
||||
EXTRAVERSION =
|
||||
EXTRAVERSION = rc1
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Linaro, Limited
|
||||
* Copyright (c) 2023 Arm Limited
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -48,63 +47,3 @@ int arch_swap(unsigned int key)
|
||||
*/
|
||||
return _current->arch.swap_return_value;
|
||||
}
|
||||
|
||||
uintptr_t z_arm_pendsv_c(uintptr_t exc_ret)
|
||||
{
|
||||
/* Store LSB of LR (EXC_RETURN) to the thread's 'mode' word. */
|
||||
IF_ENABLED(CONFIG_ARM_STORE_EXC_RETURN,
|
||||
(_kernel.cpus[0].current->arch.mode_exc_return = (uint8_t)exc_ret;));
|
||||
|
||||
/* Protect the kernel state while we play with the thread lists */
|
||||
uint32_t basepri = arch_irq_lock();
|
||||
|
||||
/* fetch the thread to run from the ready queue cache */
|
||||
struct k_thread *current = _kernel.cpus[0].current = _kernel.ready_q.cache;
|
||||
|
||||
/*
|
||||
* Clear PendSV so that if another interrupt comes in and
|
||||
* decides, with the new kernel state based on the new thread
|
||||
* being context-switched in, that it needs to reschedule, it
|
||||
* will take, but that previously pended PendSVs do not take,
|
||||
* since they were based on the previous kernel state and this
|
||||
* has been handled.
|
||||
*/
|
||||
SCB->ICSR = SCB_ICSR_PENDSVCLR_Msk;
|
||||
|
||||
/* For Cortex-M, store TLS pointer in a global variable,
|
||||
* as it lacks the process ID or thread ID register
|
||||
* to be used by toolchain to access thread data.
|
||||
*/
|
||||
IF_ENABLED(CONFIG_THREAD_LOCAL_STORAGE,
|
||||
(extern uintptr_t z_arm_tls_ptr; z_arm_tls_ptr = current->tls));
|
||||
|
||||
IF_ENABLED(CONFIG_ARM_STORE_EXC_RETURN,
|
||||
(exc_ret = (exc_ret & 0xFFFFFF00) | current->arch.mode_exc_return));
|
||||
|
||||
/* Restore previous interrupt disable state (irq_lock key)
|
||||
* (We clear the arch.basepri field after restoring state)
|
||||
*/
|
||||
basepri = current->arch.basepri;
|
||||
current->arch.basepri = 0;
|
||||
|
||||
arch_irq_unlock(basepri);
|
||||
|
||||
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
|
||||
/* Re-program dynamic memory map */
|
||||
z_arm_configure_dynamic_mpu_regions(current);
|
||||
#endif
|
||||
|
||||
/* restore mode */
|
||||
IF_ENABLED(CONFIG_USERSPACE, ({
|
||||
CONTROL_Type ctrl = {.w = __get_CONTROL()};
|
||||
/* exit privileged state when returning to thread mode. */
|
||||
ctrl.b.nPRIV = 0;
|
||||
/* __set_CONTROL inserts an ISB which is may not be necessary here
|
||||
* (stack pointer may not be touched), but it's recommended to avoid
|
||||
* executing pre-fetched instructions with the previous privilege.
|
||||
*/
|
||||
__set_CONTROL(ctrl.w | current->arch.mode);
|
||||
}));
|
||||
|
||||
return exc_ret;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ _ASM_FILE_PROLOGUE
|
||||
GTEXT(z_arm_svc)
|
||||
GTEXT(z_arm_pendsv)
|
||||
GTEXT(z_do_kernel_oops)
|
||||
GTEXT(z_arm_pendsv_c)
|
||||
#if defined(CONFIG_USERSPACE)
|
||||
GTEXT(z_arm_do_syscall)
|
||||
#endif
|
||||
@@ -118,20 +117,125 @@ out_fp_endif:
|
||||
#error Unknown ARM architecture
|
||||
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
|
||||
|
||||
mov r4, lr
|
||||
mov r0, lr
|
||||
bl z_arm_pendsv_c
|
||||
mov lr, r4
|
||||
/* Protect the kernel state while we play with the thread lists */
|
||||
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
|
||||
cpsid i
|
||||
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
|
||||
movs.n r0, #_EXC_IRQ_DEFAULT_PRIO
|
||||
msr BASEPRI_MAX, r0
|
||||
isb /* Make the effect of disabling interrupts be realized immediately */
|
||||
#else
|
||||
#error Unknown ARM architecture
|
||||
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
|
||||
|
||||
ldr r1, =_kernel
|
||||
ldr r2, [r1, #_kernel_offset_to_current]
|
||||
/*
|
||||
* Prepare to clear PendSV with interrupts unlocked, but
|
||||
* don't clear it yet. PendSV must not be cleared until
|
||||
* the new thread is context-switched in since all decisions
|
||||
* to pend PendSV have been taken with the current kernel
|
||||
* state and this is what we're handling currently.
|
||||
*/
|
||||
ldr r7, =_SCS_ICSR
|
||||
ldr r6, =_SCS_ICSR_UNPENDSV
|
||||
|
||||
/* _kernel is still in r1 */
|
||||
|
||||
/* fetch the thread to run from the ready queue cache */
|
||||
ldr r2, [r1, #_kernel_offset_to_ready_q_cache]
|
||||
|
||||
str r2, [r1, #_kernel_offset_to_current]
|
||||
|
||||
/*
|
||||
* Clear PendSV so that if another interrupt comes in and
|
||||
* decides, with the new kernel state based on the new thread
|
||||
* being context-switched in, that it needs to reschedule, it
|
||||
* will take, but that previously pended PendSVs do not take,
|
||||
* since they were based on the previous kernel state and this
|
||||
* has been handled.
|
||||
*/
|
||||
|
||||
/* _SCS_ICSR is still in r7 and _SCS_ICSR_UNPENDSV in r6 */
|
||||
str r6, [r7, #0]
|
||||
|
||||
#if defined(CONFIG_THREAD_LOCAL_STORAGE)
|
||||
/* Grab the TLS pointer */
|
||||
ldr r4, =_thread_offset_to_tls
|
||||
adds r4, r2, r4
|
||||
ldr r0, [r4]
|
||||
|
||||
/* For Cortex-M, store TLS pointer in a global variable,
|
||||
* as it lacks the process ID or thread ID register
|
||||
* to be used by toolchain to access thread data.
|
||||
*/
|
||||
ldr r4, =z_arm_tls_ptr
|
||||
str r0, [r4]
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
|
||||
/* Restore EXC_RETURN value. */
|
||||
mov lr, r0
|
||||
ldrsb lr, [r2, #_thread_offset_to_mode_exc_return]
|
||||
#endif
|
||||
|
||||
/* Restore previous interrupt disable state (irq_lock key)
|
||||
* (We clear the arch.basepri field after restoring state)
|
||||
*/
|
||||
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) && (_thread_offset_to_basepri > 124)
|
||||
/* Doing it this way since the offset to thread->arch.basepri can in
|
||||
* some configurations be larger than the maximum of 124 for ldr/str
|
||||
* immediate offsets.
|
||||
*/
|
||||
ldr r4, =_thread_offset_to_basepri
|
||||
adds r4, r2, r4
|
||||
|
||||
ldr r0, [r4]
|
||||
movs.n r3, #0
|
||||
str r3, [r4]
|
||||
#else
|
||||
ldr r0, [r2, #_thread_offset_to_basepri]
|
||||
movs r3, #0
|
||||
str r3, [r2, #_thread_offset_to_basepri]
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
|
||||
/* BASEPRI not available, previous interrupt disable state
|
||||
* maps to PRIMASK.
|
||||
*
|
||||
* Only enable interrupts if value is 0, meaning interrupts
|
||||
* were enabled before irq_lock was called.
|
||||
*/
|
||||
cmp r0, #0
|
||||
bne _thread_irq_disabled
|
||||
cpsie i
|
||||
_thread_irq_disabled:
|
||||
|
||||
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
|
||||
/* Re-program dynamic memory map */
|
||||
push {r2,lr}
|
||||
mov r0, r2
|
||||
bl z_arm_configure_dynamic_mpu_regions
|
||||
pop {r2,r3}
|
||||
mov lr, r3
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
/* restore mode */
|
||||
ldr r3, =_thread_offset_to_mode
|
||||
adds r3, r2, r3
|
||||
ldr r0, [r3]
|
||||
mrs r3, CONTROL
|
||||
movs.n r1, #1
|
||||
bics r3, r1
|
||||
orrs r3, r0
|
||||
msr CONTROL, r3
|
||||
|
||||
/* ISB is not strictly necessary here (stack pointer is not being
|
||||
* touched), but it's recommended to avoid executing pre-fetched
|
||||
* instructions with the previous privilege.
|
||||
*/
|
||||
isb
|
||||
|
||||
#endif
|
||||
|
||||
ldr r4, =_thread_offset_to_callee_saved
|
||||
adds r0, r2, r4
|
||||
|
||||
@@ -149,6 +253,9 @@ out_fp_endif:
|
||||
subs r0, #36
|
||||
ldmia r0!, {r4-r7}
|
||||
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
|
||||
/* restore BASEPRI for the incoming thread */
|
||||
msr BASEPRI, r0
|
||||
|
||||
#ifdef CONFIG_FPU_SHARING
|
||||
/* Assess whether switched-in thread had been using the FP registers. */
|
||||
tst lr, #_EXC_RETURN_FTYPE_Msk
|
||||
@@ -178,6 +285,30 @@ in_fp_endif:
|
||||
isb
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
|
||||
/* Re-program dynamic memory map */
|
||||
push {r2,lr}
|
||||
mov r0, r2 /* _current thread */
|
||||
bl z_arm_configure_dynamic_mpu_regions
|
||||
pop {r2,lr}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
/* restore mode */
|
||||
ldr r0, [r2, #_thread_offset_to_mode]
|
||||
mrs r3, CONTROL
|
||||
bic r3, #1
|
||||
orr r3, r0
|
||||
msr CONTROL, r3
|
||||
|
||||
/* ISB is not strictly necessary here (stack pointer is not being
|
||||
* touched), but it's recommended to avoid executing pre-fetched
|
||||
* instructions with the previous privilege.
|
||||
*/
|
||||
isb
|
||||
|
||||
#endif
|
||||
|
||||
/* load callee-saved + psp from thread */
|
||||
add r0, r2, #_thread_offset_to_callee_saved
|
||||
ldmia r0, {r4-r11, ip}
|
||||
@@ -300,6 +431,7 @@ _stack_frame_endif:
|
||||
/* exception return is done in z_arm_int_exit() */
|
||||
ldr r0, =z_arm_int_exit
|
||||
bx r0
|
||||
|
||||
#endif
|
||||
|
||||
_oops:
|
||||
|
||||
@@ -428,6 +428,12 @@ do_fault:
|
||||
1: mv a1, sp
|
||||
|
||||
#ifdef CONFIG_EXCEPTION_DEBUG
|
||||
/*
|
||||
* Restore the s0 we saved early in ISR entry
|
||||
* so it shows up properly in the CSF.
|
||||
*/
|
||||
lr s0, __struct_arch_esf_s0_OFFSET(sp)
|
||||
|
||||
/* Allocate space for caller-saved registers on current thread stack */
|
||||
addi sp, sp, -__callee_saved_t_SIZEOF
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ boot_first_core:
|
||||
#ifdef CONFIG_INIT_STACKS
|
||||
/* Pre-populate all bytes in z_interrupt_stacks with 0xAA */
|
||||
la t0, z_interrupt_stacks
|
||||
li t1, __z_interrupt_stack_SIZEOF
|
||||
/* Total size of all cores' IRQ stack */
|
||||
li t1, __z_interrupt_all_stacks_SIZEOF
|
||||
add t1, t1, t0
|
||||
|
||||
/* Populate z_interrupt_stacks with 0xaaaaaaaa */
|
||||
@@ -71,7 +72,7 @@ aa_loop:
|
||||
sw t2, 0x00(t0)
|
||||
addi t0, t0, 4
|
||||
blt t0, t1, aa_loop
|
||||
#endif
|
||||
#endif /* CONFIG_INIT_STACKS */
|
||||
|
||||
/*
|
||||
* Initially, setup stack pointer to
|
||||
|
||||
@@ -58,12 +58,12 @@ static inline bool in_user_thread_stack_bound(uintptr_t addr, const struct k_thr
|
||||
|
||||
/* See: zephyr/include/zephyr/arch/riscv/arch.h */
|
||||
if (IS_ENABLED(CONFIG_PMP_POWER_OF_TWO_ALIGNMENT)) {
|
||||
start = thread->arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE;
|
||||
end = thread->arch.priv_stack_start;
|
||||
start = thread->arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE;
|
||||
} else {
|
||||
start = thread->stack_info.start - CONFIG_PRIVILEGED_STACK_SIZE;
|
||||
end = thread->stack_info.start;
|
||||
}
|
||||
end = Z_STACK_PTR_ALIGN(thread->arch.priv_stack_start + K_KERNEL_STACK_RESERVED +
|
||||
CONFIG_PRIVILEGED_STACK_SIZE);
|
||||
|
||||
return (addr >= start) && (addr < end);
|
||||
}
|
||||
@@ -134,22 +134,53 @@ static void walk_stackframe(stack_trace_callback_fn cb, void *cookie, const stru
|
||||
ra = csf->ra;
|
||||
}
|
||||
|
||||
for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy(fp, thread, esf) && (fp > last_fp);) {
|
||||
if (in_text_region(ra)) {
|
||||
if (!cb(cookie, ra)) {
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Increment the iterator only if `ra` is within the text region to get the
|
||||
* most out of it
|
||||
*/
|
||||
i++;
|
||||
for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy(fp, thread, esf) && (fp > last_fp); i++) {
|
||||
if (in_text_region(ra) && !cb(cookie, ra)) {
|
||||
break;
|
||||
}
|
||||
last_fp = fp;
|
||||
|
||||
/* Unwind to the previous frame */
|
||||
frame = (struct stackframe *)fp - 1;
|
||||
ra = frame->ra;
|
||||
|
||||
if ((i == 0) && (esf != NULL)) {
|
||||
/* Print `esf->ra` if we are at the top of the stack */
|
||||
if (in_text_region(esf->ra) && !cb(cookie, esf->ra)) {
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* For the first stack frame, the `ra` is not stored in the frame if the
|
||||
* preempted function doesn't call any other function, we can observe:
|
||||
*
|
||||
* .-------------.
|
||||
* frame[0]->fp ---> | frame[0] fp |
|
||||
* :-------------:
|
||||
* frame[0]->ra ---> | frame[1] fp |
|
||||
* | frame[1] ra |
|
||||
* :~~~~~~~~~~~~~:
|
||||
* | frame[N] fp |
|
||||
*
|
||||
* Instead of:
|
||||
*
|
||||
* .-------------.
|
||||
* frame[0]->fp ---> | frame[0] fp |
|
||||
* frame[0]->ra ---> | frame[1] ra |
|
||||
* :-------------:
|
||||
* | frame[1] fp |
|
||||
* | frame[1] ra |
|
||||
* :~~~~~~~~~~~~~:
|
||||
* | frame[N] fp |
|
||||
*
|
||||
* Check if `frame->ra` actually points to a `fp`, and adjust accordingly
|
||||
*/
|
||||
if (vrfy(frame->ra, thread, esf)) {
|
||||
fp = frame->ra;
|
||||
frame = (struct stackframe *)fp;
|
||||
}
|
||||
}
|
||||
|
||||
fp = frame->fp;
|
||||
ra = frame->ra;
|
||||
}
|
||||
}
|
||||
#else /* !CONFIG_FRAME_POINTER */
|
||||
|
||||
@@ -33,6 +33,9 @@ extern char _heap_start[];
|
||||
/** MPU foreground map for kernel mode. */
|
||||
static struct xtensa_mpu_map xtensa_mpu_map_fg_kernel;
|
||||
|
||||
/** Make sure write to the MPU region is atomic. */
|
||||
static struct k_spinlock xtensa_mpu_lock;
|
||||
|
||||
/*
|
||||
* Additional information about the MPU maps: foreground and background
|
||||
* maps.
|
||||
@@ -629,6 +632,9 @@ void xtensa_mpu_map_write(struct xtensa_mpu_map *map)
|
||||
#endif
|
||||
{
|
||||
int entry;
|
||||
k_spinlock_key_t key;
|
||||
|
||||
key = k_spin_lock(&xtensa_mpu_lock);
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
struct xtensa_mpu_map *map = thread->arch.mpu_map;
|
||||
@@ -652,6 +658,8 @@ void xtensa_mpu_map_write(struct xtensa_mpu_map *map)
|
||||
__asm__ volatile("wptlb %0, %1\n\t"
|
||||
: : "a"(map->entries[entry].at), "a"(map->entries[entry].as));
|
||||
}
|
||||
|
||||
k_spin_unlock(&xtensa_mpu_lock, key);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -765,6 +773,7 @@ int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
|
||||
{
|
||||
int ret;
|
||||
uint32_t perm;
|
||||
struct k_thread *cur_thread;
|
||||
struct xtensa_mpu_map *map = &domain->arch.mpu_map;
|
||||
struct k_mem_partition *partition = &domain->partitions[partition_id];
|
||||
uintptr_t end_addr = partition->start + partition->size;
|
||||
@@ -833,6 +842,15 @@ int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
|
||||
CONFIG_XTENSA_MPU_DEFAULT_MEM_TYPE,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
* Need to update hardware MPU regions if we are removing
|
||||
* partition from the domain of the current running thread.
|
||||
*/
|
||||
cur_thread = _current_cpu->current;
|
||||
if (cur_thread->mem_domain_info.mem_domain == domain) {
|
||||
xtensa_mpu_map_write(cur_thread);
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
@@ -841,6 +859,7 @@ int arch_mem_domain_partition_add(struct k_mem_domain *domain,
|
||||
uint32_t partition_id)
|
||||
{
|
||||
int ret;
|
||||
struct k_thread *cur_thread;
|
||||
struct xtensa_mpu_map *map = &domain->arch.mpu_map;
|
||||
struct k_mem_partition *partition = &domain->partitions[partition_id];
|
||||
uintptr_t end_addr = partition->start + partition->size;
|
||||
@@ -855,6 +874,20 @@ int arch_mem_domain_partition_add(struct k_mem_domain *domain,
|
||||
CONFIG_XTENSA_MPU_DEFAULT_MEM_TYPE,
|
||||
NULL);
|
||||
|
||||
/*
|
||||
* Need to update hardware MPU regions if we are removing
|
||||
* partition from the domain of the current running thread.
|
||||
*
|
||||
* Note that this function can be called with dummy thread
|
||||
* at boot so we need to avoid writing MPU regions to
|
||||
* hardware.
|
||||
*/
|
||||
cur_thread = _current_cpu->current;
|
||||
if (((cur_thread->base.thread_state & _THREAD_DUMMY) != _THREAD_DUMMY) &&
|
||||
(cur_thread->mem_domain_info.mem_domain == domain)) {
|
||||
xtensa_mpu_map_write(cur_thread);
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
compatible = "zephyr,mipi-dbi-spi";
|
||||
reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
|
||||
dc-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
|
||||
spi-dev = <&spi2>;
|
||||
spi-dev = <&spi4>;
|
||||
write-only;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@@ -15,7 +15,7 @@ config ESP_SPIRAM
|
||||
default y if !MCUBOOT
|
||||
|
||||
choice SPIRAM_TYPE
|
||||
default SPIRAM_TYPE_ESPPSRAM64
|
||||
default SPIRAM_TYPE_ESPPSRAM32
|
||||
endchoice
|
||||
|
||||
config HEAP_MEM_POOL_ADD_SIZE_BOARD
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
status = "okay";
|
||||
erase-block-size = <4096>;
|
||||
write-block-size = <1>;
|
||||
spi-max-frequency = <133000000>;
|
||||
spi-max-frequency = <104000000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
arduino_i2c: &i2c1 {};
|
||||
arduino_i2c: &i2c3 {};
|
||||
arduino_spi: &spi1 {};
|
||||
arduino_serial: &uart4 {};
|
||||
|
||||
@@ -163,8 +163,6 @@ Motion and environmental sensors
|
||||
(`lps22df datasheet`_)
|
||||
- **LIS2DU12** 3-axis accelerometer
|
||||
(`lis2du12 datasheet`_)
|
||||
- **HTS221** Humidity sensor
|
||||
(`hts221 datasheet`_)
|
||||
- **STTS22H** Digital temperature sensor
|
||||
(`stts22hh datasheet`_)
|
||||
- **MP23db01HP** Microphone / audio sensor
|
||||
@@ -353,9 +351,6 @@ References
|
||||
.. _lis2du12 datasheet:
|
||||
https://www.st.com/en/mems-and-sensors/lis2du12.html
|
||||
|
||||
.. _hts221 datasheet:
|
||||
https://www.st.com/en/mems-and-sensors/hts221.html
|
||||
|
||||
.. _stts22hh datasheet:
|
||||
https://www.st.com/en/mems-and-sensors/stts22h.html
|
||||
|
||||
|
||||
@@ -228,13 +228,6 @@ stm32_lp_tick_source: &lptim1 {
|
||||
status = "okay";
|
||||
clock-frequency = <I2C_BITRATE_FAST>;
|
||||
|
||||
hts221@5f {
|
||||
compatible = "st,hts221";
|
||||
reg = <0x5f>;
|
||||
drdy-gpios = <&gpioe 11 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
lps22df@5d {
|
||||
compatible = "st,lps22df";
|
||||
reg = <0x5d>;
|
||||
|
||||
@@ -9,6 +9,7 @@ supported:
|
||||
- acpi
|
||||
- smp
|
||||
testing:
|
||||
timeout_multiplier: 2
|
||||
ignore_tags:
|
||||
- net
|
||||
- bluetooth
|
||||
|
||||
@@ -50,7 +50,7 @@ endif()
|
||||
|
||||
find_package(Deprecated COMPONENTS CROSS_COMPILE)
|
||||
|
||||
find_package(Zephyr-sdk 0.16)
|
||||
find_package(Zephyr-sdk 0.16...<0.17)
|
||||
|
||||
# gperf is an optional dependency
|
||||
find_program(GPERF gperf)
|
||||
|
||||
@@ -54,7 +54,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
|
||||
# To support Zephyr SDK tools (DTC, and other tools) with 3rd party toolchains
|
||||
# then we keep track of current toolchain variant.
|
||||
set(ZEPHYR_CURRENT_TOOLCHAIN_VARIANT ${ZEPHYR_TOOLCHAIN_VARIANT})
|
||||
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION}
|
||||
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE}
|
||||
REQUIRED QUIET CONFIG HINTS ${ZEPHYR_SDK_INSTALL_DIR}
|
||||
)
|
||||
if(DEFINED ZEPHYR_CURRENT_TOOLCHAIN_VARIANT)
|
||||
@@ -82,10 +82,20 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
|
||||
|
||||
list(REMOVE_DUPLICATES Zephyr-sdk_CONSIDERED_VERSIONS)
|
||||
list(SORT Zephyr-sdk_CONSIDERED_VERSIONS COMPARE NATURAL ORDER DESCENDING)
|
||||
if("${Zephyr-sdk_FIND_VERSION_RANGE_MAX}" STREQUAL "INCLUDE")
|
||||
set(upper_bound _EQUAL)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED Zephyr-sdk_FIND_VERSION_RANGE)
|
||||
# Range not given, max out to ensure max version is not in effect.
|
||||
set(Zephyr-sdk_FIND_VERSION_MAX 99999999)
|
||||
endif()
|
||||
|
||||
# Loop over each found Zepher SDK version until one is found that is compatible.
|
||||
foreach(zephyr_sdk_candidate ${Zephyr-sdk_CONSIDERED_VERSIONS})
|
||||
if("${zephyr_sdk_candidate}" VERSION_GREATER_EQUAL "${Zephyr-sdk_FIND_VERSION}")
|
||||
if("${zephyr_sdk_candidate}" VERSION_GREATER_EQUAL "${Zephyr-sdk_FIND_VERSION}"
|
||||
AND "${zephyr_sdk_candidate}" VERSION_LESS${upper_bound} "${Zephyr-sdk_FIND_VERSION_MAX}"
|
||||
)
|
||||
# Find the path for the current version being checked and get the directory
|
||||
# of the Zephyr SDK so it can be checked.
|
||||
list(FIND zephyr_sdk_found_versions ${zephyr_sdk_candidate} zephyr_sdk_current_index)
|
||||
@@ -93,7 +103,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
|
||||
get_filename_component(zephyr_sdk_current_check_path ${zephyr_sdk_current_check_path} DIRECTORY)
|
||||
|
||||
# Then see if this version is compatible.
|
||||
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION} QUIET CONFIG PATHS ${zephyr_sdk_current_check_path} NO_DEFAULT_PATH)
|
||||
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE} QUIET CONFIG PATHS ${zephyr_sdk_current_check_path} NO_DEFAULT_PATH)
|
||||
|
||||
if (${Zephyr-sdk_FOUND})
|
||||
# A compatible version of the Zephyr SDK has been found which is the highest
|
||||
@@ -106,7 +116,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
|
||||
if (NOT ${Zephyr-sdk_FOUND})
|
||||
# This means no compatible Zephyr SDK versions were found, set the version
|
||||
# back to the minimum version so that it is displayed in the error text.
|
||||
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION} REQUIRED CONFIG PATHS ${zephyr_sdk_search_paths})
|
||||
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE} REQUIRED CONFIG PATHS ${zephyr_sdk_search_paths})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ if (WIN32)
|
||||
set(ENV{PYTHONIOENCODING} "utf-8")
|
||||
endif()
|
||||
|
||||
set(PYTHON_MINIMUM_REQUIRED 3.8)
|
||||
set(PYTHON_MINIMUM_REQUIRED 3.10)
|
||||
|
||||
find_package(Deprecated COMPONENTS PYTHON_PREFER)
|
||||
|
||||
|
||||
106
doc/_static/css/custom.css
vendored
106
doc/_static/css/custom.css
vendored
@@ -114,42 +114,92 @@ hr,
|
||||
}
|
||||
|
||||
/* JavaScript documentation directives */
|
||||
.rst-content dl:not(.docutils) dt {
|
||||
background-color: var(--admonition-note-background-color) !important;
|
||||
border-color: var(--admonition-note-title-background-color) !important;
|
||||
color: var(--admonition-note-color) !important;
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list) > dt {
|
||||
background-color: var(--admonition-note-background-color);
|
||||
border-color: var(--admonition-note-title-background-color);
|
||||
color: var(--admonition-note-color);
|
||||
}
|
||||
.rst-content dl:not(.docutils) dl dt {
|
||||
background-color: var(--admonition-attention-background-color) !important;
|
||||
border-color: var(--admonition-attention-title-background-color) !important;
|
||||
color: var(--admonition-attention-color) !important;
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl dt {
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
color: var(--footer-color);
|
||||
}
|
||||
|
||||
.rst-content dt.sig .k {
|
||||
color: var(--highlight-keyword2-color) !important;
|
||||
font-style: normal !important;
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute dt {
|
||||
font-weight: 600;
|
||||
padding: 0 8px;
|
||||
margin-bottom: 1px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.rst-content dt.sig .kt {
|
||||
color: var(--highlight-keyword-color) !important;
|
||||
font-style: normal !important;
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class > dt,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function > dt,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method > dt,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute > dt {
|
||||
font-family: var(--monospace-font-family);
|
||||
font-variant-ligatures: none;
|
||||
font-size: 90%;
|
||||
font-weight: normal;
|
||||
margin-bottom: 16px;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
|
||||
.rst-content dt.sig .sig-name .n {
|
||||
color: var(--highlight-function-color) !important;
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-prename.descclassname {
|
||||
color: var(--highlight-type2-color);
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.rst-content dt.sig .k,
|
||||
.rst-content dt.sig .kt,
|
||||
.rst-content dt.sig .n {
|
||||
font-weight: normal !important;
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name.descname {
|
||||
color: var(--highlight-function-color);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.rst-content dl:not(.docutils) dt a.headerlink {
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-paren,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
|
||||
color: var(--highlight-operator-color) !important;
|
||||
font-weight: normal;
|
||||
padding: 0 2px;
|
||||
}
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
|
||||
font-style: italic;
|
||||
}
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > em,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > em {
|
||||
color: var(--code-literal-color);
|
||||
font-style: normal;
|
||||
padding: 0 4px;
|
||||
}
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k {
|
||||
font-style: normal;
|
||||
}
|
||||
html.writer-html5 .rst-content dl:not(.docutils) > dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
|
||||
border-top-color: var(--highlight-background-emph-color);
|
||||
background: var(--highlight-background-color);
|
||||
}
|
||||
html.writer-html5 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
|
||||
border-left-color: var(--highlight-background-emph-color);
|
||||
background: var(--highlight-background-color);
|
||||
}
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > .optional ~ em,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > .optional ~ em,
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > .optional ~ em {
|
||||
color: var(--highlight-number-color);
|
||||
font-style: italic;
|
||||
}
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em.property {
|
||||
color: var(--highlight-keyword-color);
|
||||
}
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink {
|
||||
color: var(--link-color) !important;
|
||||
}
|
||||
.rst-content dl:not(.docutils) dt a.headerlink:visited {
|
||||
color: var(--link-color-visited) !important;
|
||||
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink:visited {
|
||||
color: var(--link-color-visited);
|
||||
}
|
||||
html.writer-html5 .rst-content dl.field-list > dd strong {
|
||||
font-family: var(--monospace-font-family);
|
||||
font-variant-ligatures: none;
|
||||
}
|
||||
|
||||
footer,
|
||||
|
||||
1
doc/_templates/searchbox.html
vendored
1
doc/_templates/searchbox.html
vendored
@@ -57,6 +57,7 @@
|
||||
.getElementById("search-se-settings-icon")
|
||||
.setAttribute("aria-expanded", visible ? "true" : "false");
|
||||
};
|
||||
setSearchEngineSettingsMenuVisibility(false);
|
||||
|
||||
window.toggleSearchEngineSettingsMenu = function () {
|
||||
isVisible = searchMenu.style.display === "block";
|
||||
|
||||
@@ -905,6 +905,12 @@ Networking
|
||||
:kconfig:option:`PSA_WANT_ALG_SHA_256` instead of legacy ``CONFIG_MBEDTLS_*``
|
||||
features. (:github:`71827`)
|
||||
|
||||
* The CoAP public API functions :c:func:`coap_get_block1_option` and
|
||||
:c:func:`coap_get_block2_option` have changed. The ``block_number`` pointer
|
||||
type has changed from ``uint8_t *`` to ``uint32_t *``. Additionally,
|
||||
:c:func:`coap_get_block2_option` now accepts an additional ``bool *has_more``
|
||||
parameter, to store the value of the more flag. (:github:`76052`)
|
||||
|
||||
Other Subsystems
|
||||
****************
|
||||
|
||||
|
||||
@@ -2,6 +2,147 @@
|
||||
|
||||
.. _zephyr_3.7:
|
||||
|
||||
.. _zephyr_3.7.1:
|
||||
|
||||
Zephyr 3.7.1
|
||||
############
|
||||
|
||||
This is an LTS maintenance release with fixes.
|
||||
|
||||
Issues fixed
|
||||
************
|
||||
|
||||
These GitHub issues were addressed since the previous 3.7.0 tagged release:
|
||||
|
||||
* :github:`42227` - Teensy41 support SDHC - Storage init Error
|
||||
* :github:`66800` - [Coverity CID: 338107] Division or modulo by zero in subsys/shell/backends/shell_uart.c
|
||||
* :github:`70498` - cellular_modem: Pinnacle 100 does not work with CONFIG_UART_INTERRUPT_DRIVEN
|
||||
* :github:`71397` - Espressif HAL5.1 - Core panic'ed on EPS32S3 with hello_world sample
|
||||
* :github:`71916` - Bump minimum Python version (3.10?) ahead of LTSv3 release
|
||||
* :github:`74291` - Multiple USB contexts for same device lead to bus faults
|
||||
* :github:`74750` - [Coverity CID: 353644] Unintended sign extension in drivers/sensor/ams/tsl2591/tsl2591.c
|
||||
* :github:`74752` - [Coverity CID: 353654] Unintended sign extension in drivers/sensor/ams/tsl2591/tsl2591.c
|
||||
* :github:`75256` - [Coverity CID: 394233] Division or modulo by zero in drivers/sensor/tdk/icm42688/icm42688.h
|
||||
* :github:`75257` - [Coverity CID: 394232] Division or modulo by zero in drivers/sensor/tdk/icm42688/icm42688.h
|
||||
* :github:`75265` - display: stm32-ltdc: incorrect return value for blanking on/off calls when panel controller is not passed in DT
|
||||
* :github:`75318` - Zephyr 3.7 RC2 BLE on STM32 Nucleo WB55 does not work
|
||||
* :github:`75319` - `fatal error: sys/_timespec.h: No such file or directory` with v3.7.0-rc2
|
||||
* :github:`75427` - `CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT` is misleading as it only enables PEM parsing
|
||||
* :github:`75676` - tests: dma: chan_blen_transfer: test breakage on Nucleo-H743ZI
|
||||
* :github:`75686` - ST LIS2DUX12 driver: temperature is not converted to Celsius and raw values are returned
|
||||
* :github:`75736` - Logging stops on all backend when overloaded for a time
|
||||
* :github:`75758` - ST LIS2DUX12 driver: will not correctly read values on big-endian HW
|
||||
* :github:`75834` - xtensa: mpu: adding or removing partitions from memory domain of current running thread has no effect
|
||||
* :github:`75853` - C++: Boot fails with global STL objects
|
||||
* :github:`75909` - CONFIG_NET_NATIVE_OFFLOADED_SOCKETS fails after DTLS handshake
|
||||
* :github:`75912` - RAM retention not working on NXP S32K3
|
||||
* :github:`75967` - bl5340_dvk LCD does not work
|
||||
* :github:`76000` - coap: block_number in coap_get_block1_option() is too small
|
||||
* :github:`76090` - TF-M: builds download source from external git repository
|
||||
* :github:`76185` - scripts: 'west blobs fetch' does not verify digests after downloading
|
||||
* :github:`76254` - linker: section_tags: missing include
|
||||
* :github:`76268` - Bluetooth: PAwR Sync does not compile without PAST receiver compiled in
|
||||
* :github:`76325` - ESP32S3: Zephyr freezes during OTA Update over UDP and BLE
|
||||
* :github:`76360` - Crash if enabling v4-mapping-to-v6 and DHCPv4
|
||||
* :github:`76397` - gdbstub: compilation error on ARM
|
||||
* :github:`76398` - arch: riscv: stacktrace: user thread stack bound check is wrong
|
||||
* :github:`76403` - net: wifi: NM type check is incorrect
|
||||
* :github:`76427` - CONFIG_BT_CTLR_OPTIMIZE_FOR_SPEED not selected by default in zephyr 3.7
|
||||
* :github:`76446` - drivers: mdio: mdio_nxp_enet: Link goes up and down sporadically
|
||||
* :github:`76447` - Odroid Go Boot Failure
|
||||
* :github:`76471` - TCP Delay ACK in case no PSH flag is present causing extremly low download throughput for some clients
|
||||
* :github:`76519` - Get I3C basic device fails for devices that do not support GETCAP
|
||||
* :github:`76549` - Bug in STM32 Disco L475 Arduino I2C header
|
||||
* :github:`76551` - Bluetooth: USB Audio Starvation in BAP Broadcast Sink Sample
|
||||
* :github:`76603` - sensortile_box_pro board does not support hts221 sensor
|
||||
* :github:`76607` - Fixes an uninitialized value in lis2dux12
|
||||
* :github:`76625` - drivers: usb: stm32 udc driver get the global otg interrupt
|
||||
* :github:`76655` - RT11xx device tree build warnings
|
||||
* :github:`76717` - Check L2 send properly for offloaded ifaces
|
||||
* :github:`76718` - PTP - incorrect clock offset calculation
|
||||
* :github:`76737` - Bluetooth L2CAP TX fragmentation state not cleared upon disconnect
|
||||
* :github:`76738` - Sending Bluetooth L2CAP messages after reconnecting sometimes leads to crashes due to uninitalized net_buf callback
|
||||
* :github:`76747` - CONFIG_DEVICE_DT_METADATA=y not tested with usespace enabled
|
||||
* :github:`76762` - arch: riscv: stacktrace: trace is incomplete when unwinding from function without callee
|
||||
* :github:`76776` - http1 dynamic post request response doesn't send header a second time
|
||||
* :github:`76912` - drivers/bluetooth/hci/userchan.c build waring w gcc13
|
||||
* :github:`76932` - Compilation error on Ubuntu 24.04 when CONFIG_FUSE_FS_ACCESS=y
|
||||
* :github:`77006` - Bluetooth: Host: ISO buffer not unreffed
|
||||
* :github:`77007` - Bluetooth: Host: ISO not clearing TX context on disconnect
|
||||
* :github:`77078` - manifest: update percepio
|
||||
* :github:`77089` - nxp: lpc55sxx: sram node address error
|
||||
* :github:`77096` - nxp lpc55xx will crash when trying to use a nxp,ctimer-pwm DTS node
|
||||
* :github:`77126` - RTC RV3028 clock output disabled by enabling alarm/update callback
|
||||
* :github:`77129` - NXP's IMX RT1010 triggers assert on SPI Loopback test when EDMA enabled
|
||||
* :github:`77175` - SCSI Read Capacity reports wrong capacity when used with USB Mass storage device
|
||||
* :github:`77188` - Unaligned 32-bit reads following casts on dns_socket_dispatcher::local_addr (Cortex-M0)
|
||||
* :github:`77221` - Websocket compile issue if Posix API is not set
|
||||
* :github:`77241` - bluetooth: Behavior change in host causing MESH to fail on sending messages
|
||||
* :github:`77269` - da1469x: entropy and gpio drivers throw assertions
|
||||
* :github:`77303` - net: socket: recvmsg() doesn't update msg_controllen accordingly
|
||||
* :github:`77371` - RT11xx bus clocks set incorrectly
|
||||
* :github:`77396` - doc: Documentation scrolling does not work with arrow keys
|
||||
* :github:`77424` - IMXRT11xx secondary core improperly deinit the ENET PLL
|
||||
* :github:`77545` - modules: percepio: Fix python executable name in CMakeLists.txt
|
||||
* :github:`77557` - drivers: ethernet: nxp_enet: Fused MAC address handling is wrong
|
||||
* :github:`77594` - Bluetooth: Failures in unit tests
|
||||
* :github:`77633` - drivers: dai: nxp: sai: RTOS crashes on TX/RX underrun/overrun
|
||||
* :github:`77658` - backported PRs maintain fail status after issues are added to the PR description
|
||||
* :github:`77669` - BLE EDTT GATT tests fail with python >= 3.11
|
||||
* :github:`77784` - STM32 I2S Driver Clock Configuration
|
||||
* :github:`77824` - llext samples fail with BUS ERROR (zephyr-3.7 stable)
|
||||
* :github:`77952` - ESP32: Interrupts with ISRs in flash are not disabled during flash operations
|
||||
* :github:`78037` - [Backport v3.7-branch] Failed to backport #77874
|
||||
* :github:`78138` - riscv: plic: IRQs may not be enabled in non-zero HART
|
||||
* :github:`78146` - mDNS reponder might fail to serve if mDNS resolver is enabled
|
||||
* :github:`78244` - arch: riscv: IRQ stacks of secondary cores are not initialized to `0xAA` when `CONFIG_INIT_STACKS=y`
|
||||
* :github:`78263` - building samples/cpp/hello_world reports "undefined reference to `_impure_ptr` error
|
||||
* :github:`78268` - LPC55xx USB not working with SPEED_OPTIMIZATIONS=y
|
||||
* :github:`78490` - net: l2: ieee802154: IEEE-802.15.4 packets dropped when CONFIG_NET_L2_IEEE802154_SECURITY is enabled
|
||||
* :github:`78494` - subsys: net: socket_tls: Connection vanishes -> Caller blocked forever
|
||||
* :github:`78495` - net: l2: ieee802154: ctx_lock taken but not given
|
||||
* :github:`78608` - Bluetooth: classic: avdtp: missing buffer length check
|
||||
* :github:`78622` - Wrong package for bz2
|
||||
* :github:`78651` - drivers: PHY Microchip KSZ8081 will block system work queue for 500/1000ms
|
||||
* :github:`78724` - net: checksum offloading not working for virtual network interfaces used for Virtual LAN (VLAN)
|
||||
* :github:`78769` - backport: v3.7: dts: arm: st: stm32h5: fix spi 1-3 clocks
|
||||
* :github:`78927` - doc: mcumgr: Wrong license for mcumgr-client
|
||||
* :github:`79208` - sysbuild: ExternalZephyrProject_Add() cannot cope with hwmv2 board and revision
|
||||
* :github:`79288` - driver: clock-control: imx-ccm-rev2: get_rate(FLEXSPI2) returns FLEXSPI1 clock rate
|
||||
* :github:`79298` - arch: riscv: the `s0` dumped during a fatal error is not correct
|
||||
* :github:`79301` - arch: irq: multilevel: the value return from `irq_parent_level_3()` is wrong
|
||||
* :github:`79518` - Temporary Modbus Client "Soft Lock"
|
||||
* :github:`79576` - Dependencies for `SOC_FLASH_MCUX` are incorrect on LPC55xxx platforms
|
||||
* :github:`79788` - net: ip: igmp: IGMPv2 does not work when IGMPv3 is enabled
|
||||
* :github:`79800` - stream_flash: stream_flash_erase_page does not check whether requested offset is in range of stream flash owned area
|
||||
* :github:`79947` - ESP32 touch_sensor not working
|
||||
* :github:`80005` - doc: Documentation issue in 'contribute/documentation/guidelines'
|
||||
* :github:`80134` - up_squared: tests/arch/x86/info/arch.x86.info.userspace [timeout]
|
||||
* :github:`80200` - CMake: Find package with version ranges are ignored for Zephyr SDK
|
||||
* :github:`80383` - drivers: flash: spi_nor: values vom DT not correctly used, when `CONFIG_SPI_NOR_SFDP_RUNTIME=y`
|
||||
* :github:`80429` - Bug in ACD implementation RFC5227
|
||||
* :github:`80476` - mgmt: mcumgr: stat_mgmt: stat_mgmt_list always send legacy behavior
|
||||
* :github:`80541` - Incorrect part number LPC55S69 in Konfig.soc
|
||||
* :github:`80593` - Not possible to write beyond 16MB using flash sample on FRDM_RW612
|
||||
* :github:`80701` - Changes to cortex_m swap code have major impact on kernel context switching times.
|
||||
* :github:`80723` - testsuite: coverage: application unable to include `coverage.h`
|
||||
* :github:`80750` - drivers: can: sam: wrong MRBA configuration
|
||||
* :github:`80810` - samples: subsys: mgmt: mcumgr: smp_svr: UDP overlay missing random selection
|
||||
* :github:`80818` - shell: shell_help: terminal offset of subcommands' help text isn't aligned
|
||||
|
||||
Mbed TLS
|
||||
********
|
||||
|
||||
Mbed TLS was updated to version 3.6.2 (from 3.6.0). The release notes can be found at:
|
||||
|
||||
* https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.1
|
||||
* https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.2
|
||||
|
||||
Mbed TLS 3.6 is an LTS release that will be supported
|
||||
with security and bug fixes until at least March 2027.
|
||||
|
||||
.. _zephyr_3.7.0:
|
||||
|
||||
Zephyr 3.7.0
|
||||
############
|
||||
|
||||
|
||||
@@ -48,26 +48,26 @@ project.
|
||||
.. table:: Tools and Libraries for MCUmgr
|
||||
:align: center
|
||||
|
||||
+--------------------------------------------------------------------------------+-------------------------------------------+--------------------------+--------------------------------------------------+---------------+------------+---------+
|
||||
| Name | OS support | Transports | Groups | Type | Language | License |
|
||||
| +---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+ | | |
|
||||
| | Windows | Linux | mac | Mobile | Embedded | Serial | Bluetooth | UDP | OS | IMG | Stat | Settings | FS | Shell | Zephyr | | | |
|
||||
+================================================================================+=========+=======+=====+========+==========+========+===========+=====+====+=====+======+==========+====+=======+========+===============+============+=========+
|
||||
| `AuTerm <https://github.com/thedjnK/AuTerm/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Application | C++ (Qt) | GPLv3 |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
|
||||
| `mcumgr-client <https://github.com/vouch-opensource/mcumgr-client/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Application | Rust | BSD |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
|
||||
| `mcumgr-web <https://github.com/boogie/mcumgr-web/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Web page | Javascript | MIT |
|
||||
| | | | | | | | | | | | | | | | | (chrome only) | | |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
|
||||
| nRF Connect Device Manager: |br| | | | | | | | | | | | | | | | | | | |
|
||||
| `Android | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Library and | Java, | Apache |
|
||||
| <https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager/>`_ | | | | | | | | | | | | | | | | application | Kotlin, | |
|
||||
| and `iOS | | | | | | | | | | | | | | | | | Swift | |
|
||||
| <https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager>`_ | | | | | | | | | | | | | | | | | | |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
|
||||
| Zephyr MCUmgr client (in-tree) | ✕ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Library | C | Apache |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
|
||||
+--------------------------------------------------------------------------------+-------------------------------------------+--------------------------+--------------------------------------------------+---------------+------------+------------+
|
||||
| Name | OS support | Transports | Groups | Type | Language | License |
|
||||
| +---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+ | | |
|
||||
| | Windows | Linux | mac | Mobile | Embedded | Serial | Bluetooth | UDP | OS | IMG | Stat | Settings | FS | Shell | Zephyr | | | |
|
||||
+================================================================================+=========+=======+=====+========+==========+========+===========+=====+====+=====+======+==========+====+=======+========+===============+============+============+
|
||||
| `AuTerm <https://github.com/thedjnK/AuTerm/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Application | C++ (Qt) | GPL-3.0 |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
|
||||
| `mcumgr-client <https://github.com/vouch-opensource/mcumgr-client/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Application | Rust | Apache-2.0 |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
|
||||
| `mcumgr-web <https://github.com/boogie/mcumgr-web/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Web page | Javascript | MIT |
|
||||
| | | | | | | | | | | | | | | | | (chrome only) | | |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
|
||||
| nRF Connect Device Manager: |br| | | | | | | | | | | | | | | | | | | |
|
||||
| `Android | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Library and | Java, | Apache-2.0 |
|
||||
| <https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager/>`_ | | | | | | | | | | | | | | | | application | Kotlin, | |
|
||||
| and `iOS | | | | | | | | | | | | | | | | | Swift | |
|
||||
| <https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager>`_ | | | | | | | | | | | | | | | | | | |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
|
||||
| Zephyr MCUmgr client (in-tree) | ✕ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Library | C | Apache-2.0 |
|
||||
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
|
||||
|
||||
.. only:: latex
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ taking form:
|
||||
| Content | Size | Description |
|
||||
+===============+===============+===========================+
|
||||
| body | no more than | Raw body data fragment |
|
||||
| | MTU - 3 | |
|
||||
| | MTU - 5 | |
|
||||
+---------------+---------------+---------------------------+
|
||||
| crc16 | 2 bytes | CRC16 of entire packet |
|
||||
| | | body, preceding length |
|
||||
|
||||
@@ -506,6 +506,7 @@ static int adc_sam0_read_async(const struct device *dev,
|
||||
static const struct adc_driver_api adc_sam0_api = {
|
||||
.channel_setup = adc_sam0_channel_setup,
|
||||
.read = adc_sam0_read,
|
||||
.ref_internal = 1000U, /* Fixed 1.0 V reference */
|
||||
#ifdef CONFIG_ADC_ASYNC
|
||||
.read_async = adc_sam0_read_async,
|
||||
#endif
|
||||
|
||||
@@ -63,6 +63,7 @@ config BT_STM32_IPM
|
||||
depends on DT_HAS_ST_STM32WB_RF_ENABLED
|
||||
select USE_STM32_HAL_CORTEX
|
||||
select HAS_STM32LIB
|
||||
select BT_HCI_SETUP
|
||||
help
|
||||
TODO
|
||||
|
||||
|
||||
@@ -565,6 +565,19 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
|
||||
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
|
||||
0, K_NO_WAIT);
|
||||
|
||||
hci->recv = recv;
|
||||
|
||||
LOG_DBG("IPM Channel Open Completed");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bt_ipm_setup(const struct device *dev, const struct bt_hci_setup_params *params)
|
||||
{
|
||||
ARG_UNUSED(params);
|
||||
ARG_UNUSED(dev);
|
||||
int err;
|
||||
|
||||
#ifdef CONFIG_BT_HCI_HOST
|
||||
err = bt_ipm_ble_init();
|
||||
if (err) {
|
||||
@@ -572,9 +585,7 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
|
||||
}
|
||||
#endif /* CONFIG_BT_HCI_HOST */
|
||||
|
||||
hci->recv = recv;
|
||||
|
||||
LOG_DBG("IPM Channel Open Completed");
|
||||
LOG_DBG("IPM Channel Setup Completed");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -613,6 +624,7 @@ static const struct bt_hci_driver_api drv = {
|
||||
.close = bt_ipm_close,
|
||||
#endif
|
||||
.send = bt_ipm_send,
|
||||
.setup = bt_ipm_setup,
|
||||
};
|
||||
|
||||
static int _bt_ipm_init(const struct device *dev)
|
||||
|
||||
@@ -181,7 +181,7 @@ static void rx_thread(void *p1, void *p2, void *p3)
|
||||
|
||||
LOG_DBG("started");
|
||||
|
||||
uint16_t frame_size = 0;
|
||||
ssize_t frame_size = 0;
|
||||
|
||||
while (1) {
|
||||
static uint8_t frame[512];
|
||||
|
||||
@@ -106,7 +106,7 @@ static int can_sam_init(const struct device *dev)
|
||||
uint32_t mrba = sam_cfg->mram & 0xFFFF0000;
|
||||
|
||||
/* keep lower 16bit; update DMA Base Register */
|
||||
sys_write32(sam_cfg->dma_base, (sys_read32(sam_cfg->dma_base) & 0x0000FFFF) | mrba);
|
||||
sys_write32((sys_read32(sam_cfg->dma_base) & 0x0000FFFF) | mrba, sam_cfg->dma_base);
|
||||
|
||||
ret = can_mcan_configure_mram(dev, mrba, sam_cfg->mram);
|
||||
if (ret != 0) {
|
||||
|
||||
@@ -155,10 +155,8 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
|
||||
|
||||
#ifdef CONFIG_MEMC_MCUX_FLEXSPI
|
||||
case IMX_CCM_FLEXSPI_CLK:
|
||||
clock_root = kCLOCK_Root_Flexspi1;
|
||||
break;
|
||||
case IMX_CCM_FLEXSPI2_CLK:
|
||||
clock_root = kCLOCK_Root_Flexspi2;
|
||||
clock_root = kCLOCK_Root_Flexspi1 + instance;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_COUNTER_NXP_PIT
|
||||
|
||||
@@ -95,20 +95,14 @@ void sai_isr(const void *parameter)
|
||||
|
||||
/* check for TX FIFO error */
|
||||
if (SAI_TX_RX_STATUS_IS_SET(DAI_DIR_TX, data->regmap, kSAI_FIFOErrorFlag)) {
|
||||
LOG_ERR("FIFO underrun detected");
|
||||
/* TODO: this will crash the program and should be addressed as
|
||||
* mentioned in TODO list's 2).
|
||||
*/
|
||||
z_irq_spurious(NULL);
|
||||
LOG_WRN("FIFO underrun detected");
|
||||
SAI_TX_RX_STATUS_CLEAR(DAI_DIR_TX, data->regmap, kSAI_FIFOErrorFlag);
|
||||
}
|
||||
|
||||
/* check for RX FIFO error */
|
||||
if (SAI_TX_RX_STATUS_IS_SET(DAI_DIR_RX, data->regmap, kSAI_FIFOErrorFlag)) {
|
||||
LOG_ERR("FIFO overrun detected");
|
||||
/* TODO: this will crash the program and should be addressed as
|
||||
* mentioned in TODO list's 2).
|
||||
*/
|
||||
z_irq_spurious(NULL);
|
||||
LOG_WRN("FIFO overrun detected");
|
||||
SAI_TX_RX_STATUS_CLEAR(DAI_DIR_RX, data->regmap, kSAI_FIFOErrorFlag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,6 +210,11 @@ LOG_MODULE_REGISTER(nxp_dai_sai);
|
||||
((dir) == DAI_DIR_RX ? ((UINT_TO_I2S(regmap))->RCSR & (which)) : \
|
||||
((UINT_TO_I2S(regmap))->TCSR & (which)))
|
||||
|
||||
/* used to clear status flags */
|
||||
#define SAI_TX_RX_STATUS_CLEAR(dir, regmap, which) \
|
||||
((dir) == DAI_DIR_RX ? SAI_RxClearStatusFlags(UINT_TO_I2S(regmap), which) \
|
||||
: SAI_TxClearStatusFlags(UINT_TO_I2S(regmap), which))
|
||||
|
||||
/* used to retrieve the SYNC direction. Use this macro when you know for sure
|
||||
* you have 1 SYNC direction with 1 ASYNC direction.
|
||||
*/
|
||||
|
||||
@@ -252,8 +252,10 @@ static int stm32_ltdc_display_blanking_off(const struct device *dev)
|
||||
const struct display_stm32_ltdc_config *config = dev->config;
|
||||
const struct device *display_dev = config->display_controller;
|
||||
|
||||
/* Panel controller's phandle is not passed to LTDC in devicetree */
|
||||
if (display_dev == NULL) {
|
||||
return 0;
|
||||
LOG_ERR("There is no panel controller to forward blanking_off call to");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
if (!device_is_ready(display_dev)) {
|
||||
@@ -269,8 +271,10 @@ static int stm32_ltdc_display_blanking_on(const struct device *dev)
|
||||
const struct display_stm32_ltdc_config *config = dev->config;
|
||||
const struct device *display_dev = config->display_controller;
|
||||
|
||||
/* Panel controller's phandle is not passed to LTDC in devicetree */
|
||||
if (display_dev == NULL) {
|
||||
return 0;
|
||||
LOG_ERR("There is no panel controller to forward blanking_on call to");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
if (!device_is_ready(config->display_controller)) {
|
||||
|
||||
@@ -93,6 +93,7 @@ static void trng_enable(bool enable)
|
||||
} else {
|
||||
CRG_TOP->CLK_AMBA_REG &= ~CRG_TOP_CLK_AMBA_REG_TRNG_CLK_ENABLE_Msk;
|
||||
TRNG->TRNG_CTRL_REG = 0;
|
||||
NVIC_ClearPendingIRQ(IRQN);
|
||||
|
||||
entropy_smartbond_pm_policy_state_lock_put();
|
||||
}
|
||||
|
||||
@@ -199,12 +199,12 @@ struct host_sub_npcx_data host_sub_data;
|
||||
#define EC_CFG_LDN_HCMD 0x12 /* PM Channel 2 */
|
||||
|
||||
/* Index of EC (4E/4F) Configuration Register */
|
||||
#define EC_CFG_IDX_LDN 0x07
|
||||
#define EC_CFG_IDX_CTRL 0x30
|
||||
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x60
|
||||
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x61
|
||||
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x62
|
||||
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x63
|
||||
#define EC_CFG_IDX_LDN 0x07
|
||||
#define EC_CFG_IDX_CTRL 0x30
|
||||
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x60
|
||||
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x61
|
||||
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x62
|
||||
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x63
|
||||
|
||||
/* LDN Activation Enable */
|
||||
#define EC_CFG_IDX_CTRL_LDN_ENABLE 0x01
|
||||
@@ -1029,15 +1029,15 @@ void npcx_host_init_subs_host_domain(void)
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_LDN, EC_CFG_LDN_HCMD);
|
||||
#if defined(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM)
|
||||
/* Configure IO address of CMD portt (default: 0x200) */
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
|
||||
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM >> 8) & 0xff);
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
|
||||
CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM & 0xff);
|
||||
/* Configure IO address of Data portt (default: 0x204) */
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
|
||||
((CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) >> 8)
|
||||
& 0xff);
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
|
||||
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
|
||||
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) & 0xff);
|
||||
#endif
|
||||
/* Enable 'Host Command' io port (PM Channel 2) */
|
||||
|
||||
@@ -224,15 +224,16 @@ static int eth_nxp_enet_tx(const struct device *dev, struct net_pkt *pkt)
|
||||
|
||||
ret = ENET_SendFrame(data->base, &data->enet_handle, data->tx_frame_buf,
|
||||
total_len, RING_ID, frame_is_timestamped, pkt);
|
||||
if (ret == kStatus_Success) {
|
||||
|
||||
if (ret != kStatus_Success) {
|
||||
LOG_ERR("ENET_SendFrame error: %d", ret);
|
||||
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
|
||||
ret = -EIO;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (frame_is_timestamped) {
|
||||
eth_wait_for_ptp_ts(dev, pkt);
|
||||
} else {
|
||||
LOG_ERR("ENET_SendFrame error: %d", ret);
|
||||
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -634,20 +635,25 @@ static inline void nxp_enet_fused_mac(uint8_t *mac_addr)
|
||||
#ifdef CONFIG_SOC_FAMILY_NXP_IMXRT
|
||||
uint32_t mac_addr_fuse[2] = {0};
|
||||
|
||||
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
|
||||
#if defined(CONFIG_SOC_SERIES_IMXRT10XX)
|
||||
0x620,
|
||||
OCOTP_Init((OCOTP_Type *)OCOTP_BASE, CLOCK_GetIpgFreq());
|
||||
/* OTP bank 4, word 2: MAC0 */
|
||||
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
|
||||
0x22, &mac_addr_fuse[0], 1);
|
||||
/* OTP bank 4, word 3: MAC1*/
|
||||
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
|
||||
0x23, &mac_addr_fuse[1], 1);
|
||||
#elif defined(CONFIG_SOC_SERIES_IMXRT11XX)
|
||||
0xA90,
|
||||
OCOTP_Init((OCOTP_Type *)OCOTP_BASE, 0);
|
||||
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
|
||||
0x28, &mac_addr_fuse[0], 2);
|
||||
#endif
|
||||
mac_addr_fuse, 2);
|
||||
|
||||
mac_addr[0] = mac_addr_fuse[0] & 0x000000FF;
|
||||
mac_addr[1] = mac_addr_fuse[0] & 0x0000FF00;
|
||||
mac_addr[2] = mac_addr_fuse[0] & 0x00FF0000;
|
||||
mac_addr[3] = mac_addr_fuse[0] & 0xFF000000;
|
||||
mac_addr[4] = mac_addr_fuse[1] & 0x00FF;
|
||||
mac_addr[5] = mac_addr_fuse[1] & 0xFF00;
|
||||
mac_addr[1] = (mac_addr_fuse[0] & 0x0000FF00) >> 8;
|
||||
mac_addr[2] = (mac_addr_fuse[0] & 0x00FF0000) >> 16;
|
||||
mac_addr[3] = (mac_addr_fuse[0] & 0xFF000000) >> 24;
|
||||
mac_addr[4] = (mac_addr_fuse[1] & 0x00FF);
|
||||
mac_addr[5] = (mac_addr_fuse[1] & 0xFF00) >> 8;
|
||||
#else
|
||||
ARG_UNUSED(mac_addr);
|
||||
#endif
|
||||
|
||||
@@ -26,12 +26,12 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
||||
#define PHY_MC_KSZ8081_OMSO_REG 0x16
|
||||
#define PHY_MC_KSZ8081_OMSO_FACTORY_MODE_MASK BIT(15)
|
||||
#define PHY_MC_KSZ8081_OMSO_NAND_TREE_MASK BIT(5)
|
||||
#define PHY_MC_KSZ8081_OMSO_RMII_OVERRIDE_MASK BIT(1)
|
||||
#define PHY_MC_KSZ8081_OMSO_MII_OVERRIDE_MASK BIT(0)
|
||||
|
||||
#define PHY_MC_KSZ8081_CTRL2_REG 0x1F
|
||||
#define PHY_MC_KSZ8081_CTRL2_REF_CLK_SEL BIT(7)
|
||||
|
||||
#define PHY_MC_KSZ8081_RESET_HOLD_TIME
|
||||
|
||||
enum ksz8081_interface {
|
||||
KSZ8081_MII,
|
||||
KSZ8081_RMII,
|
||||
@@ -237,6 +237,10 @@ static int phy_mc_ksz8081_static_cfg(const struct device *dev)
|
||||
|
||||
omso &= ~PHY_MC_KSZ8081_OMSO_FACTORY_MODE_MASK &
|
||||
~PHY_MC_KSZ8081_OMSO_NAND_TREE_MASK;
|
||||
if (config->phy_iface == KSZ8081_RMII) {
|
||||
omso &= ~PHY_MC_KSZ8081_OMSO_MII_OVERRIDE_MASK;
|
||||
omso |= PHY_MC_KSZ8081_OMSO_RMII_OVERRIDE_MASK;
|
||||
}
|
||||
|
||||
ret = phy_mc_ksz8081_write(dev, PHY_MC_KSZ8081_OMSO_REG, (uint32_t)omso);
|
||||
if (ret) {
|
||||
@@ -289,11 +293,15 @@ static int phy_mc_ksz8081_reset(const struct device *dev)
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Wait for 500 ms as specified by datasheet */
|
||||
k_busy_wait(USEC_PER_MSEC * 500);
|
||||
/* Wait for at least 500 us as specified by datasheet */
|
||||
k_busy_wait(1000);
|
||||
|
||||
/* Reset over */
|
||||
ret = gpio_pin_set_dt(&config->reset_gpio, 1);
|
||||
|
||||
/* After deasserting reset, must wait at least 100 us to use programming interface */
|
||||
k_busy_wait(200);
|
||||
|
||||
goto done;
|
||||
skip_reset_gpio:
|
||||
#endif /* DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios) */
|
||||
@@ -301,8 +309,11 @@ skip_reset_gpio:
|
||||
if (ret) {
|
||||
goto done;
|
||||
}
|
||||
/* Wait for 500 ms as specified by datasheet */
|
||||
k_busy_wait(USEC_PER_MSEC * 500);
|
||||
|
||||
/* According to IEEE 802.3, Section 2, Subsection 22.2.4.1.1,
|
||||
* a PHY reset may take up to 0.5 s.
|
||||
*/
|
||||
k_busy_wait(500 * USEC_PER_MSEC);
|
||||
|
||||
done:
|
||||
/* Unlock mutex */
|
||||
@@ -329,12 +340,6 @@ static int phy_mc_ksz8081_cfg_link(const struct device *dev,
|
||||
/* We are going to reconfigure the phy, don't need to monitor until done */
|
||||
k_work_cancel_delayable(&data->phy_monitor_work);
|
||||
|
||||
/* Reset PHY */
|
||||
ret = phy_mc_ksz8081_reset(dev);
|
||||
if (ret) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* DT configurations */
|
||||
ret = phy_mc_ksz8081_static_cfg(dev);
|
||||
if (ret) {
|
||||
|
||||
@@ -886,6 +886,37 @@ static int flash_flexspi_nor_check_jedec(struct flash_flexspi_nor_data *data,
|
||||
|
||||
/* Switch on manufacturer and vendor ID */
|
||||
switch (vendor_id & 0xFFFF) {
|
||||
case 0x40ef:
|
||||
/* W25Q512JV flash, use 4 byte read/write */
|
||||
flexspi_lut[READ][0] = FLEXSPI_LUT_SEQ(
|
||||
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_4READ_4B,
|
||||
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_4PAD, 32);
|
||||
/* Flash needs 6 dummy cycles (at 104MHz) */
|
||||
flexspi_lut[READ][1] = FLEXSPI_LUT_SEQ(
|
||||
kFLEXSPI_Command_DUMMY_SDR, kFLEXSPI_4PAD, 6,
|
||||
kFLEXSPI_Command_READ_SDR, kFLEXSPI_4PAD, 0x04);
|
||||
/* Only 1S-1S-4S page program supported */
|
||||
flexspi_lut[PAGE_PROGRAM][0] = FLEXSPI_LUT_SEQ(
|
||||
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_PP_1_1_4_4B,
|
||||
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32);
|
||||
flexspi_lut[PAGE_PROGRAM][1] = FLEXSPI_LUT_SEQ(
|
||||
kFLEXSPI_Command_WRITE_SDR, kFLEXSPI_4PAD, 0x4,
|
||||
kFLEXSPI_Command_STOP, kFLEXSPI_1PAD, 0x0);
|
||||
/* Update ERASE commands for 4 byte mode */
|
||||
flexspi_lut[ERASE_SECTOR][0] = FLEXSPI_LUT_SEQ(
|
||||
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_SE_4B,
|
||||
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32);
|
||||
flexspi_lut[ERASE_BLOCK][0] = FLEXSPI_LUT_SEQ(
|
||||
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, 0xDC,
|
||||
kFLEXSPI_Command_RADDR_SDR, kFLEXSPI_1PAD, 32),
|
||||
/* Read instruction used for polling is 0x05 */
|
||||
data->legacy_poll = true;
|
||||
flexspi_lut[READ_STATUS_REG][0] = FLEXSPI_LUT_SEQ(
|
||||
kFLEXSPI_Command_SDR, kFLEXSPI_1PAD, SPI_NOR_CMD_RDSR,
|
||||
kFLEXSPI_Command_READ_SDR, kFLEXSPI_1PAD, 0x01);
|
||||
/* Device uses bit 1 of status reg 2 for QE */
|
||||
return flash_flexspi_nor_quad_enable(data, flexspi_lut,
|
||||
JESD216_DW15_QER_VAL_S2B1v5);
|
||||
case 0x25C2:
|
||||
/* MX25 flash, use 4 byte read/write */
|
||||
flexspi_lut[READ][0] = FLEXSPI_LUT_SEQ(
|
||||
|
||||
@@ -1603,20 +1603,12 @@ static const struct flash_driver_api spi_nor_api = {
|
||||
|
||||
#define INST_HAS_LOCK(idx) DT_INST_NODE_HAS_PROP(idx, has_lock)
|
||||
|
||||
#define INST_HAS_WP_GPIO(idx) DT_INST_NODE_HAS_PROP(idx, wp_gpios)
|
||||
|
||||
#define INST_HAS_HOLD_GPIO(idx) DT_INST_NODE_HAS_PROP(idx, hold_gpios)
|
||||
|
||||
#define LOCK_DEFINE(idx) \
|
||||
IF_ENABLED(INST_HAS_LOCK(idx), (BUILD_ASSERT(DT_INST_PROP(idx, has_lock) == \
|
||||
(DT_INST_PROP(idx, has_lock) & 0xFF), \
|
||||
"Need support for lock clear beyond SR1");))
|
||||
|
||||
#define INST_HAS_ENTER_4BYTE_ADDR(idx) DT_INST_NODE_HAS_PROP(idx, enter_4byte_addr)
|
||||
|
||||
#define CONFIGURE_4BYTE_ADDR(idx) \
|
||||
IF_ENABLED(INST_HAS_ENTER_4BYTE_ADDR(idx), \
|
||||
(.enter_4byte_addr = DT_INST_PROP(idx, enter_4byte_addr),))
|
||||
#define CONFIGURE_4BYTE_ADDR(idx) .enter_4byte_addr = DT_INST_PROP_OR(idx, enter_4byte_addr, 0),
|
||||
|
||||
#define INIT_T_ENTER_DPD(idx) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, t_enter_dpd), \
|
||||
@@ -1632,15 +1624,9 @@ static const struct flash_driver_api spi_nor_api = {
|
||||
(.t_exit_dpd = 0))
|
||||
#endif
|
||||
|
||||
#define INIT_WP_GPIOS(idx) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, wp_gpios), \
|
||||
(.wp = GPIO_DT_SPEC_INST_GET(idx, wp_gpios)), \
|
||||
(.wp = {0}))
|
||||
#define INIT_WP_GPIOS(idx) .wp = GPIO_DT_SPEC_INST_GET_OR(idx, wp_gpios, {0})
|
||||
|
||||
#define INIT_HOLD_GPIOS(idx) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, hold_gpios), \
|
||||
(.hold = GPIO_DT_SPEC_INST_GET(idx, hold_gpios)), \
|
||||
(.hold = {0},))
|
||||
#define INIT_HOLD_GPIOS(idx) .hold = GPIO_DT_SPEC_INST_GET_OR(idx, hold_gpios, {0})
|
||||
|
||||
#define INIT_WAKEUP_SEQ_PARAMS(idx) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, dpd_wakeup_sequence), \
|
||||
@@ -1652,44 +1638,42 @@ static const struct flash_driver_api spi_nor_api = {
|
||||
DT_INST_PROP_BY_IDX(idx, dpd_wakeup_sequence, 2), NSEC_PER_MSEC)),\
|
||||
(.t_dpdd_ms = 0, .t_crdp_ms = 0, .t_rdp_ms = 0))
|
||||
|
||||
#define INIT_MXICY_MX25R_POWER_MODE(idx) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, mxicy_mx25r_power_mode), \
|
||||
(.mxicy_mx25r_power_mode = DT_INST_ENUM_IDX(idx, mxicy_mx25r_power_mode)),\
|
||||
(.mxicy_mx25r_power_mode = 0))
|
||||
#define INIT_MXICY_MX25R_POWER_MODE(idx) \
|
||||
.mxicy_mx25r_power_mode = DT_INST_ENUM_IDX_OR(idx, mxicy_mx25r_power_mode, 0)
|
||||
|
||||
#define INIT_RESET_GPIOS(idx) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, reset_gpios), \
|
||||
(.reset = GPIO_DT_SPEC_INST_GET(idx, reset_gpios)), \
|
||||
(.reset = {0}))
|
||||
#define INIT_RESET_GPIOS(idx) .reset = GPIO_DT_SPEC_INST_GET_OR(idx, reset_gpios, {0})
|
||||
|
||||
#define INST_CONFIG_STRUCT_GEN(idx) \
|
||||
DEFINE_PAGE_LAYOUT(idx) \
|
||||
.flash_size = DT_INST_PROP(idx, size) / 8, \
|
||||
.jedec_id = DT_INST_PROP(idx, jedec_id), \
|
||||
.dpd_exist = DT_INST_PROP(idx, has_dpd), \
|
||||
.dpd_wakeup_sequence_exist = DT_INST_NODE_HAS_PROP(idx, dpd_wakeup_sequence), \
|
||||
.mxicy_mx25r_power_mode_exist = DT_INST_NODE_HAS_PROP(idx, mxicy_mx25r_power_mode), \
|
||||
.reset_gpios_exist = DT_INST_NODE_HAS_PROP(idx, reset_gpios), \
|
||||
.requires_ulbpr_exist = DT_INST_PROP(idx, requires_ulbpr), \
|
||||
.wp_gpios_exist = DT_INST_NODE_HAS_PROP(idx, wp_gpios), \
|
||||
.hold_gpios_exist = DT_INST_NODE_HAS_PROP(idx, hold_gpios), \
|
||||
IF_ENABLED(INST_HAS_LOCK(idx), (.has_lock = DT_INST_PROP(idx, has_lock),)) \
|
||||
IF_ENABLED(CONFIG_SPI_NOR_SFDP_MINIMAL, (CONFIGURE_4BYTE_ADDR(idx))) \
|
||||
IF_ENABLED(CONFIG_SPI_NOR_SFDP_DEVICETREE, \
|
||||
(.bfp_len = sizeof(bfp_##idx##_data) / 4, \
|
||||
.bfp = (const struct jesd216_bfp *)bfp_##idx##_data,)) \
|
||||
IF_ENABLED(ANY_INST_HAS_DPD, (INIT_T_ENTER_DPD(idx),)) \
|
||||
IF_ENABLED(UTIL_AND(ANY_INST_HAS_DPD, ANY_INST_HAS_T_EXIT_DPD), (INIT_T_EXIT_DPD(idx),))\
|
||||
IF_ENABLED(ANY_INST_HAS_DPD_WAKEUP_SEQUENCE, (INIT_WAKEUP_SEQ_PARAMS(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_MXICY_MX25R_POWER_MODE, (INIT_MXICY_MX25R_POWER_MODE(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_RESET_GPIOS, (INIT_RESET_GPIOS(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_WP_GPIOS, (INIT_WP_GPIOS(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_HOLD_GPIOS, (INIT_HOLD_GPIOS(idx),))
|
||||
.bfp = (const struct jesd216_bfp *)bfp_##idx##_data,))
|
||||
|
||||
#define GENERATE_CONFIG_STRUCT(idx) \
|
||||
static const struct spi_nor_config spi_nor_##idx##_config = { \
|
||||
.spi = SPI_DT_SPEC_INST_GET(idx, SPI_WORD_SET(8), CONFIG_SPI_NOR_CS_WAIT_DELAY),\
|
||||
COND_CODE_1(CONFIG_SPI_NOR_SFDP_RUNTIME, EMPTY(), (INST_CONFIG_STRUCT_GEN(idx)))};
|
||||
.dpd_exist = DT_INST_PROP(idx, has_dpd), \
|
||||
.dpd_wakeup_sequence_exist = DT_INST_NODE_HAS_PROP(idx, dpd_wakeup_sequence), \
|
||||
.mxicy_mx25r_power_mode_exist = \
|
||||
DT_INST_NODE_HAS_PROP(idx, mxicy_mx25r_power_mode), \
|
||||
.reset_gpios_exist = DT_INST_NODE_HAS_PROP(idx, reset_gpios), \
|
||||
.requires_ulbpr_exist = DT_INST_PROP(idx, requires_ulbpr), \
|
||||
.wp_gpios_exist = DT_INST_NODE_HAS_PROP(idx, wp_gpios), \
|
||||
.hold_gpios_exist = DT_INST_NODE_HAS_PROP(idx, hold_gpios), \
|
||||
IF_ENABLED(INST_HAS_LOCK(idx), (.has_lock = DT_INST_PROP(idx, has_lock),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_DPD, (INIT_T_ENTER_DPD(idx),)) \
|
||||
IF_ENABLED(UTIL_AND(ANY_INST_HAS_DPD, ANY_INST_HAS_T_EXIT_DPD), \
|
||||
(INIT_T_EXIT_DPD(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_DPD_WAKEUP_SEQUENCE, (INIT_WAKEUP_SEQ_PARAMS(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_MXICY_MX25R_POWER_MODE, \
|
||||
(INIT_MXICY_MX25R_POWER_MODE(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_RESET_GPIOS, (INIT_RESET_GPIOS(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_WP_GPIOS, (INIT_WP_GPIOS(idx),)) \
|
||||
IF_ENABLED(ANY_INST_HAS_HOLD_GPIOS, (INIT_HOLD_GPIOS(idx),)) \
|
||||
IF_DISABLED(CONFIG_SPI_NOR_SFDP_RUNTIME, (INST_CONFIG_STRUCT_GEN(idx)))};
|
||||
|
||||
#define ASSIGN_PM(idx) \
|
||||
PM_DEVICE_DT_INST_DEFINE(idx, spi_nor_pm_control);
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
#include <da1469x_pdc.h>
|
||||
#include <da1469x_pd.h>
|
||||
|
||||
#define GPIO_MODE_RESET 0x200
|
||||
|
||||
#define GPIO_PUPD_INPUT 0
|
||||
#define GPIO_PUPD_INPUT_PU 1
|
||||
#define GPIO_PUPD_INPUT_PD 2
|
||||
@@ -117,8 +115,8 @@ static int gpio_smartbond_pin_configure(const struct device *dev,
|
||||
const struct gpio_smartbond_config *config = dev->config;
|
||||
|
||||
if (flags == GPIO_DISCONNECTED) {
|
||||
/* Reset to default value */
|
||||
config->mode_regs[pin] = GPIO_MODE_RESET;
|
||||
/* Set pin as input with no resistors selected */
|
||||
config->mode_regs[pin] = GPIO_PUPD_INPUT << GPIO_P0_00_MODE_REG_PUPD_Pos;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -166,7 +164,8 @@ static int gpio_smartbond_port_set_masked_raw(const struct device *dev,
|
||||
{
|
||||
const struct gpio_smartbond_config *config = dev->config;
|
||||
|
||||
config->data_regs->data = value & mask;
|
||||
config->data_regs->set = value & mask;
|
||||
config->data_regs->reset = ~value & mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -244,7 +243,9 @@ static int gpio_smartbond_pin_interrupt_configure(const struct device *dev,
|
||||
config->wkup_regs->clear = pin_mask;
|
||||
data->both_edges_pins &= ~pin_mask;
|
||||
#if CONFIG_PM
|
||||
da1469x_pdc_del(pdc_ix);
|
||||
if (pdc_ix >= 0) {
|
||||
da1469x_pdc_del(pdc_ix);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
if (trig == GPIO_INT_TRIG_BOTH) {
|
||||
|
||||
@@ -139,12 +139,21 @@ static int i2s_stm32_set_clock(const struct device *dev,
|
||||
uint8_t i2s_div, i2s_odd;
|
||||
|
||||
if (cfg->pclk_len > 1) {
|
||||
/* Handle multiple clock sources */
|
||||
if (clock_control_get_rate(DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE),
|
||||
(clock_control_subsys_t)&cfg->pclken[1],
|
||||
&freq_in) < 0) {
|
||||
LOG_ERR("Failed call clock_control_get_rate(pclken[1])");
|
||||
return -EIO;
|
||||
}
|
||||
} else {
|
||||
/* Handle single clock source */
|
||||
if (clock_control_get_rate(DEVICE_DT_GET(STM32_CLOCK_CONTROL_NODE),
|
||||
(clock_control_subsys_t)&cfg->pclken[0],
|
||||
&freq_in) < 0) {
|
||||
LOG_ERR("Failed call clock_control_get_rate(pclken[0])");
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* The ratio between input clock (I2SxClk) and output
|
||||
|
||||
@@ -561,6 +561,8 @@ int i3c_device_basic_info_get(struct i3c_device_desc *target)
|
||||
memcpy(&target->getcaps, &caps, sizeof(target->getcaps));
|
||||
} else if ((ret != 0) && (target->bcr & I3C_BCR_ADV_CAPABILITIES)) {
|
||||
goto out;
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
target->dcr = dcr.dcr;
|
||||
|
||||
@@ -63,9 +63,11 @@
|
||||
|
||||
#ifdef CONFIG_TEST_INTC_PLIC
|
||||
#define INTC_PLIC_STATIC
|
||||
#define INTC_PLIC_STATIC_INLINE
|
||||
#else
|
||||
#define INTC_PLIC_STATIC static inline
|
||||
#endif
|
||||
#define INTC_PLIC_STATIC static
|
||||
#define INTC_PLIC_STATIC_INLINE static inline
|
||||
#endif /* CONFIG_TEST_INTC_PLIC */
|
||||
|
||||
typedef void (*riscv_plic_irq_config_func_t)(void);
|
||||
struct plic_config {
|
||||
@@ -77,6 +79,7 @@ struct plic_config {
|
||||
uint32_t num_irqs;
|
||||
riscv_plic_irq_config_func_t irq_config_func;
|
||||
struct _isr_table_entry *isr_table;
|
||||
const uint32_t *const hart_context;
|
||||
};
|
||||
|
||||
struct plic_stats {
|
||||
@@ -91,12 +94,12 @@ struct plic_data {
|
||||
static uint32_t save_irq;
|
||||
static const struct device *save_dev;
|
||||
|
||||
INTC_PLIC_STATIC uint32_t local_irq_to_reg_index(uint32_t local_irq)
|
||||
INTC_PLIC_STATIC_INLINE uint32_t local_irq_to_reg_index(uint32_t local_irq)
|
||||
{
|
||||
return local_irq >> LOG2(PLIC_REG_SIZE);
|
||||
}
|
||||
|
||||
INTC_PLIC_STATIC uint32_t local_irq_to_reg_offset(uint32_t local_irq)
|
||||
INTC_PLIC_STATIC_INLINE uint32_t local_irq_to_reg_offset(uint32_t local_irq)
|
||||
{
|
||||
return local_irq_to_reg_index(local_irq) * sizeof(uint32_t);
|
||||
}
|
||||
@@ -108,9 +111,11 @@ static inline uint32_t get_plic_enabled_size(const struct device *dev)
|
||||
return local_irq_to_reg_index(config->num_irqs) + 1;
|
||||
}
|
||||
|
||||
static inline uint32_t get_first_context(uint32_t hartid)
|
||||
static ALWAYS_INLINE uint32_t get_hart_context(const struct device *dev, uint32_t hartid)
|
||||
{
|
||||
return hartid == 0 ? 0 : (hartid * 2) - 1;
|
||||
const struct plic_config *config = dev->config;
|
||||
|
||||
return config->hart_context[hartid];
|
||||
}
|
||||
|
||||
static inline mem_addr_t get_context_en_addr(const struct device *dev, uint32_t cpu_num)
|
||||
@@ -119,17 +124,13 @@ static inline mem_addr_t get_context_en_addr(const struct device *dev, uint32_t
|
||||
uint32_t hartid;
|
||||
/*
|
||||
* We want to return the irq_en address for the context of given hart.
|
||||
* If hartid is 0, we return the devices irq_en property, job done. If it is
|
||||
* greater than zero, we assume that there are two context's associated with
|
||||
* each hart: M mode enable, followed by S mode enable. We return the M mode
|
||||
* enable address.
|
||||
*/
|
||||
#if CONFIG_SMP
|
||||
hartid = _kernel.cpus[cpu_num].arch.hartid;
|
||||
#else
|
||||
hartid = arch_proc_id();
|
||||
#endif
|
||||
return config->irq_en + get_first_context(hartid) * CONTEXT_ENABLE_SIZE;
|
||||
return config->irq_en + get_hart_context(dev, hartid) * CONTEXT_ENABLE_SIZE;
|
||||
}
|
||||
|
||||
static inline mem_addr_t get_claim_complete_addr(const struct device *dev)
|
||||
@@ -138,14 +139,9 @@ static inline mem_addr_t get_claim_complete_addr(const struct device *dev)
|
||||
|
||||
/*
|
||||
* We want to return the claim complete addr for the hart's context.
|
||||
* We are making a few assumptions here:
|
||||
* 1. for hart 0, return the first context claim complete.
|
||||
* 2. for any other hart, we assume they have two privileged mode contexts
|
||||
* which are contiguous, where the m mode context is first.
|
||||
* We return the m mode context.
|
||||
*/
|
||||
|
||||
return config->reg + get_first_context(arch_proc_id()) * CONTEXT_SIZE +
|
||||
return config->reg + get_hart_context(dev, arch_proc_id()) * CONTEXT_SIZE +
|
||||
CONTEXT_CLAIM;
|
||||
}
|
||||
|
||||
@@ -161,7 +157,7 @@ static inline mem_addr_t get_threshold_priority_addr(const struct device *dev, u
|
||||
hartid = arch_proc_id();
|
||||
#endif
|
||||
|
||||
return config->reg + (get_first_context(hartid) * CONTEXT_SIZE);
|
||||
return config->reg + (get_hart_context(dev, hartid) * CONTEXT_SIZE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -556,8 +552,14 @@ SHELL_CMD_ARG_REGISTER(plic, &plic_cmds, "PLIC shell commands",
|
||||
irq_enable(DT_INST_IRQN(n)); \
|
||||
}
|
||||
|
||||
#define HART_CONTEXTS(i, n) IF_ENABLED(IS_EQ(DT_INST_IRQN_BY_IDX(n, i), DT_INST_IRQN(n)), (i,))
|
||||
#define PLIC_HART_CONTEXT_DECLARE(n) \
|
||||
INTC_PLIC_STATIC const uint32_t plic_hart_contexts_##n[DT_CHILD_NUM(DT_PATH(cpus))] = { \
|
||||
LISTIFY(DT_INST_NUM_IRQS(n), HART_CONTEXTS, (), n)}
|
||||
|
||||
#define PLIC_INTC_CONFIG_INIT(n) \
|
||||
PLIC_INTC_IRQ_FUNC_DECLARE(n); \
|
||||
PLIC_HART_CONTEXT_DECLARE(n); \
|
||||
static const struct plic_config plic_config_##n = { \
|
||||
.prio = PLIC_BASE_ADDR(n), \
|
||||
.irq_en = PLIC_BASE_ADDR(n) + CONTEXT_ENABLE_BASE, \
|
||||
@@ -568,6 +570,7 @@ SHELL_CMD_ARG_REGISTER(plic, &plic_cmds, "PLIC shell commands",
|
||||
.num_irqs = DT_INST_PROP(n, riscv_ndev), \
|
||||
.irq_config_func = plic_irq_config_func_##n, \
|
||||
.isr_table = &_sw_isr_table[INTC_INST_ISR_TBL_OFFSET(n)], \
|
||||
.hart_context = plic_hart_contexts_##n, \
|
||||
}; \
|
||||
PLIC_INTC_IRQ_FUNC_DEFINE(n)
|
||||
|
||||
|
||||
@@ -41,17 +41,13 @@ struct nxp_enet_mdio_data {
|
||||
static int nxp_enet_mdio_wait_xfer(const struct device *dev)
|
||||
{
|
||||
struct nxp_enet_mdio_data *data = dev->data;
|
||||
ENET_Type *base = data->base;
|
||||
|
||||
/* This function will not make sense from IRQ context */
|
||||
if (k_is_in_isr()) {
|
||||
return -EWOULDBLOCK;
|
||||
}
|
||||
|
||||
if (data->interrupt_up) {
|
||||
/* Enable the interrupt */
|
||||
base->EIMR |= ENET_EIMR_MII_MASK;
|
||||
} else {
|
||||
if (!data->interrupt_up) {
|
||||
/* If the interrupt is not available to use yet, just busy wait */
|
||||
k_busy_wait(CONFIG_MDIO_NXP_ENET_TIMEOUT);
|
||||
k_sem_give(&data->mdio_sem);
|
||||
@@ -77,7 +73,7 @@ static int nxp_enet_mdio_read(const struct device *dev,
|
||||
* Clear the bit (W1C) that indicates MDIO transfer is ready to
|
||||
* prepare to wait for it to be set once this read is done
|
||||
*/
|
||||
data->base->EIR |= ENET_EIR_MII_MASK;
|
||||
data->base->EIR = ENET_EIR_MII_MASK;
|
||||
|
||||
/*
|
||||
* Write MDIO frame to MII management register which will
|
||||
@@ -105,7 +101,7 @@ static int nxp_enet_mdio_read(const struct device *dev,
|
||||
*read_data = (data->base->MMFR & ENET_MMFR_DATA_MASK) >> ENET_MMFR_DATA_SHIFT;
|
||||
|
||||
/* Clear the same bit as before because the event has been handled */
|
||||
data->base->EIR |= ENET_EIR_MII_MASK;
|
||||
data->base->EIR = ENET_EIR_MII_MASK;
|
||||
|
||||
/* This MDIO interaction is finished */
|
||||
(void)k_mutex_unlock(&data->mdio_mutex);
|
||||
@@ -127,7 +123,7 @@ static int nxp_enet_mdio_write(const struct device *dev,
|
||||
* Clear the bit (W1C) that indicates MDIO transfer is ready to
|
||||
* prepare to wait for it to be set once this write is done
|
||||
*/
|
||||
data->base->EIR |= ENET_EIR_MII_MASK;
|
||||
data->base->EIR = ENET_EIR_MII_MASK;
|
||||
|
||||
/*
|
||||
* Write MDIO frame to MII management register which will
|
||||
@@ -153,7 +149,7 @@ static int nxp_enet_mdio_write(const struct device *dev,
|
||||
}
|
||||
|
||||
/* Clear the same bit as before because the event has been handled */
|
||||
data->base->EIR |= ENET_EIR_MII_MASK;
|
||||
data->base->EIR = ENET_EIR_MII_MASK;
|
||||
|
||||
/* This MDIO interaction is finished */
|
||||
(void)k_mutex_unlock(&data->mdio_mutex);
|
||||
@@ -170,11 +166,9 @@ static void nxp_enet_mdio_isr_cb(const struct device *dev)
|
||||
{
|
||||
struct nxp_enet_mdio_data *data = dev->data;
|
||||
|
||||
/* Signal that operation finished */
|
||||
k_sem_give(&data->mdio_sem);
|
||||
data->base->EIR = ENET_EIR_MII_MASK;
|
||||
|
||||
/* Disable the interrupt */
|
||||
data->base->EIMR &= ~ENET_EIMR_MII_MASK;
|
||||
k_sem_give(&data->mdio_sem);
|
||||
}
|
||||
|
||||
static void nxp_enet_mdio_post_module_reset_init(const struct device *dev)
|
||||
@@ -210,7 +204,9 @@ void nxp_enet_mdio_callback(const struct device *dev,
|
||||
nxp_enet_mdio_isr_cb(dev);
|
||||
break;
|
||||
case NXP_ENET_INTERRUPT_ENABLED:
|
||||
/* IRQ was enabled in NVIC, now enable in enet */
|
||||
data->interrupt_up = true;
|
||||
data->base->EIMR |= ENET_EIMR_MII_MASK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1924,7 +1924,7 @@ MODEM_CHAT_SCRIPT_CMDS_DEFINE(swir_hl7800_init_chat_script_cmds,
|
||||
MODEM_CHAT_SCRIPT_CMD_RESP("", ok_match),
|
||||
MODEM_CHAT_SCRIPT_CMD_RESP("AT+CIMI", cimi_match),
|
||||
MODEM_CHAT_SCRIPT_CMD_RESP("", ok_match),
|
||||
MODEM_CHAT_SCRIPT_CMD_RESP_NONE("AT+CMUX=0,0,5,127", 0));
|
||||
MODEM_CHAT_SCRIPT_CMD_RESP("AT+CMUX=0,0,5,127", ok_match));
|
||||
|
||||
MODEM_CHAT_SCRIPT_DEFINE(swir_hl7800_init_chat_script, swir_hl7800_init_chat_script_cmds,
|
||||
abort_matches, modem_cellular_chat_callback_handler, 10);
|
||||
|
||||
@@ -377,40 +377,6 @@ static int rv3028_update_cfg(const struct device *dev, uint8_t addr, uint8_t mas
|
||||
|
||||
#if RV3028_INT_GPIOS_IN_USE
|
||||
|
||||
static int rv3028_int_enable_unlocked(const struct device *dev, bool enable)
|
||||
{
|
||||
const struct rv3028_config *config = dev->config;
|
||||
uint8_t clkout = 0;
|
||||
int err;
|
||||
|
||||
if (enable || config->cof == RV3028_CLKOUT_FD_LOW) {
|
||||
/* Disable CLKOUT */
|
||||
clkout |= FIELD_PREP(RV3028_CLKOUT_FD, RV3028_CLKOUT_FD_LOW);
|
||||
} else {
|
||||
/* Configure CLKOUT frequency */
|
||||
clkout |= RV3028_CLKOUT_CLKOE |
|
||||
FIELD_PREP(RV3028_CLKOUT_FD, config->cof);
|
||||
}
|
||||
|
||||
/* Configure the CLKOUT register */
|
||||
err = rv3028_update_cfg(dev,
|
||||
RV3028_REG_CLKOUT,
|
||||
RV3028_CLKOUT_FD | RV3028_CLKOUT_CLKOE,
|
||||
clkout);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
err = gpio_pin_interrupt_configure_dt(&config->gpio_int,
|
||||
enable ? GPIO_INT_EDGE_TO_ACTIVE : GPIO_INT_DISABLE);
|
||||
if (err) {
|
||||
LOG_ERR("failed to %s GPIO interrupt (err %d)", enable ? "enable" : "disable", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rv3028_work_cb(struct k_work *work)
|
||||
{
|
||||
struct rv3028_data *data = CONTAINER_OF(work, struct rv3028_data, work);
|
||||
@@ -725,7 +691,6 @@ static int rv3028_alarm_set_callback(const struct device *dev, uint16_t id,
|
||||
#else
|
||||
const struct rv3028_config *config = dev->config;
|
||||
struct rv3028_data *data = dev->data;
|
||||
uint8_t control_2;
|
||||
int err = 0;
|
||||
|
||||
if (config->gpio_int.port == NULL) {
|
||||
@@ -742,26 +707,8 @@ static int rv3028_alarm_set_callback(const struct device *dev, uint16_t id,
|
||||
data->alarm_callback = callback;
|
||||
data->alarm_user_data = user_data;
|
||||
|
||||
err = rv3028_read_reg8(dev, RV3028_REG_CONTROL2, &control_2);
|
||||
if (err) {
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (callback != NULL) {
|
||||
control_2 |= RV3028_CONTROL2_AIE;
|
||||
} else {
|
||||
control_2 &= ~(RV3028_CONTROL2_AIE);
|
||||
}
|
||||
|
||||
if ((control_2 & RV3028_CONTROL2_UIE) == 0U) {
|
||||
/* Only change INT GPIO if periodic time update interrupt not enabled */
|
||||
err = rv3028_int_enable_unlocked(dev, callback != NULL);
|
||||
if (err) {
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
|
||||
err = rv3028_write_reg8(dev, RV3028_REG_CONTROL2, control_2);
|
||||
err = rv3028_update_reg8(dev, RV3028_REG_CONTROL2, RV3028_CONTROL2_AIE,
|
||||
callback != NULL ? RV3028_CONTROL2_AIE : 0);
|
||||
if (err) {
|
||||
goto unlock;
|
||||
}
|
||||
@@ -785,7 +732,6 @@ static int rv3028_update_set_callback(const struct device *dev, rtc_update_callb
|
||||
{
|
||||
const struct rv3028_config *config = dev->config;
|
||||
struct rv3028_data *data = dev->data;
|
||||
uint8_t control_2;
|
||||
int err;
|
||||
|
||||
if (config->gpio_int.port == NULL) {
|
||||
@@ -797,26 +743,8 @@ static int rv3028_update_set_callback(const struct device *dev, rtc_update_callb
|
||||
data->update_callback = callback;
|
||||
data->update_user_data = user_data;
|
||||
|
||||
err = rv3028_read_reg8(dev, RV3028_REG_CONTROL2, &control_2);
|
||||
if (err) {
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (callback != NULL) {
|
||||
control_2 |= RV3028_CONTROL2_UIE;
|
||||
} else {
|
||||
control_2 &= ~(RV3028_CONTROL2_UIE);
|
||||
}
|
||||
|
||||
if ((control_2 & RV3028_CONTROL2_AIE) == 0U) {
|
||||
/* Only change INT GPIO if alarm interrupt not enabled */
|
||||
err = rv3028_int_enable_unlocked(dev, callback != NULL);
|
||||
if (err) {
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
|
||||
err = rv3028_write_reg8(dev, RV3028_REG_CONTROL2, control_2);
|
||||
err = rv3028_update_reg8(dev, RV3028_REG_CONTROL2, RV3028_CONTROL2_UIE,
|
||||
callback != NULL ? RV3028_CONTROL2_UIE : 0);
|
||||
if (err) {
|
||||
goto unlock;
|
||||
}
|
||||
@@ -867,6 +795,12 @@ static int rv3028_init(const struct device *dev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
err = gpio_pin_interrupt_configure_dt(&config->gpio_int, GPIO_INT_EDGE_TO_ACTIVE);
|
||||
if (err) {
|
||||
LOG_ERR("failed to enable GPIO interrupt (err %d)", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
gpio_init_callback(&data->int_callback, rv3028_int_handler,
|
||||
BIT(config->gpio_int.pin));
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ struct usdhc_config {
|
||||
const struct gpio_dt_spec pwr_gpio;
|
||||
const struct gpio_dt_spec detect_gpio;
|
||||
bool detect_dat3;
|
||||
bool detect_cd;
|
||||
bool no_180_vol;
|
||||
uint32_t data_timeout;
|
||||
uint32_t read_watermark;
|
||||
@@ -809,10 +810,18 @@ static int imx_usdhc_get_card_present(const struct device *dev)
|
||||
imx_usdhc_dat3_pull(cfg, true);
|
||||
USDHC_CardDetectByData3(cfg->base, false);
|
||||
}
|
||||
} else if (cfg->detect_cd) {
|
||||
/*
|
||||
* Detect the card via the USDHC_CD signal internal to
|
||||
* the peripheral
|
||||
*/
|
||||
data->card_present = USDHC_DetectCardInsert(cfg->base);
|
||||
} else if (cfg->detect_gpio.port) {
|
||||
data->card_present = gpio_pin_get_dt(&cfg->detect_gpio) > 0;
|
||||
} else {
|
||||
data->card_present = USDHC_DetectCardInsert(cfg->base);
|
||||
LOG_WRN("No card detection method configured, assuming card "
|
||||
"is present");
|
||||
data->card_present = true;
|
||||
}
|
||||
return ((int)data->card_present);
|
||||
}
|
||||
@@ -1090,6 +1099,7 @@ static const struct sdhc_driver_api usdhc_api = {
|
||||
.detect_gpio = GPIO_DT_SPEC_INST_GET_OR(n, cd_gpios, {0}), \
|
||||
.data_timeout = DT_INST_PROP(n, data_timeout), \
|
||||
.detect_dat3 = DT_INST_PROP(n, detect_dat3), \
|
||||
.detect_cd = DT_INST_PROP(n, detect_cd), \
|
||||
.no_180_vol = DT_INST_PROP(n, no_1_8_v), \
|
||||
.read_watermark = DT_INST_PROP(n, read_watermark), \
|
||||
.write_watermark = DT_INST_PROP(n, write_watermark), \
|
||||
|
||||
@@ -136,7 +136,7 @@ static int tsl2591_channel_get(const struct device *dev, enum sensor_channel cha
|
||||
struct sensor_value *val)
|
||||
{
|
||||
const struct tsl2591_data *data = dev->data;
|
||||
int64_t cpl = data->atime * data->again;
|
||||
int64_t cpl = (int64_t)data->atime * (int64_t)data->again;
|
||||
int64_t strength;
|
||||
|
||||
/* Unfortunately, datasheet does not provide a lux conversion formula for this particular
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <zephyr/drivers/i2c.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@@ -82,8 +81,8 @@ static int hts221_sample_fetch(const struct device *dev,
|
||||
return status;
|
||||
}
|
||||
|
||||
data->rh_sample = sys_le16_to_cpu(buf[0] | (buf[1] << 8));
|
||||
data->t_sample = sys_le16_to_cpu(buf[2] | (buf[3] << 8));
|
||||
data->rh_sample = buf[0] | (buf[1] << 8);
|
||||
data->t_sample = buf[2] | (buf[3] << 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -105,12 +104,12 @@ static int hts221_read_conversion_data(const struct device *dev)
|
||||
|
||||
data->h0_rh_x2 = buf[0];
|
||||
data->h1_rh_x2 = buf[1];
|
||||
data->t0_degc_x8 = sys_le16_to_cpu(buf[2] | ((buf[5] & 0x3) << 8));
|
||||
data->t1_degc_x8 = sys_le16_to_cpu(buf[3] | ((buf[5] & 0xC) << 6));
|
||||
data->h0_t0_out = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
|
||||
data->h1_t0_out = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
|
||||
data->t0_out = sys_le16_to_cpu(buf[12] | (buf[13] << 8));
|
||||
data->t1_out = sys_le16_to_cpu(buf[14] | (buf[15] << 8));
|
||||
data->t0_degc_x8 = buf[2] | ((buf[5] & 0x3) << 8);
|
||||
data->t1_degc_x8 = buf[3] | ((buf[5] & 0xC) << 6);
|
||||
data->h0_t0_out = buf[6] | (buf[7] << 8);
|
||||
data->h1_t0_out = buf[10] | (buf[11] << 8);
|
||||
data->t0_out = buf[12] | (buf[13] << 8);
|
||||
data->t1_out = buf[14] | (buf[15] << 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/util_macro.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
@@ -213,9 +212,9 @@ static int iis2dh_sample_fetch(const struct device *dev,
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
iis2dh->acc[0] = sys_le16_to_cpu(buf[0]);
|
||||
iis2dh->acc[1] = sys_le16_to_cpu(buf[1]);
|
||||
iis2dh->acc[2] = sys_le16_to_cpu(buf[2]);
|
||||
iis2dh->acc[0] = buf[0];
|
||||
iis2dh->acc[1] = buf[1];
|
||||
iis2dh->acc[2] = buf[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
|
||||
@@ -244,9 +243,9 @@ static int iis2dlpc_sample_fetch(const struct device *dev,
|
||||
shift = IIS2DLPC_SHIFT_PMOTHER;
|
||||
}
|
||||
|
||||
iis2dlpc->acc[0] = sys_le16_to_cpu(buf[0]) >> shift;
|
||||
iis2dlpc->acc[1] = sys_le16_to_cpu(buf[1]) >> shift;
|
||||
iis2dlpc->acc[2] = sys_le16_to_cpu(buf[2]) >> shift;
|
||||
iis2dlpc->acc[0] = buf[0] >> shift;
|
||||
iis2dlpc->acc[1] = buf[1] >> shift;
|
||||
iis2dlpc->acc[2] = buf[2] >> shift;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@@ -204,8 +203,8 @@ static int iis2iclx_sample_fetch_accel(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->acc[0] = sys_le16_to_cpu(buf[0]);
|
||||
data->acc[1] = sys_le16_to_cpu(buf[1]);
|
||||
data->acc[0] = buf[0];
|
||||
data->acc[1] = buf[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -222,7 +221,7 @@ static int iis2iclx_sample_fetch_temp(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->temp_sample = sys_le16_to_cpu(buf);
|
||||
data->temp_sample = buf;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/i2c.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/kernel.h>
|
||||
@@ -171,8 +170,8 @@ static int hts221_read_conv_data(const struct device *dev,
|
||||
|
||||
ht->y0 = buf[0] / 2;
|
||||
ht->y1 = buf[1] / 2;
|
||||
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
|
||||
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
|
||||
ht->x0 = buf[6] | (buf[7] << 8);
|
||||
ht->x1 = buf[10] | (buf[11] << 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
@@ -63,7 +62,7 @@ static int iis2mdc_set_hard_iron(const struct device *dev,
|
||||
int16_t offset[3];
|
||||
|
||||
for (i = 0U; i < 3; i++) {
|
||||
offset[i] = sys_cpu_to_le16(val->val1);
|
||||
offset[i] = val->val1;
|
||||
val++;
|
||||
}
|
||||
|
||||
@@ -185,9 +184,9 @@ static int iis2mdc_sample_fetch_mag(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
iis2mdc->mag[0] = sys_le16_to_cpu(raw_mag[0]);
|
||||
iis2mdc->mag[1] = sys_le16_to_cpu(raw_mag[1]);
|
||||
iis2mdc->mag[2] = sys_le16_to_cpu(raw_mag[2]);
|
||||
iis2mdc->mag[0] = raw_mag[0];
|
||||
iis2mdc->mag[1] = raw_mag[1];
|
||||
iis2mdc->mag[2] = raw_mag[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -205,7 +204,7 @@ static int iis2mdc_sample_fetch_temp(const struct device *dev)
|
||||
}
|
||||
|
||||
/* formula is temp = 25 + (temp / 8) C */
|
||||
temp = sys_le16_to_cpu(raw_temp);
|
||||
temp = raw_temp;
|
||||
iis2mdc->temp_sample = 2500 + (temp * 100) / 8;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@@ -30,9 +29,9 @@ static int iis3dhhc_sample_fetch(const struct device *dev,
|
||||
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL);
|
||||
|
||||
iis3dhhc_acceleration_raw_get(data->ctx, raw_accel);
|
||||
data->acc[0] = sys_le16_to_cpu(raw_accel[0]);
|
||||
data->acc[1] = sys_le16_to_cpu(raw_accel[1]);
|
||||
data->acc[2] = sys_le16_to_cpu(raw_accel[2]);
|
||||
data->acc[0] = raw_accel[0];
|
||||
data->acc[1] = raw_accel[1];
|
||||
data->acc[2] = raw_accel[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util_macro.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
@@ -309,9 +308,9 @@ static int ism330dhcx_sample_fetch_accel(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->acc[0] = sys_le16_to_cpu(buf[0]);
|
||||
data->acc[1] = sys_le16_to_cpu(buf[1]);
|
||||
data->acc[2] = sys_le16_to_cpu(buf[2]);
|
||||
data->acc[0] = buf[0];
|
||||
data->acc[1] = buf[1];
|
||||
data->acc[2] = buf[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -326,9 +325,9 @@ static int ism330dhcx_sample_fetch_gyro(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->gyro[0] = sys_le16_to_cpu(buf[0]);
|
||||
data->gyro[1] = sys_le16_to_cpu(buf[1]);
|
||||
data->gyro[2] = sys_le16_to_cpu(buf[2]);
|
||||
data->gyro[0] = buf[0];
|
||||
data->gyro[1] = buf[1];
|
||||
data->gyro[2] = buf[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -344,7 +343,7 @@ static int ism330dhcx_sample_fetch_temp(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->temp_sample = sys_le16_to_cpu(buf);
|
||||
data->temp_sample = buf;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/i2c.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/kernel.h>
|
||||
@@ -165,8 +164,8 @@ static int ism330dhcx_hts221_read_conv_data(const struct device *dev, uint8_t i2
|
||||
|
||||
ht->y0 = buf[0] / 2;
|
||||
ht->y1 = buf[1] / 2;
|
||||
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
|
||||
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
|
||||
ht->x0 = buf[6] | (buf[7] << 8);
|
||||
ht->x1 = buf[10] | (buf[11] << 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/dt-bindings/sensor/lis2ds12.h>
|
||||
@@ -175,9 +174,9 @@ static int lis2ds12_sample_fetch_accel(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->sample_x = sys_le16_to_cpu(buf[0]);
|
||||
data->sample_y = sys_le16_to_cpu(buf[1]);
|
||||
data->sample_z = sys_le16_to_cpu(buf[2]);
|
||||
data->sample_x = buf[0];
|
||||
data->sample_y = buf[1];
|
||||
data->sample_z = buf[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util_macro.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
@@ -27,10 +26,12 @@ LOG_MODULE_REGISTER(LIS2DUX12, CONFIG_SENSOR_LOG_LEVEL);
|
||||
|
||||
static int lis2dux12_set_odr(const struct device *dev, uint8_t odr)
|
||||
{
|
||||
struct lis2dux12_data *data = dev->data;
|
||||
const struct lis2dux12_config *cfg = dev->config;
|
||||
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
|
||||
lis2dux12_md_t mode = {.odr = odr};
|
||||
lis2dux12_md_t mode = {.odr = odr, .fs = data->range};
|
||||
|
||||
data->odr = odr;
|
||||
return lis2dux12_mode_set(ctx, &mode);
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ static int lis2dux12_set_range(const struct device *dev, uint8_t range)
|
||||
struct lis2dux12_data *data = dev->data;
|
||||
const struct lis2dux12_config *cfg = dev->config;
|
||||
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
|
||||
lis2dux12_md_t val = { .odr = cfg->odr, .fs = range };
|
||||
lis2dux12_md_t val = { .odr = data->odr, .fs = range };
|
||||
|
||||
err = lis2dux12_mode_set(ctx, &val);
|
||||
|
||||
@@ -66,6 +67,7 @@ static int lis2dux12_set_range(const struct device *dev, uint8_t range)
|
||||
break;
|
||||
}
|
||||
|
||||
data->range = range;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -107,6 +109,39 @@ static int lis2dux12_freq_to_odr_val(const struct device *dev, uint16_t freq)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int lis2dux12_set_fs(const struct device *dev, int16_t fs)
|
||||
{
|
||||
int ret;
|
||||
uint8_t range;
|
||||
|
||||
switch (fs) {
|
||||
case 2:
|
||||
range = LIS2DUX12_DT_FS_2G;
|
||||
break;
|
||||
case 4:
|
||||
range = LIS2DUX12_DT_FS_4G;
|
||||
break;
|
||||
case 8:
|
||||
range = LIS2DUX12_DT_FS_8G;
|
||||
break;
|
||||
case 16:
|
||||
range = LIS2DUX12_DT_FS_16G;
|
||||
break;
|
||||
default:
|
||||
LOG_ERR("fs [%d] not supported.", fs);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = lis2dux12_set_range(dev, range);
|
||||
if (ret < 0) {
|
||||
LOG_ERR("%s: range init error %d", dev->name, range);
|
||||
return ret;
|
||||
}
|
||||
|
||||
LOG_DBG("%s: set fs to %d g", dev->name, fs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int lis2dux12_accel_config(const struct device *dev, enum sensor_channel chan,
|
||||
enum sensor_attribute attr, const struct sensor_value *val)
|
||||
{
|
||||
@@ -114,7 +149,7 @@ static int lis2dux12_accel_config(const struct device *dev, enum sensor_channel
|
||||
|
||||
switch (attr) {
|
||||
case SENSOR_ATTR_FULL_SCALE:
|
||||
return lis2dux12_set_range(dev, sensor_ms2_to_g(val));
|
||||
return lis2dux12_set_fs(dev, sensor_ms2_to_g(val));
|
||||
case SENSOR_ATTR_SAMPLING_FREQUENCY:
|
||||
odr_val = lis2dux12_freq_to_odr_val(dev, val->val1);
|
||||
if (odr_val < 0) {
|
||||
@@ -154,7 +189,7 @@ static int lis2dux12_sample_fetch_accel(const struct device *dev)
|
||||
stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
|
||||
|
||||
/* fetch raw data sample */
|
||||
lis2dux12_md_t mode = {.fs = cfg->range};
|
||||
lis2dux12_md_t mode = {.fs = data->range};
|
||||
lis2dux12_xl_data_t xzy_data = {0};
|
||||
|
||||
if (lis2dux12_xl_data_get(ctx, &mode, &xzy_data) < 0) {
|
||||
@@ -162,9 +197,9 @@ static int lis2dux12_sample_fetch_accel(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->sample_x = sys_le16_to_cpu(xzy_data.raw[0]);
|
||||
data->sample_y = sys_le16_to_cpu(xzy_data.raw[1]);
|
||||
data->sample_z = sys_le16_to_cpu(xzy_data.raw[2]);
|
||||
data->sample_x = xzy_data.raw[0];
|
||||
data->sample_y = xzy_data.raw[1];
|
||||
data->sample_z = xzy_data.raw[2];
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -185,7 +220,7 @@ static int lis2dux12_sample_fetch_temp(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
data->sample_temp = sys_le16_to_cpu(temp_data.heat.raw);
|
||||
data->sample_temp = temp_data.heat.deg_c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -246,7 +281,7 @@ static inline int lis2dux12_get_channel(enum sensor_channel chan, struct sensor_
|
||||
break;
|
||||
#if defined(CONFIG_LIS2DUX12_ENABLE_TEMP)
|
||||
case SENSOR_CHAN_DIE_TEMP:
|
||||
sensor_value_from_double(val, data->sample_temp);
|
||||
sensor_value_from_float(val, data->sample_temp);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
@@ -322,11 +357,7 @@ static int lis2dux12_init(const struct device *dev)
|
||||
|
||||
/* set sensor default pm and odr */
|
||||
LOG_DBG("%s: pm: %d, odr: %d", dev->name, cfg->pm, cfg->odr);
|
||||
lis2dux12_md_t mode = {
|
||||
.odr = cfg->odr,
|
||||
.fs = cfg->range,
|
||||
};
|
||||
ret = lis2dux12_mode_set(ctx, &mode);
|
||||
ret = lis2dux12_set_odr(dev, cfg->odr);
|
||||
if (ret < 0) {
|
||||
LOG_ERR("%s: odr init error (12.5 Hz)", dev->name);
|
||||
return ret;
|
||||
|
||||
@@ -51,9 +51,11 @@ struct lis2dux12_data {
|
||||
int sample_y;
|
||||
int sample_z;
|
||||
float gain;
|
||||
uint8_t range;
|
||||
uint8_t odr;
|
||||
|
||||
#ifdef CONFIG_LIS2DUX12_ENABLE_TEMP
|
||||
int sample_temp;
|
||||
float sample_temp;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LIS2DUX12_TRIGGER
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <zephyr/init.h>
|
||||
#include <stdlib.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
|
||||
@@ -332,9 +331,9 @@ static int lis2dw12_sample_fetch(const struct device *dev,
|
||||
shift = LIS2DW12_SHIFT_PMOTHER;
|
||||
}
|
||||
|
||||
lis2dw12->acc[0] = sys_le16_to_cpu(buf[0]) >> shift;
|
||||
lis2dw12->acc[1] = sys_le16_to_cpu(buf[1]) >> shift;
|
||||
lis2dw12->acc[2] = sys_le16_to_cpu(buf[2]) >> shift;
|
||||
lis2dw12->acc[0] = buf[0] >> shift;
|
||||
lis2dw12->acc[1] = buf[1] >> shift;
|
||||
lis2dw12->acc[2] = buf[2] >> shift;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/drivers/sensor.h>
|
||||
#include <zephyr/pm/device.h>
|
||||
#include <string.h>
|
||||
@@ -74,7 +73,7 @@ static int lis2mdl_set_hard_iron(const struct device *dev,
|
||||
int16_t offset[3];
|
||||
|
||||
for (i = 0U; i < 3; i++) {
|
||||
offset[i] = sys_cpu_to_le16(val->val1);
|
||||
offset[i] = val->val1;
|
||||
val++;
|
||||
}
|
||||
|
||||
@@ -229,9 +228,9 @@ static int lis2mdl_sample_fetch_mag(const struct device *dev)
|
||||
LOG_ERR("Failed to read raw data");
|
||||
return rc;
|
||||
}
|
||||
lis2mdl->mag[0] = sys_le16_to_cpu(raw_mag[0]);
|
||||
lis2mdl->mag[1] = sys_le16_to_cpu(raw_mag[1]);
|
||||
lis2mdl->mag[2] = sys_le16_to_cpu(raw_mag[2]);
|
||||
lis2mdl->mag[0] = raw_mag[0];
|
||||
lis2mdl->mag[1] = raw_mag[1];
|
||||
lis2mdl->mag[2] = raw_mag[2];
|
||||
|
||||
if (cfg->cancel_offset) {
|
||||
/* The second measurement is needed when offset
|
||||
@@ -247,9 +246,9 @@ static int lis2mdl_sample_fetch_mag(const struct device *dev)
|
||||
LOG_ERR("Failed to read raw data");
|
||||
return rc;
|
||||
}
|
||||
lis2mdl->mag[0] += sys_le16_to_cpu(raw_mag[0]);
|
||||
lis2mdl->mag[1] += sys_le16_to_cpu(raw_mag[1]);
|
||||
lis2mdl->mag[2] += sys_le16_to_cpu(raw_mag[2]);
|
||||
lis2mdl->mag[0] += raw_mag[0];
|
||||
lis2mdl->mag[1] += raw_mag[1];
|
||||
lis2mdl->mag[2] += raw_mag[2];
|
||||
lis2mdl->mag[0] /= 2;
|
||||
lis2mdl->mag[1] /= 2;
|
||||
lis2mdl->mag[2] /= 2;
|
||||
@@ -262,9 +261,9 @@ static int lis2mdl_sample_fetch_mag(const struct device *dev)
|
||||
LOG_ERR("Failed to read sample");
|
||||
return rc;
|
||||
}
|
||||
lis2mdl->mag[0] = sys_le16_to_cpu(raw_mag[0]);
|
||||
lis2mdl->mag[1] = sys_le16_to_cpu(raw_mag[1]);
|
||||
lis2mdl->mag[2] = sys_le16_to_cpu(raw_mag[2]);
|
||||
lis2mdl->mag[0] = raw_mag[0];
|
||||
lis2mdl->mag[1] = raw_mag[1];
|
||||
lis2mdl->mag[2] = raw_mag[2];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -282,7 +281,7 @@ static int lis2mdl_sample_fetch_temp(const struct device *dev)
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
lis2mdl->temp_sample = (sys_le16_to_cpu(raw_temp));
|
||||
lis2mdl->temp_sample = raw_temp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@@ -525,12 +524,12 @@ static inline int lsm6dso_magn_get_channel(enum sensor_channel chan,
|
||||
}
|
||||
|
||||
|
||||
sample[0] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8)));
|
||||
sample[1] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][2] |
|
||||
(data->ext_data[idx][3] << 8)));
|
||||
sample[2] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][4] |
|
||||
(data->ext_data[idx][5] << 8)));
|
||||
sample[0] = (int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8));
|
||||
sample[1] = (int16_t)(data->ext_data[idx][2] |
|
||||
(data->ext_data[idx][3] << 8));
|
||||
sample[2] = (int16_t)(data->ext_data[idx][4] |
|
||||
(data->ext_data[idx][5] << 8));
|
||||
|
||||
switch (chan) {
|
||||
case SENSOR_CHAN_MAGN_X:
|
||||
@@ -568,8 +567,8 @@ static inline void lsm6dso_hum_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8)));
|
||||
raw_val = (int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8));
|
||||
|
||||
/* find relative humidty by linear interpolation */
|
||||
rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1;
|
||||
@@ -592,9 +591,9 @@ static inline void lsm6dso_press_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le32_to_cpu((int32_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8) |
|
||||
(data->ext_data[idx][2] << 16)));
|
||||
raw_val = (int32_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8) |
|
||||
(data->ext_data[idx][2] << 16));
|
||||
|
||||
/* Pressure sensitivity is 4096 LSB/hPa */
|
||||
/* Convert raw_val to val in kPa */
|
||||
@@ -615,8 +614,8 @@ static inline void lsm6dso_temp_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][3] |
|
||||
(data->ext_data[idx][4] << 8)));
|
||||
raw_val = (int16_t)(data->ext_data[idx][3] |
|
||||
(data->ext_data[idx][4] << 8));
|
||||
|
||||
/* Temperature sensitivity is 100 LSB/deg C */
|
||||
val->val1 = raw_val / 100;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/i2c.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/kernel.h>
|
||||
@@ -155,8 +154,8 @@ static int lsm6dso_hts221_read_conv_data(const struct device *dev,
|
||||
|
||||
ht->y0 = buf[0] / 2;
|
||||
ht->y1 = buf[1] / 2;
|
||||
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
|
||||
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
|
||||
ht->x0 = buf[6] | (buf[7] << 8);
|
||||
ht->x1 = buf[10] | (buf[11] << 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@@ -556,12 +555,12 @@ static inline int lsm6dso16is_magn_get_channel(enum sensor_channel chan,
|
||||
}
|
||||
|
||||
|
||||
sample[0] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8)));
|
||||
sample[1] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][2] |
|
||||
(data->ext_data[idx][3] << 8)));
|
||||
sample[2] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][4] |
|
||||
(data->ext_data[idx][5] << 8)));
|
||||
sample[0] = (int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8));
|
||||
sample[1] = (int16_t)(data->ext_data[idx][2] |
|
||||
(data->ext_data[idx][3] << 8));
|
||||
sample[2] = (int16_t)(data->ext_data[idx][4] |
|
||||
(data->ext_data[idx][5] << 8));
|
||||
|
||||
switch (chan) {
|
||||
case SENSOR_CHAN_MAGN_X:
|
||||
@@ -599,8 +598,8 @@ static inline void lsm6dso16is_hum_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8)));
|
||||
raw_val = (int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8));
|
||||
|
||||
/* find relative humidty by linear interpolation */
|
||||
rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1;
|
||||
@@ -623,9 +622,9 @@ static inline void lsm6dso16is_press_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le32_to_cpu((int32_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8) |
|
||||
(data->ext_data[idx][2] << 16)));
|
||||
raw_val = (int32_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8) |
|
||||
(data->ext_data[idx][2] << 16));
|
||||
|
||||
/* Pressure sensitivity is 4096 LSB/hPa */
|
||||
/* Convert raw_val to val in kPa */
|
||||
@@ -646,8 +645,8 @@ static inline void lsm6dso16is_temp_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][3] |
|
||||
(data->ext_data[idx][4] << 8)));
|
||||
raw_val = (int16_t)(data->ext_data[idx][3] |
|
||||
(data->ext_data[idx][4] << 8));
|
||||
|
||||
/* Temperature sensitivity is 100 LSB/deg C */
|
||||
val->val1 = raw_val / 100;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/i2c.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/kernel.h>
|
||||
@@ -156,8 +155,8 @@ static int lsm6dso16is_hts221_read_conv_data(const struct device *dev,
|
||||
|
||||
ht->y0 = buf[0] / 2;
|
||||
ht->y1 = buf[1] / 2;
|
||||
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
|
||||
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
|
||||
ht->x0 = buf[6] | (buf[7] << 8);
|
||||
ht->x1 = buf[10] | (buf[11] << 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <string.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/logging/log.h>
|
||||
|
||||
@@ -602,12 +601,12 @@ static inline int lsm6dsv16x_magn_get_channel(enum sensor_channel chan,
|
||||
}
|
||||
|
||||
|
||||
sample[0] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8)));
|
||||
sample[1] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][2] |
|
||||
(data->ext_data[idx][3] << 8)));
|
||||
sample[2] = sys_le16_to_cpu((int16_t)(data->ext_data[idx][4] |
|
||||
(data->ext_data[idx][5] << 8)));
|
||||
sample[0] = (int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8));
|
||||
sample[1] = (int16_t)(data->ext_data[idx][2] |
|
||||
(data->ext_data[idx][3] << 8));
|
||||
sample[2] = (int16_t)(data->ext_data[idx][4] |
|
||||
(data->ext_data[idx][5] << 8));
|
||||
|
||||
switch (chan) {
|
||||
case SENSOR_CHAN_MAGN_X:
|
||||
@@ -645,8 +644,8 @@ static inline void lsm6dsv16x_hum_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8)));
|
||||
raw_val = (int16_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8));
|
||||
|
||||
/* find relative humidty by linear interpolation */
|
||||
rh = (ht->y1 - ht->y0) * raw_val + ht->x1 * ht->y0 - ht->x0 * ht->y1;
|
||||
@@ -669,9 +668,9 @@ static inline void lsm6dsv16x_press_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le32_to_cpu((int32_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8) |
|
||||
(data->ext_data[idx][2] << 16)));
|
||||
raw_val = (int32_t)(data->ext_data[idx][0] |
|
||||
(data->ext_data[idx][1] << 8) |
|
||||
(data->ext_data[idx][2] << 16));
|
||||
|
||||
/* Pressure sensitivity is 4096 LSB/hPa */
|
||||
/* Convert raw_val to val in kPa */
|
||||
@@ -692,8 +691,8 @@ static inline void lsm6dsv16x_temp_convert(struct sensor_value *val,
|
||||
return;
|
||||
}
|
||||
|
||||
raw_val = sys_le16_to_cpu((int16_t)(data->ext_data[idx][3] |
|
||||
(data->ext_data[idx][4] << 8)));
|
||||
raw_val = (int16_t)(data->ext_data[idx][3] |
|
||||
(data->ext_data[idx][4] << 8));
|
||||
|
||||
/* Temperature sensitivity is 100 LSB/deg C */
|
||||
val->val1 = raw_val / 100;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/i2c.h>
|
||||
#include <zephyr/sys/byteorder.h>
|
||||
#include <zephyr/sys/__assert.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/kernel.h>
|
||||
@@ -156,8 +155,8 @@ static int lsm6dsv16x_hts221_read_conv_data(const struct device *dev,
|
||||
|
||||
ht->y0 = buf[0] / 2;
|
||||
ht->y1 = buf[1] / 2;
|
||||
ht->x0 = sys_le16_to_cpu(buf[6] | (buf[7] << 8));
|
||||
ht->x1 = sys_le16_to_cpu(buf[10] | (buf[11] << 8));
|
||||
ht->x0 = buf[6] | (buf[7] << 8);
|
||||
ht->x1 = buf[10] | (buf[11] << 8);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ int icm42688_read_all(const struct device *dev, uint8_t data[14]);
|
||||
static inline void icm42688_accel_g(struct icm42688_cfg *cfg, int32_t in, int32_t *out_g,
|
||||
uint32_t *out_ug)
|
||||
{
|
||||
int32_t sensitivity = 0; /* value equivalent for 1g */
|
||||
int32_t sensitivity;
|
||||
|
||||
switch (cfg->accel_fs) {
|
||||
case ICM42688_DT_ACCEL_FS_2:
|
||||
@@ -432,6 +432,8 @@ static inline void icm42688_accel_g(struct icm42688_cfg *cfg, int32_t in, int32_
|
||||
case ICM42688_DT_ACCEL_FS_16:
|
||||
sensitivity = 2048;
|
||||
break;
|
||||
default:
|
||||
CODE_UNREACHABLE;
|
||||
}
|
||||
|
||||
/* Whole g's */
|
||||
@@ -452,7 +454,7 @@ static inline void icm42688_accel_g(struct icm42688_cfg *cfg, int32_t in, int32_
|
||||
static inline void icm42688_gyro_dps(const struct icm42688_cfg *cfg, int32_t in, int32_t *out_dps,
|
||||
uint32_t *out_udps)
|
||||
{
|
||||
int64_t sensitivity = 0; /* value equivalent for 10x gyro reading deg/s */
|
||||
int64_t sensitivity;
|
||||
|
||||
switch (cfg->gyro_fs) {
|
||||
case ICM42688_DT_GYRO_FS_2000:
|
||||
@@ -479,6 +481,8 @@ static inline void icm42688_gyro_dps(const struct icm42688_cfg *cfg, int32_t in,
|
||||
case ICM42688_DT_GYRO_FS_15_625:
|
||||
sensitivity = 20972;
|
||||
break;
|
||||
default:
|
||||
CODE_UNREACHABLE;
|
||||
}
|
||||
|
||||
int32_t in10 = in * 10;
|
||||
|
||||
@@ -137,6 +137,7 @@ void uart_async_rx_reset(struct uart_async_rx *rx_data)
|
||||
int uart_async_rx_init(struct uart_async_rx *rx_data,
|
||||
const struct uart_async_rx_config *config)
|
||||
{
|
||||
__ASSERT_NO_MSG(config->buf_cnt > 0);
|
||||
__ASSERT_NO_MSG(config->length / config->buf_cnt <= UINT8_MAX);
|
||||
memset(rx_data, 0, sizeof(*rx_data));
|
||||
rx_data->config = config;
|
||||
|
||||
@@ -739,13 +739,14 @@ udc_disable_error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int udc_init(const struct device *dev, udc_event_cb_t event_cb)
|
||||
int udc_init(const struct device *dev,
|
||||
udc_event_cb_t event_cb, const void *const event_ctx)
|
||||
{
|
||||
const struct udc_api *api = dev->api;
|
||||
struct udc_data *data = dev->data;
|
||||
int ret;
|
||||
|
||||
if (event_cb == NULL) {
|
||||
if (event_cb == NULL || event_ctx == NULL) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -757,6 +758,7 @@ int udc_init(const struct device *dev, udc_event_cb_t event_cb)
|
||||
}
|
||||
|
||||
data->event_cb = event_cb;
|
||||
data->event_ctx = event_ctx;
|
||||
|
||||
ret = api->init(dev);
|
||||
if (ret == 0) {
|
||||
|
||||
@@ -31,12 +31,18 @@ LOG_MODULE_REGISTER(udc_stm32, CONFIG_UDC_DRIVER_LOG_LEVEL);
|
||||
|
||||
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_otghs)
|
||||
#define DT_DRV_COMPAT st_stm32_otghs
|
||||
#define UDC_STM32_IRQ_NAME otghs
|
||||
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_otgfs)
|
||||
#define DT_DRV_COMPAT st_stm32_otgfs
|
||||
#define UDC_STM32_IRQ_NAME otgfs
|
||||
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_usb)
|
||||
#define DT_DRV_COMPAT st_stm32_usb
|
||||
#define UDC_STM32_IRQ_NAME usb
|
||||
#endif
|
||||
|
||||
#define UDC_STM32_IRQ DT_INST_IRQ_BY_NAME(0, UDC_STM32_IRQ_NAME, irq)
|
||||
#define UDC_STM32_IRQ_PRI DT_INST_IRQ_BY_NAME(0, UDC_STM32_IRQ_NAME, priority)
|
||||
|
||||
struct udc_stm32_data {
|
||||
PCD_HandleTypeDef pcd;
|
||||
const struct device *dev;
|
||||
@@ -547,7 +553,7 @@ static int udc_stm32_disable(const struct device *dev)
|
||||
struct udc_stm32_data *priv = udc_get_private(dev);
|
||||
HAL_StatusTypeDef status;
|
||||
|
||||
irq_disable(DT_INST_IRQN(0));
|
||||
irq_disable(UDC_STM32_IRQ);
|
||||
|
||||
if (udc_ep_disable_internal(dev, USB_CONTROL_EP_OUT)) {
|
||||
LOG_ERR("Failed to disable control endpoint");
|
||||
@@ -1124,12 +1130,12 @@ static int udc_stm32_driver_init0(const struct device *dev)
|
||||
data->caps.mps0 = UDC_MPS0_64;
|
||||
|
||||
priv->dev = dev;
|
||||
priv->irq = DT_INST_IRQN(0);
|
||||
priv->irq = UDC_STM32_IRQ;
|
||||
priv->clk_enable = priv_clock_enable;
|
||||
priv->clk_disable = priv_clock_disable;
|
||||
priv->pcd_prepare = priv_pcd_prepare;
|
||||
|
||||
IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), udc_stm32_irq,
|
||||
IRQ_CONNECT(UDC_STM32_IRQ, UDC_STM32_IRQ_PRI, udc_stm32_irq,
|
||||
DEVICE_DT_INST_GET(0), 0);
|
||||
|
||||
err = pinctrl_apply_state(usb_pcfg, PINCTRL_STATE_DEFAULT);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/ {
|
||||
soc {
|
||||
sram: sram@400000 {
|
||||
sram: sram@4000000 {
|
||||
ranges = <0x4000000 0x4000000 0x20000000>;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/ {
|
||||
soc {
|
||||
sram: sram@400000 {
|
||||
sram: sram@4000000 {
|
||||
ranges = <0x4000000 0x4000000 0x20000000>;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/ {
|
||||
soc {
|
||||
sram: sram@400000 {
|
||||
sram: sram@4000000 {
|
||||
ranges = <0x4000000 0x4000000 0x20000000>;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/ {
|
||||
soc {
|
||||
sram: sram@400000 {
|
||||
sram: sram@4000000 {
|
||||
ranges = <0x4000000 0x4000000 0x20000000>;
|
||||
};
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
};
|
||||
|
||||
&edma0 {
|
||||
/* Each channel has separate interrupt entry */
|
||||
irq-shared-offset = <0>;
|
||||
dma-channels = <16>;
|
||||
};
|
||||
|
||||
|
||||
@@ -831,13 +831,13 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
usbphy1: usbphy@0x40434000 {
|
||||
usbphy1: usbphy@40434000 {
|
||||
compatible = "nxp,usbphy";
|
||||
reg = <0x40434000 0x1000>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
usbphy2: usbphy@0x40438000 {
|
||||
usbphy2: usbphy@40438000 {
|
||||
compatible = "nxp,usbphy";
|
||||
reg = <0x40438000 0x1000>;
|
||||
status = "disabled";
|
||||
|
||||
@@ -443,7 +443,8 @@
|
||||
#size-cells = <0>;
|
||||
reg = <0x40013000 0x400>;
|
||||
interrupts = <55 5>;
|
||||
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>;
|
||||
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00001000>,
|
||||
<&rcc STM32_SRC_PLL1_Q SPI1_SEL(0)>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -453,7 +454,8 @@
|
||||
#size-cells = <0>;
|
||||
reg = <0x40003800 0x400>;
|
||||
interrupts = <56 5>;
|
||||
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>;
|
||||
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00004000>,
|
||||
<&rcc STM32_SRC_PLL1_Q SPI2_SEL(0)>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -463,7 +465,8 @@
|
||||
#size-cells = <0>;
|
||||
reg = <0x40003c00 0x400>;
|
||||
interrupts = <57 5>;
|
||||
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00008000>;
|
||||
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00008000>,
|
||||
<&rcc STM32_SRC_PLL1_Q SPI3_SEL(0)>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
@@ -66,3 +66,10 @@ properties:
|
||||
Enable the host to detect an SD card via the DAT3 line of the SD card
|
||||
connection. Requires the board to define a function to pull DAT3 low or
|
||||
high using pullup/pulldown resistors.
|
||||
|
||||
detect-cd:
|
||||
type: boolean
|
||||
description: |
|
||||
Use the host's internal card detect signal (USDHC_CD) to detect the SD
|
||||
card. This signal is available as an alternative to card detect via GPIO,
|
||||
and should be connected to the SD slot's detect pin if used.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_GDBSTUB_H_
|
||||
#define ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_GDBSTUB_H_
|
||||
|
||||
#include <zephyr/arch/arm/exc.h>
|
||||
#include <zephyr/arch/arm/exception.h>
|
||||
|
||||
#ifndef _ASMLANGUAGE
|
||||
|
||||
|
||||
@@ -462,6 +462,9 @@ struct bt_l2cap_server {
|
||||
* This callback is called whenever a new incoming connection requires
|
||||
* authorization.
|
||||
*
|
||||
* @warning It is the responsibility of this callback to zero out the
|
||||
* parent of the chan object.
|
||||
*
|
||||
* @param conn The connection that is requesting authorization
|
||||
* @param server Pointer to the server structure this callback relates to
|
||||
* @param chan Pointer to received the allocated channel
|
||||
@@ -516,6 +519,9 @@ int bt_l2cap_br_server_register(struct bt_l2cap_server *server);
|
||||
* each channel connected() callback will be called. If the connection is
|
||||
* rejected disconnected() callback is called instead.
|
||||
*
|
||||
* @warning It is the responsibility of the caller to zero out the
|
||||
* parents of the chan objects.
|
||||
*
|
||||
* @param conn Connection object.
|
||||
* @param chans Array of channel objects.
|
||||
* @param psm Channel PSM to connect to.
|
||||
@@ -551,6 +557,9 @@ int bt_l2cap_ecred_chan_reconfigure(struct bt_l2cap_chan **chans, uint16_t mtu);
|
||||
* the location (address) of bt_l2cap_chan type object which is a member
|
||||
* of both transport dedicated objects.
|
||||
*
|
||||
* @warning It is the responsibility of the caller to zero out the
|
||||
* parent of the chan object.
|
||||
*
|
||||
* @param conn Connection object.
|
||||
* @param chan Channel object.
|
||||
* @param psm Channel PSM to connect to.
|
||||
@@ -600,6 +609,10 @@ int bt_l2cap_chan_disconnect(struct bt_l2cap_chan *chan);
|
||||
* on the stack's global buffer pool (sized
|
||||
* @kconfig{CONFIG_BT_L2CAP_TX_BUF_COUNT}).
|
||||
*
|
||||
* @warning The buffer's user_data _will_ be overwritten by this function. Do
|
||||
* not store anything in it. As soon as a call to this function has been made,
|
||||
* consider ownership of user_data transferred into the stack.
|
||||
*
|
||||
* @note Buffer ownership is transferred to the stack in case of success, in
|
||||
* case of an error the caller retains the ownership of the buffer.
|
||||
*
|
||||
|
||||
@@ -4215,6 +4215,14 @@
|
||||
*/
|
||||
#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
|
||||
|
||||
/**
|
||||
* @brief Get a `DT_DRV_COMPAT`'s number of interrupts
|
||||
*
|
||||
* @param inst instance number
|
||||
* @return number of interrupts
|
||||
*/
|
||||
#define DT_INST_NUM_IRQS(inst) DT_NUM_IRQS(DT_DRV_INST(inst))
|
||||
|
||||
/**
|
||||
* @brief Get a `DT_DRV_COMPAT` interrupt level
|
||||
*
|
||||
|
||||
@@ -277,8 +277,10 @@ struct udc_data {
|
||||
struct udc_device_caps caps;
|
||||
/** Driver access mutex */
|
||||
struct k_mutex mutex;
|
||||
/** Callback to submit an UDC event to upper layer */
|
||||
/** Callback to submit an UDC event to higher layer */
|
||||
udc_event_cb_t event_cb;
|
||||
/** Opaque pointer to store higher layer context */
|
||||
const void *event_ctx;
|
||||
/** USB device controller status */
|
||||
atomic_t status;
|
||||
/** Internal used Control Sequence Stage */
|
||||
@@ -345,14 +347,16 @@ static inline bool udc_is_suspended(const struct device *dev)
|
||||
* After initialization controller driver should be able to detect
|
||||
* power state of the bus and signal power state changes.
|
||||
*
|
||||
* @param[in] dev Pointer to device struct of the driver instance
|
||||
* @param[in] event_cb Event callback from the higher layer (USB device stack)
|
||||
* @param[in] dev Pointer to device struct of the driver instance
|
||||
* @param[in] event_cb Event callback from the higher layer (USB device stack)
|
||||
* @param[in] event_ctx Opaque pointer to higher layer context
|
||||
*
|
||||
* @return 0 on success, all other values should be treated as error.
|
||||
* @retval -EINVAL on parameter error (no callback is passed)
|
||||
* @retval -EALREADY already initialized
|
||||
*/
|
||||
int udc_init(const struct device *dev, udc_event_cb_t event_cb);
|
||||
int udc_init(const struct device *dev,
|
||||
udc_event_cb_t event_cb, const void *const event_ctx);
|
||||
|
||||
/**
|
||||
* @brief Enable USB device controller
|
||||
@@ -702,6 +706,24 @@ static inline struct udc_buf_info *udc_get_buf_info(const struct net_buf *const
|
||||
return (struct udc_buf_info *)net_buf_user_data(buf);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get pointer to higher layer context
|
||||
*
|
||||
* The address of the context is passed as an argument to the udc_init()
|
||||
* function and is stored in the UDC data.
|
||||
*
|
||||
* @param[in] dev Pointer to device struct of the driver instance
|
||||
*
|
||||
* @return Opaque pointer to higher layer context
|
||||
*/
|
||||
static inline const void *udc_get_event_ctx(const struct device *dev)
|
||||
{
|
||||
struct udc_data *data = dev->data;
|
||||
|
||||
return data->event_ctx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -163,8 +163,9 @@ static inline unsigned int irq_to_level_3(unsigned int irq)
|
||||
*/
|
||||
static inline unsigned int irq_parent_level_3(unsigned int irq)
|
||||
{
|
||||
return (irq >> CONFIG_1ST_LEVEL_INTERRUPT_BITS) &
|
||||
BIT_MASK(CONFIG_2ND_LEVEL_INTERRUPT_BITS);
|
||||
return ((irq >> CONFIG_1ST_LEVEL_INTERRUPT_BITS) &
|
||||
BIT_MASK(CONFIG_2ND_LEVEL_INTERRUPT_BITS)) -
|
||||
1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#if !defined(_ASMLANGUAGE)
|
||||
|
||||
#include <zephyr/linker/sections.h>
|
||||
|
||||
#define __noinit __in_section_unique(_NOINIT_SECTION_NAME)
|
||||
#define __noinit_named(name) __in_section_unique_named(_NOINIT_SECTION_NAME, name)
|
||||
#define __irq_vector_table Z_GENERIC_SECTION(_IRQ_VECTOR_TABLE_SECTION_NAME)
|
||||
|
||||
@@ -887,21 +887,22 @@ int coap_get_option_int(const struct coap_packet *cpkt, uint16_t code);
|
||||
* @return Integer value of the block size in case of success
|
||||
* or negative in case of error.
|
||||
*/
|
||||
int coap_get_block1_option(const struct coap_packet *cpkt, bool *has_more, uint8_t *block_number);
|
||||
int coap_get_block1_option(const struct coap_packet *cpkt, bool *has_more, uint32_t *block_number);
|
||||
|
||||
/**
|
||||
* @brief Get values from CoAP block2 option.
|
||||
*
|
||||
* Decode block number and block size from option. Ignore the has_more flag
|
||||
* as it should always be zero on queries.
|
||||
* Decode block number, more flag and block size from option.
|
||||
*
|
||||
* @param cpkt Packet to be inspected
|
||||
* @param has_more Is set to the value of the more flag
|
||||
* @param block_number Is set to the number of the block
|
||||
*
|
||||
* @return Integer value of the block size in case of success
|
||||
* or negative in case of error.
|
||||
*/
|
||||
int coap_get_block2_option(const struct coap_packet *cpkt, uint8_t *block_number);
|
||||
int coap_get_block2_option(const struct coap_packet *cpkt, bool *has_more,
|
||||
uint32_t *block_number);
|
||||
|
||||
/**
|
||||
* @brief Retrieves BLOCK{1,2} and SIZE{1,2} from @a cpkt and updates
|
||||
|
||||
@@ -1401,13 +1401,28 @@ struct net_socket_register {
|
||||
* We have these includes here so that we do not need
|
||||
* to change the applications that were only including
|
||||
* zephyr/net/socket.h header file.
|
||||
*
|
||||
* Additionally, if non-zephyr-prefixed headers are used here,
|
||||
* native_sim pulls in those from the host rather than Zephyr's.
|
||||
*
|
||||
* This should be removed when CONFIG_NET_SOCKETS_POSIX_NAMES is removed.
|
||||
*/
|
||||
#if defined(CONFIG_POSIX_API)
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
#include <poll.h>
|
||||
#include <sys/socket.h>
|
||||
#if !defined(ZEPHYR_INCLUDE_POSIX_ARPA_INET_H_)
|
||||
#include <zephyr/posix/arpa/inet.h>
|
||||
#endif
|
||||
#if !defined(ZEPHYR_INCLUDE_POSIX_NETDB_H_)
|
||||
#include <zephyr/posix/netdb.h>
|
||||
#endif
|
||||
#if !defined(ZEPHYR_INCLUDE_POSIX_UNISTD_H_)
|
||||
#include <zephyr/posix/unistd.h>
|
||||
#endif
|
||||
#if !defined(ZEPHYR_INCLUDE_POSIX_POLL_H_)
|
||||
#include <zephyr/posix/poll.h>
|
||||
#endif
|
||||
#if !defined(ZEPHYR_INCLUDE_POSIX_SYS_SOCKET_H_)
|
||||
#include <zephyr/posix/sys/socket.h>
|
||||
#endif
|
||||
#endif /* CONFIG_POSIX_API */
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_NET_SOCKET_H_ */
|
||||
|
||||
@@ -21,6 +21,48 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(_DEV_T_DECLARED) && !defined(__dev_t_defined)
|
||||
typedef int dev_t;
|
||||
#define _DEV_T_DECLARED
|
||||
#define __dev_t_defined
|
||||
#endif
|
||||
|
||||
#if !defined(_INO_T_DECLARED) && !defined(__ino_t_defined)
|
||||
typedef int ino_t;
|
||||
#define _INO_T_DECLARED
|
||||
#define __ino_t_defined
|
||||
#endif
|
||||
|
||||
#if !defined(_NLINK_T_DECLARED) && !defined(__nlink_t_defined)
|
||||
typedef unsigned short nlink_t;
|
||||
#define _NLINK_T_DECLARED
|
||||
#define __nlink_t_defined
|
||||
#endif
|
||||
|
||||
#if !defined(_UID_T_DECLARED) && !defined(__uid_t_defined)
|
||||
typedef unsigned short uid_t;
|
||||
#define _UID_T_DECLARED
|
||||
#define __uid_t_defined
|
||||
#endif
|
||||
|
||||
#if !defined(_GID_T_DECLARED) && !defined(__gid_t_defined)
|
||||
typedef unsigned short gid_t;
|
||||
#define _GID_T_DECLARED
|
||||
#define __gid_t_defined
|
||||
#endif
|
||||
|
||||
#if !defined(_BLKSIZE_T_DECLARED) && !defined(__blksize_t_defined)
|
||||
typedef unsigned long blksize_t;
|
||||
#define _BLKSIZE_T_DECLARED
|
||||
#define __blksize_t_defined
|
||||
#endif
|
||||
|
||||
#if !defined(_BLKCNT_T_DECLARED) && !defined(__blkcnt_t_defined)
|
||||
typedef unsigned long blkcnt_t;
|
||||
#define _BLKCNT_T_DECLARED
|
||||
#define __blkcnt_t_defined
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_ARCMWDT_LIBC)
|
||||
typedef int pid_t;
|
||||
#endif
|
||||
@@ -45,12 +87,10 @@ struct pthread_attr {
|
||||
uint32_t details[2];
|
||||
};
|
||||
|
||||
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|
||||
|| defined(CONFIG_ARCMWDT_LIBC)
|
||||
#if !defined(CONFIG_NEWLIB_LIBC)
|
||||
typedef struct pthread_attr pthread_attr_t;
|
||||
#endif
|
||||
|
||||
BUILD_ASSERT(sizeof(pthread_attr_t) >= sizeof(struct pthread_attr));
|
||||
#endif
|
||||
|
||||
typedef uint32_t pthread_t;
|
||||
typedef uint32_t pthread_spinlock_t;
|
||||
@@ -65,11 +105,10 @@ struct pthread_mutexattr {
|
||||
unsigned char type: 2;
|
||||
bool initialized: 1;
|
||||
};
|
||||
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|
||||
|| defined(CONFIG_ARCMWDT_LIBC)
|
||||
#if !defined(CONFIG_NEWLIB_LIBC)
|
||||
typedef struct pthread_mutexattr pthread_mutexattr_t;
|
||||
#endif
|
||||
BUILD_ASSERT(sizeof(pthread_mutexattr_t) >= sizeof(struct pthread_mutexattr));
|
||||
#endif
|
||||
|
||||
/* Condition variables */
|
||||
typedef uint32_t pthread_cond_t;
|
||||
@@ -78,11 +117,10 @@ struct pthread_condattr {
|
||||
clockid_t clock;
|
||||
};
|
||||
|
||||
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|
||||
|| defined(CONFIG_ARCMWDT_LIBC)
|
||||
#if !defined(CONFIG_NEWLIB_LIBC)
|
||||
typedef struct pthread_condattr pthread_condattr_t;
|
||||
#endif
|
||||
BUILD_ASSERT(sizeof(pthread_condattr_t) >= sizeof(struct pthread_condattr));
|
||||
#endif
|
||||
|
||||
/* Barrier */
|
||||
typedef uint32_t pthread_barrier_t;
|
||||
@@ -99,14 +137,12 @@ struct pthread_once {
|
||||
bool flag;
|
||||
};
|
||||
|
||||
#if defined(CONFIG_MINIMAL_LIBC) || defined(CONFIG_PICOLIBC) || defined(CONFIG_ARMCLANG_STD_LIBC) \
|
||||
|| defined(CONFIG_ARCMWDT_LIBC)
|
||||
#if !defined(CONFIG_NEWLIB_LIBC)
|
||||
typedef uint32_t pthread_key_t;
|
||||
typedef struct pthread_once pthread_once_t;
|
||||
#endif
|
||||
|
||||
/* Newlib typedefs pthread_once_t as a struct with two ints */
|
||||
BUILD_ASSERT(sizeof(pthread_once_t) >= sizeof(struct pthread_once));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -36,43 +36,8 @@ extern "C" {
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/_timespec.h>
|
||||
|
||||
#ifndef _DEV_T_DECLARED
|
||||
typedef int dev_t;
|
||||
#define _DEV_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef _INO_T_DECLARED
|
||||
typedef int ino_t;
|
||||
#define _INO_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef _NLINK_T_DECLARED
|
||||
typedef unsigned short nlink_t;
|
||||
#define _NLINK_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef _UID_T_DECLARED
|
||||
typedef unsigned short uid_t;
|
||||
#define _UID_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef _GID_T_DECLARED
|
||||
typedef unsigned short gid_t;
|
||||
#define _GID_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef _BLKSIZE_T_DECLARED
|
||||
typedef unsigned long blksize_t;
|
||||
#define _BLKSIZE_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef _BLKCNT_T_DECLARED
|
||||
typedef unsigned long blkcnt_t;
|
||||
#define _BLKCNT_T_DECLARED
|
||||
#endif
|
||||
#include <zephyr/posix/posix_types.h>
|
||||
|
||||
/* dj's stat defines _STAT_H_ */
|
||||
#ifndef _STAT_H_
|
||||
|
||||
@@ -149,7 +149,8 @@ int stream_flash_erase_page(struct stream_flash_ctx *ctx, off_t off);
|
||||
* @param settings_key key to use with the settings module for loading
|
||||
* the stream write progress
|
||||
*
|
||||
* @return non-negative on success, negative errno code on fail
|
||||
* @return non-negative on success, -ERANGE in case when @p off is out
|
||||
* of area designated for stream or negative errno code on fail
|
||||
*/
|
||||
int stream_flash_progress_load(struct stream_flash_ctx *ctx,
|
||||
const char *settings_key);
|
||||
|
||||
@@ -117,7 +117,7 @@ const struct device *z_impl_device_get_by_dt_nodelabel(const char *nodelabel)
|
||||
#ifdef CONFIG_USERSPACE
|
||||
static inline const struct device *z_vrfy_device_get_by_dt_nodelabel(const char *nodelabel)
|
||||
{
|
||||
const char nl_copy[Z_DEVICE_MAX_NODELABEL_LEN];
|
||||
char nl_copy[Z_DEVICE_MAX_NODELABEL_LEN];
|
||||
|
||||
if (k_usermode_string_copy(nl_copy, (char *)nodelabel, sizeof(nl_copy)) != 0) {
|
||||
return NULL;
|
||||
|
||||
@@ -110,8 +110,9 @@ void z_fatal_error(unsigned int reason, const struct arch_esf *esf)
|
||||
}
|
||||
#endif /* CONFIG_ARCH_HAS_NESTED_EXCEPTION_DETECTION */
|
||||
|
||||
LOG_ERR("Current thread: %p (%s)", thread,
|
||||
thread_name_get(thread));
|
||||
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
|
||||
LOG_ERR("Current thread: %p (%s)", thread, thread_name_get(thread));
|
||||
}
|
||||
|
||||
coredump(reason, esf, thread);
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ GEN_OFFSET_SYM(_thread_t, tls);
|
||||
#endif /* CONFIG_THREAD_LOCAL_STORAGE */
|
||||
|
||||
GEN_ABSOLUTE_SYM(__z_interrupt_stack_SIZEOF, sizeof(z_interrupt_stacks[0]));
|
||||
GEN_ABSOLUTE_SYM(__z_interrupt_all_stacks_SIZEOF, sizeof(z_interrupt_stacks));
|
||||
|
||||
/* member offsets in the device structure. Used in image post-processing */
|
||||
#ifdef CONFIG_DEVICE_DEPS
|
||||
|
||||
@@ -378,6 +378,7 @@
|
||||
#if defined(CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT) && \
|
||||
defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||
#define MBEDTLS_PEM_PARSE_C
|
||||
#define MBEDTLS_PEM_WRITE_C
|
||||
#define MBEDTLS_BASE64_C
|
||||
#endif
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ if(CONFIG_PERCEPIO_TRACERECORDER)
|
||||
)
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
|
||||
COMMAND python3 ${TRACERECORDER_DIR}/kernelports/Zephyr/scripts/tz_parse_syscalls.py ${CMAKE_BINARY_DIR} ${ZEPHYR_BASE}
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${TRACERECORDER_DIR}/kernelports/Zephyr/scripts/tz_parse_syscalls.py ${CMAKE_BINARY_DIR} ${ZEPHYR_BASE}
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -432,15 +432,13 @@ static void usb_data_request_cb(const struct device *dev)
|
||||
uint8_t usb_audio_data[USB_STEREO_SAMPLE_SIZE] = {0};
|
||||
static struct net_buf *pcm_buf;
|
||||
static size_t cnt;
|
||||
uint32_t size;
|
||||
int err;
|
||||
|
||||
size = ring_buf_get(&usb_ring_buf, (uint8_t *)usb_audio_data, sizeof(usb_audio_data));
|
||||
if (size == 0) {
|
||||
/* size is 0, noop */
|
||||
return;
|
||||
}
|
||||
/* Size lower than USB_STEREO_SAMPLE_SIZE is OK as usb_audio_data is 0-initialized */
|
||||
ring_buf_get(&usb_ring_buf, (uint8_t *)usb_audio_data, sizeof(usb_audio_data));
|
||||
/* Ignore ring_buf_get() return value, if size is 0 we send empty PCM frames to
|
||||
* not starve USB audio interface, if size is lower than USB_STEREO_SAMPLE_SIZE
|
||||
* we send frames padded with 0's as usb_audio_data is 0-initialized
|
||||
*/
|
||||
|
||||
pcm_buf = net_buf_alloc(&usb_tx_buf_pool, K_NO_WAIT);
|
||||
if (pcm_buf == NULL) {
|
||||
|
||||
@@ -12,7 +12,6 @@ This sample enables all sensors of SensorTile.box Pro board, and then
|
||||
periodically reads and displays data on the console from the following
|
||||
sensors:
|
||||
|
||||
- HTS221: ambient temperature and relative humidity
|
||||
- LPS22DF: ambient temperature and atmospheric pressure
|
||||
- LSM6DSV16X: 6-Axis acceleration and angular velocity
|
||||
- LIS2DU12: 3-Axis acceleration
|
||||
@@ -62,8 +61,6 @@ The sample code outputs sensors data on the SensorTile.box Pro console.
|
||||
|
||||
SensorTile.box Pro dashboard
|
||||
|
||||
HTS221: Temperature: 26.4 C
|
||||
HTS221: Relative Humidity: 60.5%
|
||||
LPS22DF: Temperature: 28.4 C
|
||||
LPS22DF: Pressure:99.694 kpa
|
||||
LSM6DSV16X: Accel (m.s-2): x: -0.158, y: 0.158, z: 9.811
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user