Contiki-NG
Loading...
Searching...
No Matches
flpr-shared.h
1/*
2 * Copyright (c) 2026, RISE Research Institutes of Sweden AB
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef FLPR_SHARED_H_
9#define FLPR_SHARED_H_
10
11/*
12 * Single source of truth for the FLPR <-> M33 shared memory map and status
13 * markers. Included by both the FLPR firmware (TARGET=nrf-vpr) and the M33-side
14 * loader (TARGET=nrf, via -I to this directory).
15 *
16 * NOTE: the linker script (nrf-vpr-sram.ld) hardcodes the same execution base
17 * and partition size; keep the two in sync (a .ld script cannot include this
18 * C header).
19 */
20
21/* FLPR execution memory: start of the 96 KB SRAM block the FLPR owns
22 * (M33-bus view). The M33 copies the blob here and points INITPC at it; for an
23 * SRAM-resident build the entry PC equals this base. */
24#define FLPR_EXEC_BASE 0x20028000UL
25#define FLPR_EXEC_SIZE 0x00018000UL /* 96 KB partition */
26
27/* Shared status words in the FLPR data region: the counter the FLPR advances
28 * and the M33 polls, plus the slot the trap handler stores the faulting PC in. */
29#define FLPR_SHARED_COUNTER_ADDR 0x2003F000UL
30#define FLPR_FAULT_PC_ADDR 0x2003F004UL
31
32/* Status values written to FLPR_SHARED_COUNTER_ADDR. */
33#define FLPR_MARK_BOOT 0xA0000001UL /* _start reached, pre-main() */
34#define FLPR_MARK_EXIT 0xA000FFFFUL /* main() returned (shouldn't) */
35#define FLPR_MARK_FAULT_BASE 0xFA110000UL /* OR'd with mcause on a trap */
36
37#ifndef __ASSEMBLER__
38#include <stdint.h>
39#define FLPR_SHARED_COUNTER (*(volatile uint32_t *)FLPR_SHARED_COUNTER_ADDR)
40#endif
41
42#endif /* FLPR_SHARED_H_ */