![]() |
no-OS
|
RISC-V RV32 (CPU1) side of the dual-core IMU example. More...
#include <stdint.h>#include "no_os_alloc.h"#include "no_os_spi.h"#include "no_os_delay.h"#include "maxim_gpio_spi.h"#include "adis.h"#include "adis1657x.h"#include "maxim_ipc_raw.h"#include "maxim_coprocessor_riscv.h"#include "imu_ipc_shared.h"Macros | |
| #define | IMU_ADIS_RESET_ATTEMPTS 3u |
Functions | |
| void | imu_riscv_fault (void) |
| Report a CPU1 trap to the host and park the core. | |
| void | illegal_insn_handler (void) |
| void | ecall_insn_handler (void) |
| int | main (void) |
| RISC-V entry point (CPU1). Brings up the ADIS via the no-OS driver, then publishes raw samples to the ARM. | |
RISC-V RV32 (CPU1) side of the dual-core IMU example.
Copyright 2026(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| #define IMU_ADIS_RESET_ATTEMPTS 3u |
| void ecall_insn_handler | ( | void | ) |
| void illegal_insn_handler | ( | void | ) |
| void imu_riscv_fault | ( | void | ) |
Report a CPU1 trap to the host and park the core.
RISC-V trap handler. The stock startup's __isr_vector routes synchronous exceptions (entry 1, illegal instruction) and other traps to weak handlers that just spin forever, which would silently wedge this core. We override the trap entry to capture the trap cause and notify the ARM before halting, so a fault is visible instead of an infinite hang.
Implemented as a plain function that reads the RISC-V trap CSRs (mcause/mepc/ mtval), publishes them to the shared table with a magic, rings the ARM doorbell, then parks the core. We do not attempt to return from the trap.
| int main | ( | void | ) |
RISC-V entry point (CPU1). Brings up the ADIS via the no-OS driver, then publishes raw samples to the ARM.