This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bringing Arduino and nRF51 together

Hello,

i'm trying to get running nRF51 on Arduino IDE. I have forked RFduino at the moment github.com/.../RFduino

With SDK i can compile a startup library and an simple arduino sketch like this one in README.md

I get some linker warnings i cannot resolve:

/opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -Wl,--gc-sections --specs=nano.specs -mcpu=cortex-m0 -mthumb -D__nRF51__ -DNRF51 -D__NRF51SDK_STARTUP__ -DBOARD_PCA10000 -T/opt/arduino-1.5.7/hardware/arduino/RFduino/variants/nRF51/linker_scripts/gcc/gcc_nrf51_blank_xxaa.ld -Wl,-Map,/tmp/build2854674180972588472.tmp/rdfblink.cpp.map -Wl,--cref -o /tmp/build2854674180972588472.tmp/rdfblink.cpp.elf -L/tmp/build2854674180972588472.tmp -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group /tmp/build2854674180972588472.tmp/syscalls.c.o /tmp/build2854674180972588472.tmp/rdfblink.cpp.o /tmp/build2854674180972588472.tmp/variant.cpp.o /opt/arduino-1.5.7/hardware/arduino/RFduino/variants/nRF51/libnRF51System.a /tmp/build2854674180972588472.tmp/core.a -Wl,--end-group 
/opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .heap by 4 bytes
/opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .stack_dummy by 4 bytes
/opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .heap by 4 bytes
/opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .stack_dummy by 4 bytes
/opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .heap by 4 bytes
/opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: warning: changing start of section .stack_dummy by 4 bytes

When i flash the compiled code into an PCA10000 board it doesn't start. After my last try my previous blink code was started.

A compiled sketch must be flashed manually at the moment. I hope this code is correct.

 /opt/arduino-1.5.7/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-objcopy -O binary /tmp/build2977480947880635154.tmp/Blink.cpp.elf /tmp/build2977480947880635154.tmp/Blink.cpp.bin
JLinkExe
        r
        loadbin /tmp/build2977480947880635154.tmp/Blink.cpp.bin 00000000
        r
        g
        exit

Resulting files can be found at: github.com/.../2014110901

Parents
  • This is a diff from elf dumps Arduino ELF vs. SDK/GCC Elf: I have compared dumped elf headers with an SDK/gcc compiled file:

    -  Entry point address:               0x40d
    +  Entry point address:               0x219
    -  Start of section headers:          318704 (bytes into file)
    +  Start of section headers:          103020 (bytes into file)
    -  Number of section headers:         22
    -  Section header string table index: 19
    +  Number of section headers:         20
    +  Section header string table index: 17
    
Reply
  • This is a diff from elf dumps Arduino ELF vs. SDK/GCC Elf: I have compared dumped elf headers with an SDK/gcc compiled file:

    -  Entry point address:               0x40d
    +  Entry point address:               0x219
    -  Start of section headers:          318704 (bytes into file)
    +  Start of section headers:          103020 (bytes into file)
    -  Number of section headers:         22
    -  Section header string table index: 19
    +  Number of section headers:         20
    +  Section header string table index: 17
    
Children
No Data
Related