Permalink
Browse files

Merge pull request #67 from remiparrot/master

Arduino due port
  • Loading branch information...
jlbirccyn committed Nov 30, 2017
2 parents b8a8906 + 047dfd9 commit a8572e525eaab5e9d45260b4f044f8ceae9c1f44
Showing with 23,483 additions and 0 deletions.
  1. +6 −0 examples/cortex/armv7m/atsam3x8e/arduino_due/blink/.gitignore
  2. +36 −0 examples/cortex/armv7m/atsam3x8e/arduino_due/blink/README.md
  3. +23 −0 examples/cortex/armv7m/atsam3x8e/arduino_due/blink/blink.c
  4. +62 −0 examples/cortex/armv7m/atsam3x8e/arduino_due/blink/blink.oil
  5. +3 −0 examples/cortex/armv7m/atsam3x8e/arduino_due/blink/flash_script.jlink
  6. +6 −0 examples/cortex/armv7m/atsam3x8e/blink/.gitignore
  7. +21 −0 examples/cortex/armv7m/atsam3x8e/blink/README.md
  8. +39 −0 examples/cortex/armv7m/atsam3x8e/blink/blink.c
  9. +61 −0 examples/cortex/armv7m/atsam3x8e/blink/blink.oil
  10. +305 −0 goil/templates/code/cortex/armv7m/atsam3x8e/tpl_external_interrupts_c.goilTemplate
  11. +2 −0 goil/templates/code/cortex/armv7m/atsam3x8e/tpl_wrapper.goilTemplate
  12. +62 −0 goil/templates/config/cortex/armv7m/atsam3x8e/arduino_due/config.oil
  13. +390 −0 goil/templates/config/cortex/armv7m/atsam3x8e/config.oil
  14. +59 −0 goil/templates/config/cortex/armv7m/atsam3x8e/interruptSources.oil
  15. +7 −0 goil/templates/linker/gnu_ld/cortex/armv7m/atsam3x8e/memory_map.goilTemplate
  16. +423 −0 goil/templates/linker/gnu_ld/cortex/armv7m/atsam3x8e/script.goilTemplate
  17. +11 −0 goil/templates/linker/gnu_ld/cortex/armv7m/atsam3x8e/script_specific.goilTemplate
  18. +1 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam-headers-version.txt
  19. +443 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam.h
  20. +54 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3.h
  21. +503 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/adc.h
  22. +300 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/can.h
  23. +121 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/chipid.h
  24. +212 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/dacc.h
  25. +368 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/dmac.h
  26. +92 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/efc.h
  27. +337 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/emac.h
  28. +53 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/gpbr.h
  29. +344 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/hsmci.h
  30. +285 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/matrix.h
  31. +98 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/pdc.h
  32. +1,435 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/pio.h
  33. +406 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/pmc.h
  34. +669 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/pwm.h
  35. +80 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/rstc.h
  36. +181 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/rtc.h
  37. +69 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/rtt.h
  38. +198 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/sdramc.h
  39. +490 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/smc.h
  40. +161 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/spi.h
  41. +276 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/ssc.h
  42. +304 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/supc.h
  43. +322 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/tc.h
  44. +72 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/trng.h
  45. +218 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/twi.h
  46. +187 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/uart.h
  47. +949 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/uotghs.h
  48. +413 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/usart.h
  49. +73 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/component/wdt.h
  50. +552 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/pio/sam3x8e.h
  51. +495 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/sam3x8e.h
  52. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/sam3xa.h
  53. +70 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/include/system_sam3xa.h
  54. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3a4c_flash.ld
  55. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3a8c_flash.ld
  56. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3x4c_flash.ld
  57. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3x4e_flash.ld
  58. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3x8c_flash.ld
  59. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3x8e_flash.ld
  60. +51 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3x8h_flash.ld
  61. +139 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/sam3xa_flash.ld
  62. +297 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/as_gcc/startup_sam3xa.c
  63. +239 −0 machines/cortex/armv7m/atsam3x8e/CMSIS/sam3xa/source/system_sam3xa.c
  64. +75 −0 machines/cortex/armv7m/atsam3x8e/arduino/Arduino.h
  65. +197 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CoreHardwareSerial.hpp
  66. +251 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CorePrint.cpp
  67. +85 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CorePrint.hpp
  68. +39 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CorePrintable.hpp
  69. +86 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CoreRingBuffer.cpp
  70. +51 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CoreRingBuffer.hpp
  71. +318 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CoreStream.cpp
  72. +112 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CoreStream.hpp
  73. +747 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CoreString.cpp
  74. +229 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/CoreString.hpp
  75. +76 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/IPAddress.cpp
  76. +70 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/IPAddress.hpp
  77. +37 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_abi.cpp
  78. +167 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_character.h
  79. +232 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_cortex_vectors.c
  80. +86 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_cortex_vectors.h
  81. +60 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_hooks.c
  82. +26 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_hooks.h
  83. +36 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_init.h
  84. +132 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_itoa.c
  85. +34 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_itoa.h
  86. +65 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_main.cpp
  87. +73 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_math.cpp
  88. +38 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_math.hpp
  89. +75 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_shift.c
  90. +42 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_arm/core_shift.h
  91. +46 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/Client.hpp
  92. +30 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/Server.hpp
  93. +88 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/Udp.hpp
  94. +534 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/core_binary.h
  95. +118 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/core_constants.h
  96. +37 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/core_new.cpp
  97. +30 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/core_new.hpp
  98. +34 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/core_reset.h
  99. +58 −0 machines/cortex/armv7m/atsam3x8e/arduino/arch_common/core_watchdog.h
  100. +32 −0 machines/cortex/armv7m/atsam3x8e/arduino/avr_compat/core_dtostrf.c
  101. +30 −0 machines/cortex/armv7m/atsam3x8e/arduino/avr_compat/core_dtostrf.h
  102. +23 −0 machines/cortex/armv7m/atsam3x8e/arduino/avr_compat/core_interrupt.h
  103. +70 −0 machines/cortex/armv7m/atsam3x8e/arduino/avr_compat/core_pgmspace.h
  104. +333 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/CoreSPI.cpp
  105. +181 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/CoreSPI.hpp
  106. +445 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/CoreSerial.cpp
  107. +72 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/CoreSerial.hpp
  108. +706 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/CoreWire.cpp
  109. +141 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/CoreWire.hpp
  110. +414 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_analog.c
  111. +79 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_analog.h
  112. +105 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_delay.c
  113. +107 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_delay.h
  114. +195 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_digital.c
  115. +71 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_digital.h
  116. +67 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_init.c
  117. +287 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_interrupts.c
  118. +36 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_interrupts.h
  119. +84 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_private.c
  120. +86 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_private.h
  121. +68 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_pulse.cpp
  122. +42 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_pulse.hpp
  123. +70 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_reset.c
  124. +89 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_tone.cpp
  125. +31 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_tone.hpp
  126. +204 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_variant.h
  127. +65 −0 machines/cortex/armv7m/atsam3x8e/arduino/port_sam/core_watchdog.c
  128. +491 −0 machines/cortex/armv7m/atsam3x8e/arduino/variant.cpp
  129. +296 −0 machines/cortex/armv7m/atsam3x8e/arduino/variant.h
  130. +140 −0 machines/cortex/armv7m/atsam3x8e/handlers_atsam3x8e.c
  131. +45 −0 machines/cortex/armv7m/atsam3x8e/handlers_atsam3x8e.h
  132. +156 −0 machines/cortex/armv7m/atsam3x8e/startup_sam3x.c
  133. +241 −0 machines/cortex/armv7m/atsam3x8e/system_sam3xa.c
  134. +70 −0 machines/cortex/armv7m/atsam3x8e/system_sam3xa.h
  135. +67 −0 machines/cortex/armv7m/atsam3x8e/tpl_machine_atsam3x8e.c
@@ -0,0 +1,6 @@
blink
build
*_exe.elf
*.bin
*.map
*.py
@@ -0,0 +1,36 @@
# Blink example
This application is a simple periodic example wich toggles the amber led (LED 13 or L) of the board.
Have a look into "blink.oil" file.
The system is based scheduled with a 1ms SysTick "SystemCounter".
Configure the application with
``
goil --target=cortex/armv7m/atsam3x8e/arduino_due --templates=../../../../../../goil/templates/ blink.oil
``
Then make with:
``
./make.py
``
Then flash with:
``
./make.py burn
``
and use the command in JLink prompt:
``
qc
``
Clean project with:
``
./make.py clean
``
The executable can be flashed using JLinkExe.
@@ -0,0 +1,23 @@
#include "tpl_os.h"
#include "Arduino.h"
#define APP_Task_blink_START_SEC_CODE
#include "tpl_memmap.h"
FUNC(int, OS_APPL_CODE) main(void)
{
// Set LED to off
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
StartOS(OSDEFAULTAPPMODE);
return 0;
}
TASK(blink)
{
digitalWrite(LED_BUILTIN, !(digitalRead(LED_BUILTIN)));
TerminateTask();
}
#define APP_Task_blink_STOP_SEC_CODE
#include "tpl_memmap.h"
@@ -0,0 +1,62 @@
OIL_VERSION = "2.5";
IMPLEMENTATION trampoline {
/* This fix the default STACKSIZE of tasks */
TASK {
UINT32 STACKSIZE = 300 ;
} ;
/* This fix the default STACKSIZE of ISRs */
ISR {
UINT32 STACKSIZE = 200 ;
} ;
};
CPU blink {
OS config {
STATUS = EXTENDED;
BUILD = TRUE {
TRAMPOLINE_BASE_PATH = "../../../../../..";
APP_SRC = "blink.c";
APP_NAME = "blink_exe.elf";
CFLAGS = "-O0";
LDFLAGS = "-Map=blink.map";
COMPILER = "arm-none-eabi-gcc";
CPPCOMPILER = "arm-none-eabi-g++";
ASSEMBLER = "arm-none-eabi-as";
LINKER = "arm-none-eabi-ld";
COPIER = "arm-none-eabi-objcopy";
SYSTEM = PYTHON;
};
SYSTEM_CALL = TRUE;
MEMMAP = TRUE {
COMPILER = gcc;
LINKER = gnu_ld { SCRIPT = "script.ld"; };
ASSEMBLER = gnu_as;
MEMORY_PROTECTION = FALSE;
};
};
APPMODE std {};
TASK blink {
PRIORITY = 1;
AUTOSTART = FALSE;
ACTIVATION = 1;
SCHEDULE = FULL;
};
ALARM blink_blink {
COUNTER = SystemCounter;
ACTION = ACTIVATETASK {
TASK = blink;
};
AUTOSTART = TRUE {
APPMODE = std;
ALARMTIME = 100;
CYCLETIME = 100;
};
};
};
@@ -0,0 +1,3 @@
r
h
loadbin blink_exe.elf.bin , 0x00080000
@@ -0,0 +1,6 @@
blink
build
*_exe.elf
*.bin
*.map
*.py
@@ -0,0 +1,21 @@
# Blink example
This application is a simple periodic example wich toggles the two green leds (DS3, DS4) of the board.
Have a look into "blink.oil" file.
The system is based scheduled with a 1ms SysTick "SystemCounter".
Configure the application with
goil --target=cortex/armv7m/atsam3x8e --templates=../../../../../goil/templates/ blink.oil``
``
Then make with:
``
./make.py
``
The executable should be flashed using SoftConsole from Microsemi on Windows.
@@ -0,0 +1,39 @@
#include "tpl_os.h"
//#include "variant.h"
#define APP_Task_blink_START_SEC_CODE
#include "tpl_memmap.h"
FUNC(int, OS_APPL_CODE) main(void)
{
// GPIO->GPIO_1_CFG = 5; //output mode.
// GPIO->GPIO_2_CFG = 5; //output mode.
//initBoard();
// Set LED to off
//pinMode(LED_BUILTIN, OUTPUT);
//digitalWrite(LED_BUILTIN, LOW);
StartOS(OSDEFAULTAPPMODE);
return 0;
}
TASK(blink)
{
// GPIO->GPIO_OUT ^= 0x6; //toggle LED3 and 4.
/*
pinMode(PIN_LED2, INPUT);
if (digitalRead(PIN_LED2) == HIGH)
{
pinMode(PIN_LED2, OUTPUT);
digitalWrite(PIN_LED2, LOW);
}
else
{
pinMode(PIN_LED2, OUTPUT);
digitalWrite(PIN_LED2, HIGH);
}
*/
TerminateTask();
}
#define APP_Task_blink_STOP_SEC_CODE
#include "tpl_memmap.h"
@@ -0,0 +1,61 @@
OIL_VERSION = "2.5";
IMPLEMENTATION trampoline {
/* This fix the default STACKSIZE of tasks */
TASK {
UINT32 STACKSIZE = 300 ;
} ;
/* This fix the default STACKSIZE of ISRs */
ISR {
UINT32 STACKSIZE = 200 ;
} ;
};
CPU blink {
OS config {
STATUS = EXTENDED;
BUILD = TRUE {
TRAMPOLINE_BASE_PATH = "../../../../..";
APP_SRC = "blink.c";
APP_NAME = "blink_exe.elf";
CFLAGS = "-O0";
LDFLAGS = "-Map=blink.map";
COMPILER = "arm-none-eabi-gcc";
ASSEMBLER = "arm-none-eabi-as";
LINKER = "arm-none-eabi-ld";
COPIER = "arm-none-eabi-objcopy";
SYSTEM = PYTHON;
};
SYSTEM_CALL = TRUE;
MEMMAP = TRUE {
COMPILER = gcc;
LINKER = gnu_ld { SCRIPT = "script.ld"; };
ASSEMBLER = gnu_as;
MEMORY_PROTECTION = FALSE;
};
};
APPMODE std {};
TASK blink {
PRIORITY = 1;
AUTOSTART = FALSE;
ACTIVATION = 1;
SCHEDULE = FULL;
};
ALARM blink_blink {
COUNTER = SystemCounter;
ACTION = ACTIVATETASK {
TASK = blink;
};
AUTOSTART = TRUE {
APPMODE = std;
ALARMTIME = 100;
CYCLETIME = 100;
};
};
};
Oops, something went wrong.

0 comments on commit a8572e5

Please sign in to comment.