From f87fa4d8d52c60584b9f829e3dd13b2b54476ae5 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 2 Nov 2017 23:04:00 +0100 Subject: [PATCH] =?UTF-8?q?README:=20use=20```diff=20=E2=80=A6```?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c234e1d..10889d5 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,42 @@ 4) Install OpenOCD >= version 0.9, and install gcc-arm-none-eabi 5) git checkout https://bitbucket.org/rebane/rtl8710/src 6) Replace in Makefile "interface/stlink-v2-1.cfg" with "interface/stlink-v2.cfg" +```diff +diff --git Makefile Makefile +index 4581f9a..66a3be5 100644 +--- Makefile ++++ Makefile +@@ -24,8 +24,8 @@ clean: + rm -rf $(FILENAME_PREFIX).bin $(FILENAME_PREFIX).elf + + install: +- openocd -f interface/stlink-v2-1.cfg -f rtl8710.ocd -f cortex/cortex.ocd -c "init" -c "reset halt" -c "load_image $(FILENAME_PREFIX).bin $(ADDRESS) bin" -c "cortex_bootstrap $(ADDRESS)" -c "shutdown" ++ openocd -f interface/stlink-v2.cfg -f rtl8710.ocd -f cortex/cortex.ocd -c "init" -c "reset halt" -c "load_image $(FILENAME_PREFIX).bin $(ADDRESS) bin" -c "cortex_bootstrap $(ADDRESS)" -c "shutdown" + + reset: +- openocd -f interface/stlink-v2-1.cfg -f rtl8710.ocd -c "init" -c "reset halt" -c "reset run" -c "shutdown" ++ openocd -f interface/stlink-v2.cfg -f rtl8710.ocd -c "init" -c "reset halt" -c "reset run" -c "shutdown" +``` 7) Change blinking GPIO to RtlDuino's onboard LED: - main.c: - Replace in references to GPIO_PORTA_* (last 3 occurences): - (((uint32_t)1) << 8) -> (((uint32_t)1) << 6) +```diff +diff --git main.c main.c +index f32c716..b18b811 100644 +--- main.c ++++ main.c +@@ -8,12 +8,12 @@ void delay(uint32_t delay){ + int main(){ + *(volatile uint32_t *)0x4000021C |= (((uint32_t)1) << 8); // REG_SOC_PERI_FUNC1_EN |= BIT_PERI_GPIO_EN; (enable gpio peripheral) + +- *(volatile uint32_t *)0x40001004 |= (((uint32_t)1) << 8); // GPIO_PORTA_DDR |= ...???; (set gpio to output, GC4 on B&T RTL-00) ++ *(volatile uint32_t *)0x40001004 |= (((uint32_t)1) << 6); // GPIO_PORTA_DDR |= ...???; (set gpio to output, GC4 on B&T RTL-00) + + while(1){ +- *(volatile uint32_t *)0x40001000 |= (((uint32_t)1) << 8); // GPIO_PORTA_DR |= ...???; (pin high) ++ *(volatile uint32_t *)0x40001000 |= (((uint32_t)1) << 6); // GPIO_PORTA_DR |= ...???; (pin high) + delay(1000000); +- *(volatile uint32_t *)0x40001000 &= ~(((uint32_t)1) << 8); // GPIO_PORTA_DR &= ~...???; (pin low) ++ *(volatile uint32_t *)0x40001000 &= ~(((uint32_t)1) << 6); // GPIO_PORTA_DR &= ~...???; (pin low) + delay(1000000); + } + } +```