Set development environment with UART debug output for aarch64
This commit is contained in:
+2
-5
@@ -25,13 +25,10 @@ k_main(void)
|
||||
{
|
||||
uart_init();
|
||||
|
||||
uart_putc('L');
|
||||
uart_putc('o');
|
||||
uart_putc('w');
|
||||
uart_putc('e');
|
||||
uart_putc('\n');
|
||||
uart_puts((unsigned char *) "Lowe OS\n");
|
||||
|
||||
for (;;) {
|
||||
__asm__("WFE");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0x40000000;
|
||||
.text : { *(.text) }
|
||||
.data : { *(.data) }
|
||||
.bss : { *(.bss COMMON) }
|
||||
. = ALIGN(8);
|
||||
. = . + 0x1000;
|
||||
stack_ptr = . ;
|
||||
}
|
||||
+12
-4
@@ -15,7 +15,7 @@
|
||||
|
||||
#include "uart.h"
|
||||
|
||||
unsigned int *uart_base = (unsigned int *)UART_BASE;
|
||||
volatile unsigned int *UART0 = (unsigned int *)UART_BASE;
|
||||
|
||||
|
||||
void
|
||||
@@ -24,10 +24,18 @@ uart_init(void)
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
uart_putc(unsigned char c)
|
||||
{
|
||||
*uart_base = c;
|
||||
if(c == '\n')
|
||||
*uart_base = '\r';
|
||||
*UART0 = (unsigned int) c;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
uart_puts(const unsigned char *s)
|
||||
{
|
||||
while(*s) {
|
||||
*UART0 = (unsigned int) *(s++);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,12 @@
|
||||
void
|
||||
uart_init(void);
|
||||
|
||||
|
||||
void
|
||||
uart_putc(unsigned char c);
|
||||
|
||||
|
||||
void
|
||||
uart_puts(const unsigned char *s);
|
||||
|
||||
#endif /* !UART_H */
|
||||
|
||||
Reference in New Issue
Block a user