NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
system.c File Reference

Bare-metal system management. More...

#include <neorv32.h>
#include <config.h>
#include <system.h>
#include <uart.h>

Functions

static void system_trap_handler (void)
 
void system_setup (void)
 
int system_exe_load (int(*dev_init)(void), int(*stream_get)(uint32_t *rdata))
 
int system_exe_store (int(*dev_init)(void), int(*dev_erase)(void), int(*stream_put)(uint32_t wdata))
 
void system_boot_app (void)
 

Variables

uint32_t g_exe_size = 0
 
uint32_t g_flash_addr = 0
 

Detailed Description

Bare-metal system management.

Function Documentation

◆ system_boot_app()

void system_boot_app ( void )

Boot application program.

◆ system_exe_load()

int system_exe_load ( int(* dev_init )(void),
int(* stream_get )(uint32_t *rdata) )

Load executable: get data from device stream and store to main memory.

Parameters
dev_initFunction pointer ("int foo(void)") for device setup.
stream_getFunction pointer ("int bar(uint32_t* rdata)") to get the next consecutive 32-bit word from an application source stream.
Returns
0 if success, non-zero 0 if error.

◆ system_exe_store()

int system_exe_store ( int(* dev_init )(void),
int(* dev_erase )(void),
int(* stream_put )(uint32_t wdata) )

Store executable: copy data from main memory to device stream.

Parameters
dev_initFunction pointer ("int foo(void)") for device setup.
dev_eraseFunction pointer ("int tmp(void)") for device erasure.
stream_putFunction pointer ("int bar(uint32_t wdata)") to put the next consecutive 32-bit word to an application source stream.
Returns
0 if success, non-zero 0 if error.

◆ system_setup()

void system_setup ( void )

Setup processor system.

◆ system_trap_handler()

static void system_trap_handler ( void )
static

Bare-metal trap handler. Used for the CLINT timer tick and to capture any other traps.