amx-mst701/scripts/on_target/main.c
2024-12-18 13:57:56 +01:00

31 lines
532 B
C

#include <inttypes.h>
#define UART0_BASE 0x53FBC000
#define UART0_SR (*((volatile uint32_t *) (UART0_BASE + 0x00)))
#define UART0_DR (*((volatile uint32_t *) (UART0_BASE + 0x40)))
#define UART0_SR_RX_DATA_EMPTY (1 << 0)
#define UART0_SR_TX_FULL (1 << 1)
/*
// Set up stack pointer
asm("_start:\
xor sp, sp, sp;\
lui sp, 0x80100;\
j main;\
");
*/
__attribute__((noreturn)) void _start() {
uint8_t state = 0;
uint8_t c='a';
uint8_t opcode;
uint8_t *ptr;
uint32_t length;
uint32_t sr;
while (1) {
UART0_DR = c++;
}
}