mbv: use new ninja-based build
This commit is contained in:
42
mbv/apps/app.ld
Normal file
42
mbv/apps/app.ld
Normal file
@@ -0,0 +1,42 @@
|
||||
MEMORY
|
||||
{
|
||||
RAM (rwx) : ORIGIN = 0x00000800, LENGTH = 14336
|
||||
}
|
||||
|
||||
_vector_table = 0x0;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
_text_begin = .;
|
||||
KEEP(*(.start))
|
||||
|
||||
*(.text*)
|
||||
_text_end = .;
|
||||
|
||||
*(.rodata*)
|
||||
} > RAM
|
||||
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
_bss_begin = .;
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
_bss_end = .;
|
||||
} > RAM
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data*)
|
||||
|
||||
__exidx_start = .;
|
||||
*(.exidx*)
|
||||
__exidx_end = .;
|
||||
} > RAM
|
||||
|
||||
_heap_begin = .;
|
||||
|
||||
_initial_stack_pointer = 16384;
|
||||
_heap_end = _initial_stack_pointer - 1024;
|
||||
}
|
26
mbv/apps/helloworld/helloworld.cc
Normal file
26
mbv/apps/helloworld/helloworld.cc
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <cstdint>
|
||||
|
||||
struct Gpio {
|
||||
volatile uint32_t data;
|
||||
};
|
||||
|
||||
#define gpio0 ((Gpio*)0x40000000)
|
||||
|
||||
void sleep(int ms) {
|
||||
for (int m = 0; m < ms; m++) {
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
asm volatile ( "" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
int out = 0;
|
||||
|
||||
while (1) {
|
||||
gpio0->data = out;
|
||||
out = (out + 1) % 256;
|
||||
|
||||
sleep(10);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user