You are reading a single comment by @ThomasChr and its replies. Click here to read the full conversation.
  • Okay, I've managed to gather all the required files for a build from the Arduino IDE and put them here: https://tclinux.de/due.tar.gz
    Thats 100 MB :-(
    -> Including the GCC Toolchain, which can be omitted.

    A simple Testprogram looks like that:

    [#include](http://forum.espruino.com/sea­rch/?q=%23include) "../include/due_sam3x.init.h"
    
    /**
    * Simply blink the amber LED on the DUE with 2Hz:
    */
    int main(void)
    {
     /* The general init (clock, libc, watchdog ...) */
     init_controller();
    
     /* Board pin 13 == PB27 */
     PIO_Configure(PIOB, PIO_OUTPUT_1, PIO_PB27, PIO_DEFAULT);
    
     /* Main loop */
     while(1) {
       Sleep(250);
       if(PIOB->PIO_ODSR & PIO_PB27) {
         /* Set clear register */
         PIOB->PIO_CODR = PIO_PB27;
       } else {
         /* Set set register */
         PIOB->PIO_SODR = PIO_PB27;
       }
     }
     return 0;
    }
    

    You can compile it with:

    ../tools/g++_arm_none_eabi/bin/arm-none-­eabi-gcc -c -Wall --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fdata-sections -nostdlib -std=c99 -Os -I../include -I../sam -I../sam/libsam -I../sam/CMSIS/CMSIS/Include -I../sam/CMSIS/Device/ATMEL main.c -o main.o
    ../tools/g++_arm_none_eabi/bin/arm-none-­eabi-ar rcs firmware.a main.o
    ../tools/g++_arm_none_eabi/bin/arm-none-­eabi-nm firmware.a > firmware.a.txt
    ../tools/g++_arm_none_eabi/bin/arm-none-­eabi-g++ -Os -Wl,--gc-sections -mcpu=cortex-m3 "-T../sam/linker_scripts/gcc/flash.ld" "-Wl,-Map,./firmware.map" -o firmware.elf "-L" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group firmware.a ../lib/libsam_sam3x8e_gcc_rel.a -Wl,--end-group
    ../tools/g++_arm_none_eabi/bin/arm-none-­eabi-objcopy -O binary firmware.elf firmware.bin
    

    So step 4 is done. Now I'm trying to modify Espruino to compile for the Arduino Due. If anyone wants to help, feel free to do so.
    This might take some time!

    Thomas

    Credits: Arduino IDE
    Tutorial from: http://www.atwillys.de/content/cc/using-­custom-ide-and-system-library-on-arduino­-due-sam3x8e/?lang=en
    -> But the Tutorial is outdated and has some errors. I needed to correct them.

About

Avatar for ThomasChr @ThomasChr started