From 7908012b6d0f792bca47896dd987226bd4a51ca7 Mon Sep 17 00:00:00 2001 From: Olof Astrand Date: Sat, 17 Feb 2018 10:15:23 +0100 Subject: [PATCH] Updated with parallel run info --- README.md | 8 +++++++- parallell_run.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 parallell_run.md diff --git a/README.md b/README.md index 236d122..8af98be 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# RAK811 breakout board +ls# RAK811 breakout board Code from here https://github.com/RAKWireless/RAK811_BreakBoard @@ -69,6 +69,12 @@ Read more here [running in qemu](./QEMU.md) http://www.st.com/content/ccc/resource/technical/document/reference_manual/cc/f9/93/b2/f0/82/42/57/CD00240193.pdf/files/CD00240193.pdf/jcr:content/translations/en.CD00240193.pdf +# Building with makefile, +You can checkout the original files and use this makefile to build, +https://raw.githubusercontent.com/oguiter/RAK811_BreakBoard/master/Makefile +I did this and ran the generated elf files in qemu. +Read more amout this experiment here, +Read more here [running in parallell](./parallell_run.md) # Startup code diff --git a/parallell_run.md b/parallell_run.md new file mode 100644 index 0000000..1a38e50 --- /dev/null +++ b/parallell_run.md @@ -0,0 +1,49 @@ +# Parallell run + +Here I compare the software built by platformio compared to the Makefile build which should be more similar to the Original RAK source. + + +clone https://github.com/RAKWireless/RAK811_BreakBoard +cd RAK811_BreakBoard +wget https://raw.githubusercontent.com/oguiter/RAK811_BreakBoard/master/Makefile +make + + +# Start qemu +./qemu-system-arm -S -s -serial file:uart1.log -d unimp -monitor stdio -machine rak811 -cpu cortex-m3 -pflash Debug/classA.bin + + +# Start debugger +arm-none-eabi-gdb Debug/classA.axf -ex ' target remote:1234' + + + + +The biggest difference is that platformio has commented out the call to __libc_init_array, There also _init is called. + + +bl 0x8012874 <_init> + + +Here is the code, + + + + + +0x80123dc <__libc_init_array> push {r4, r5, r6, lr} │ + │0x80123de <__libc_init_array+2> movs r5, #0 │ + │0x80123e0 <__libc_init_array+4> ldr r6, [pc, #48] ; (0x8012414 <__libc_init_array+56>) │ + │0x80123e2 <__libc_init_array+6> ldr r4, [pc, #52] ; (0x8012418 <__libc_init_array+60>) │ + │0x80123e4 <__libc_init_array+8> subs r4, r4, r6 │ + │0x80123e6 <__libc_init_array+10> asrs r4, r4, #2 │ + │0x80123e8 <__libc_init_array+12> cmp r5, r4 │ + │0x80123ea <__libc_init_array+14> bne.n 0x8012400 <__libc_init_array+36> │ + │0x80123ec <__libc_init_array+16> bl 0x8012874 <_init> │ + │0x80123f0 <__libc_init_array+20> movs r5, #0 │ + │0x80123f2 <__libc_init_array+22> ldr r6, [pc, #40] ; (0x801241c <__libc_init_array+64>) │ + │0x80123f4 <__libc_init_array+24> ldr r4, [pc, #40] ; (0x8012420 <__libc_init_array+68>) │ + │0x80123f6 <__libc_init_array+26> subs r4, r4, r6 │ + │0x80123f8 <__libc_init_array+28> asrs r4, r4, #2 │ + │0x80123fa <__libc_init_array+30> cmp r5, r4 +