mirror of https://git.eddie.sh/onyx/onyx.git
working flash
This commit is contained in:
parent
37a3ffb1bf
commit
2b88bcf6f5
|
@ -0,0 +1,6 @@
|
||||||
|
.PHONY: build
|
||||||
|
|
||||||
|
build:
|
||||||
|
cargo build --release
|
||||||
|
arm-none-eabi-objcopy -O binary target/thumbv6m-none-eabi/release/onyx.elf target/onyx.bin
|
||||||
|
bossac -ewvRo 0x2000 target/onyx.bin
|
3
flash
3
flash
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cargo build --release && sudo bossac -p /dev/ttyACM0 -e -w -v -R --offset 0x2000 target/thumbv6m-none-eabi/release/onyx
|
|
4
memory.x
4
memory.x
|
@ -1,7 +1,7 @@
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K
|
FLASH : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K
|
||||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K
|
RAM : ORIGIN = 0x20000000, LENGTH = 32K
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is where the call stack will be allocated. */
|
/* This is where the call stack will be allocated. */
|
||||||
|
|
|
@ -26,13 +26,11 @@ fn main() -> ! {
|
||||||
&mut peripherals.NVMCTRL,
|
&mut peripherals.NVMCTRL,
|
||||||
);
|
);
|
||||||
let mut pins = hal::Pins::new(peripherals.PORT);
|
let mut pins = hal::Pins::new(peripherals.PORT);
|
||||||
let mut red_led = pins.d13.into_open_drain_output(&mut pins.port);
|
let mut red_led = pins.d13.into_push_pull_output(&mut pins.port);
|
||||||
|
|
||||||
let mut delay = Delay::new(core.SYST, &mut clocks);
|
let mut delay = Delay::new(core.SYST, &mut clocks);
|
||||||
loop {
|
loop {
|
||||||
delay.delay_ms(200u8);
|
delay.delay_ms(1000u16);
|
||||||
red_led.set_high().unwrap();
|
red_led.toggle();
|
||||||
delay.delay_ms(200u8);
|
|
||||||
red_led.set_low().unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue