Adding semihosting support for bmsp

This commit is contained in:
gabriel
2024-04-08 14:36:22 +02:00
parent 39ee91af7d
commit e83f7996bc
14 changed files with 175 additions and 7 deletions

View File

@@ -10,10 +10,15 @@
#include "platform.h"
#include "stub.h"
#include "weak_under_alias.h"
#include "semihosting.h"
ssize_t __wrap_read(int fd, void* ptr, size_t len)
{
uint8_t * current = (uint8_t *)ptr;
#if defined(SEMIHOSTING)
sh_read(current, fd, len);
return;
#endif
#if defined(BOARD_hifive1)
volatile uint32_t * uart_rx = (uint32_t *)(UART0_CTRL_ADDR + UART_REG_RXFIFO);
volatile uint8_t * uart_rx_cnt = (uint8_t *)(UART0_CTRL_ADDR + UART_REG_RXCTRL + 2);