NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
Interactive console program to upload and execute a XIP program. More...
#include <neorv32.h>
Macros | |
#define | EXE_SIGNATURE 0x4788CAFE |
User configuration | |
#define | BAUD_RATE 19200 |
#define | FLASH_BASE 0x00400000 |
#define | FLASH_ABYTES 3 |
#define | XIP_CLK_PRSC CLK_PRSC_128 |
#define | BUFFER_SIZE (7*1024) |
Enumerations | |
enum | SPI_FLASH_CMD { SPI_FLASH_CMD_WRITE = 0x02 , SPI_FLASH_CMD_READ = 0x03 , SPI_FLASH_CMD_WRITE_DISABLE = 0x04 , SPI_FLASH_CMD_READ_STATUS = 0x05 , SPI_FLASH_CMD_WRITE_ENABLE = 0x06 , SPI_FLASH_CMD_SECTOR_ERASE = 0xD8 } |
enum | SPI_FLASH_SREG { SPI_FLASH_SREG_WIP = 0 , SPI_FLASH_SREG_WEL = 1 } |
Functions | |
Function prototypes | |
int | xip_flash_access_check (void) |
void | xip_flash_erase_sector (uint32_t base_addr) |
void | xip_flash_program (uint32_t *src, uint32_t base_addr, uint32_t size) |
int | uart_get_executable (uint32_t *dst, uint32_t *size) |
uint32_t | uart_get_word (void) |
RAM storage for executable | |
uint32_t | ram_buffer [BUFFER_SIZE/4] |
int | main () |
Interactive console program to upload and execute a XIP program.
#define BAUD_RATE 19200 |
UART BAUD rate
#define BUFFER_SIZE (7*1024) |
Executable RAM buffer size in bytes
#define EXE_SIGNATURE 0x4788CAFE |
Valid executable identification signature
#define FLASH_ABYTES 3 |
Flash address bytes
#define FLASH_BASE 0x00400000 |
Flash base address (32-bit)
#define XIP_CLK_PRSC CLK_PRSC_128 |
XIP SPI clock prescaler select
enum SPI_FLASH_CMD |
enum SPI_FLASH_SREG |
int main | ( | void | ) |
Main function
int uart_get_executable | ( | uint32_t * | dst, |
uint32_t * | length ) |
Get NEORV32 executable via UART.
[in] | dst | Pointer to uin32_t data array where the executable will be stored. |
[out] | length | Pointer to a uin32_t to store the executable size in bytes. |
uint32_t uart_get_word | ( | void | ) |
Get 32-bit word from UART.
int xip_flash_access_check | ( | void | ) |
Check SPI flash connection by toggling the status register's write enable latch.
void xip_flash_erase_sector | ( | uint32_t | base_addr | ) |
Erase sector starting at base address.
[in] | base_addr | Base address of sector to erase. |
void xip_flash_program | ( | uint32_t * | src, |
uint32_t | base_addr, | ||
uint32_t | size ) |
Helper function to program the XIP flash via the direct SPI access feature of the XIP module.
[in] | src | Pointer to data that will be copied to flash (32-bit). |
[in] | base_addr | Image base address (in flash). |
[in] | size | Image size in bytes. |
uint32_t ram_buffer[BUFFER_SIZE/4] |
Main function