NEORV32 - Software Framework Documentation
main.c File Reference

Demo for the the execute in place (XIP) module. More...

#include <neorv32.h>

Macros

User configuration
#define BAUD_RATE   19200
 

Functions

Prototypes
int program_xip_flash (void)
 

Simple program to be stored to the XIP flash.

This is the "blink_led_asm" from the rv32i-version "blink_led" demo program.

const uint32_t xip_program []
 
int main ()
 

Detailed Description

Demo for the the execute in place (XIP) module.

Author
Stephan Nolting

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

UART BAUD rate

Function Documentation

◆ main()

int main ( void  )

Main function: configure the XIP module, program a small program to the attached flash and run that program from there. The program shows an incrementing counter at the lowest 8-bits of the GPIO output port. This demo is meant for a SPI flash/EEPROM with 16-bit addresses.

Note
This program requires the XIP module, UART0 and the GPIO module.
Returns
0 if execution was successful

◆ program_xip_flash()

int program_xip_flash ( void  )

Helper function to program the XIP flash via the direct SPI feature of the XIP module.

Warning
This function can only be used BEFORE the XIP-mode is activated!
Note
This function is blocking.
Returns
Returns 0 if write was successful.

Variable Documentation

◆ xip_program

const uint32_t xip_program[]
Initial value:
= {
0xfc800513,
0x00052023,
0x00000313,
0x0ff37313,
0x00652023,
0x00130313,
0x008000ef,
0xff1ff06f,
0x001003b7,
0xfff38393,
0x00038a63,
0xfff38393,
0x00000013,
0x00000013,
0xff1ff06f,
0x00008067
}

Main function: configure the XIP module, program a small program to the attached flash and run that program from there. The program shows an incrementing counter at the lowest 8-bits of the GPIO output port. This demo is meant for a SPI flash/EEPROM with 16-bit addresses.

Note
This program requires the XIP module, UART0 and the GPIO module.
Returns
0 if execution was successful