Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Coenen <manuel@duet3d.com>2021-01-26 11:59:39 +0300
committerManuel Coenen <manuel@duet3d.com>2021-01-26 11:59:39 +0300
commitf8bc851baed276ab2ea2e8b91bc2dfe99653d8cb (patch)
tree077ea93a163bbb13fe5ed34e43b325f85063d8e4
parentcfb3fca8b8cf43d74bbf186625d63ae637af7bd5 (diff)
Fix Duet2_SBC configuration
Add SAM4S hardware directory (just a copy of SAM4E for now) Move contents of AppUrgentInit() into AppInit()
-rw-r--r--.cproject83
-rw-r--r--src/DuetNG/Pins_DuetNG.h1
-rw-r--r--src/Hardware/SAM4E/Main.cpp10
-rw-r--r--src/Hardware/SAM4E/PinDescription.h2
-rw-r--r--src/Hardware/SAM4S/Devices.cpp74
-rw-r--r--src/Hardware/SAM4S/Devices.h29
-rw-r--r--src/Hardware/SAM4S/Main.cpp26
-rw-r--r--src/Hardware/SAM4S/PinDescription.h49
-rw-r--r--src/Linux/DataTransfer.cpp8
-rw-r--r--src/Platform.cpp34
10 files changed, 239 insertions, 77 deletions
diff --git a/.cproject b/.cproject
index e36353ae..1e0da1d7 100644
--- a/.cproject
+++ b/.cproject
@@ -122,7 +122,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry excluding="src/Duet3Mini|src/Linux|src/Hardware/SAME70|src/Hardware/SAME5x|src/Networking/LwipEthernet|src/Duet3_V06|src/Hardware/ksz8081rna|src/Pccb|src/DuetM" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="src/Duet3Mini|src/Linux|src/Hardware/SAME70|src/Hardware/SAME5x|src/Networking/LwipEthernet|src/Duet3_V06|src/Hardware/ksz8081rna|src/Pccb|src/DuetM|src/Hardware/SAM4S" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@@ -565,7 +565,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry excluding="src/Hardware/SAM4E|src/Duet3Mini|/src/Networking/LwipEthernet/Lwip/test|src/DuetNG|src/Networking/W5500Ethernet|src/Display|src/Pccb|/src/Networking/LwipEthernet/Lwip/src/apps/mqtt|src/Networking/LwipEthernet/Lwip/doc|src/Networking/LwipEthernet/Lwip/src/apps/smtp|src/Networking/LwipEthernet/Lwip/src/apps/snmp|src/Networking/LwipEthernet/Lwip/src/apps/httpd|src/Hardware/SAME5x|src/Networking/LwipEthernet/Lwip/src/apps/tftp|src/Networking/LwipEthernet/Lwip/src/netif/ppp|src/Networking/LwipEthernet/Lwip/src/apps/lwiperf|src/Networking/LwipEthernet/Lwip/src/apps/altcp_tls|src/Networking/LwipEthernet/Lwip/src/apps/sntp|src/Networking/LwipEthernet/Lwip/src/apps/http|src/Networking/ESP8266WiFi|src/DuetM" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="src/Hardware/SAM4E|src/Duet3Mini|/src/Networking/LwipEthernet/Lwip/test|src/DuetNG|src/Networking/W5500Ethernet|src/Display|src/Pccb|/src/Networking/LwipEthernet/Lwip/src/apps/mqtt|src/Networking/LwipEthernet/Lwip/doc|src/Networking/LwipEthernet/Lwip/src/apps/smtp|src/Networking/LwipEthernet/Lwip/src/apps/snmp|src/Networking/LwipEthernet/Lwip/src/apps/httpd|src/Hardware/SAME5x|src/Networking/LwipEthernet/Lwip/src/apps/tftp|src/Networking/LwipEthernet/Lwip/src/netif/ppp|src/Networking/LwipEthernet/Lwip/src/apps/lwiperf|src/Networking/LwipEthernet/Lwip/src/apps/altcp_tls|src/Networking/LwipEthernet/Lwip/src/apps/sntp|src/Networking/LwipEthernet/Lwip/src/apps/http|src/Networking/ESP8266WiFi|src/DuetM|src/Hardware/SAM4S" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@@ -786,7 +786,10 @@
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.509820949" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/RepRapFirmware}/Duet2_RTOS" id="cdt.managedbuild.builder.gnu.cross.1472489771" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.1251056819" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
- <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="gnu.both.asm.option.include.paths.748950315" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false" valueType="includePath"/>
+ <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.748950315" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src}&quot;"/>
+ </option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1778931460" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}" id="cdt.managedbuild.tool.gnu.cross.c.compiler.364237023" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
@@ -795,17 +798,17 @@
<option id="gnu.c.compiler.option.misc.verbose.2100533250" name="Verbose (-v)" superClass="gnu.c.compiler.option.misc.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.c.compiler.option.misc.other.51237387" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -nostdlib -Wundef -Wdouble-promotion -Werror=return-type -Werror=implicit -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot;" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.259472338" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/cores/arduino}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/common/utils}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/common/services/ioport}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/drivers}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils/cmsis/sam4e/include}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils/header_files}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils/preprocessor}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/thirdparty/CMSIS/Include}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/variants/duetNG}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/SAM4E}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/common/utils}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/drivers}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/preprocessor}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/header_files}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/cmsis/sam4e/include}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/arm/CMSIS/5.4.0/CMSIS/Core/Include}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.preprocessor.def.symbols.1590962224" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__SAM4E8E__"/>
@@ -823,14 +826,14 @@
<tool command="gcc" commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${LinkFlags1} ${INPUTS} ${LinkFlags2}" id="cdt.managedbuild.tool.gnu.cross.cpp.linker.190661941" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker">
<option id="gnu.cpp.link.option.nostdlibs.954144272" name="No startup or default libs (-nostdlib)" superClass="gnu.cpp.link.option.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.paths.1936491033" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/FreeRTOS/SAM4E}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreNG/SAM4E8E}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/SAM4E_SDHC_USB_RTOS}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/RRFLibraries/SAM4E_RTOS}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/FreeRTOS/SAM4E}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.libs.407110505" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs">
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="CoreN2G"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="RRFLibraries"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="FreeRTOS"/>
- <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="CoreNG"/>
<listOptionValue builtIn="false" value="supc++"/>
</option>
<option id="gnu.cpp.link.option.flags.55786831" name="Linker flags" superClass="gnu.cpp.link.option.flags" useByScannerDiscovery="false" value="--specs=nosys.specs -Os -Wl,--gc-sections -Wl,--fatal-warnings -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -T&quot;${workspace_loc:/${CoreName}/variants/duetNG/linker_scripts/gcc/flash.ld}&quot; -Wl,-Map,&quot;${workspace_loc:/${ProjName}/${ConfigName}}/${BuildArtifactFileBaseName}.map&quot;" valueType="string"/>
@@ -845,21 +848,20 @@
<option id="gnu.cpp.compiler.option.other.verbose.516508660" name="Verbose (-v)" superClass="gnu.cpp.compiler.option.other.verbose" useByScannerDiscovery="false" value="false" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.other.other.2058032643" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" useByScannerDiscovery="false" value="-c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fexceptions -nostdlib -Wundef -Wdouble-promotion -Werror=return-type -fsingle-precision-constant &quot;-Wa,-ahl=$*.s&quot; -fstack-usage" valueType="string"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.2008633041" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/cores/arduino}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/libraries/Flash}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/libraries/Wire}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/common/utils}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/common/services/clock}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/common/services/ioport}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/drivers}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils/cmsis/sam4e/include}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils/header_files}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/sam/utils/preprocessor}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/asf/thirdparty/CMSIS/Include}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${CoreName}/variants/duetNG}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/SAM4E}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/common/utils}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/arm/CMSIS/5.4.0/CMSIS/Core/Include}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/cmsis/sam4e/include}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/preprocessor}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/utils/header_files}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/CoreN2G/src/SAM4S_4E_E70/asf/sam/drivers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/Hardware/SAM4E}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/DuetNG}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src/Networking}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/DuetWiFiSocketServer/src/include}&quot;"/>
@@ -881,17 +883,11 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry excluding="src/Duet3Mini|src/Hardware/SAME70|src/Hardware/SAME5x|src/Networking/LwipEthernet|src/Networking/W5500Ethernet/|src/Duet3_V06|src/Hardware/ksz8081rna|src/Networking/ESP8266WiFi/|src/Pccb|src/DuetM" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="src/Duet3Mini|src/Hardware/SAME70|src/Hardware/SAME5x|src/Networking/LwipEthernet|src/Networking/W5500Ethernet/|src/Duet3_V06|src/Hardware/ksz8081rna|src/Networking/ESP8266WiFi/|src/Pccb|src/DuetM|src/Hardware/SAM4S" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings">
- <externalSettings containerId="CoreNG;cdt.managedbuild.config.gnu.cross.lib.release.897729483.161018050" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
- <externalSetting>
- <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CoreNG/SAM4E8E"/>
- <entry flags="RESOLVED" kind="libraryFile" name="CoreNG" srcPrefixMapping="" srcRootPath=""/>
- </externalSetting>
- </externalSettings>
<externalSettings containerId="FreeRTOS;cdt.managedbuild.config.gnu.cross.exe.release.487753828" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/FreeRTOS/SAM4E"/>
@@ -904,6 +900,13 @@
<entry flags="RESOLVED" kind="libraryFile" name="RRFLibraries" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
+ <externalSettings containerId="CoreN2G;cdt.managedbuild.config.gnu.cross.lib.release.675522878.1031364120.863690523.1238055174" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier">
+ <externalSetting>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CoreN2G"/>
+ <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CoreN2G/SAM4E_SDHC_USB_RTOS"/>
+ <entry flags="RESOLVED" kind="libraryFile" name="CoreN2G" srcPrefixMapping="" srcRootPath=""/>
+ </externalSetting>
+ </externalSettings>
</storageModule>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.release.516195201.976458850.241502451.170574622.649587786.957471317.554098917">
@@ -1319,7 +1322,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry excluding="src/Hardware/SAM4E|src/Networking/LwipEthernet/Lwip/src/apps/snmp|src/Networking/LwipEthernet/Lwip/src/apps/smtp|src/Hardware/SAME70|src/DuetNG|src/Networking/LwipEthernet/Lwip/src/apps/tftp|src/Networking/W5500Ethernet|src/Networking/LwipEthernet/Lwip/src/netif/ppp|src/Networking/LwipEthernet/Lwip/src/apps/lwiperf|src/Networking/LwipEthernet/Lwip/src/apps/altcp_tls|src/Networking/LwipEthernet/Lwip/src/apps/sntp|src/Networking/LwipEthernet/Lwip/src/apps/http|src/Duet3_V06|src/Pccb|src/Networking/LwipEthernet/Lwip/src/apps/mqtt|src/DuetM|src/Networking/LwipEthernet/Lwip/doc" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="src/Hardware/SAM4E|src/Networking/LwipEthernet/Lwip/src/apps/snmp|src/Networking/LwipEthernet/Lwip/src/apps/smtp|src/Hardware/SAME70|src/DuetNG|src/Networking/LwipEthernet/Lwip/src/apps/tftp|src/Networking/W5500Ethernet|src/Networking/LwipEthernet/Lwip/src/netif/ppp|src/Networking/LwipEthernet/Lwip/src/apps/lwiperf|src/Networking/LwipEthernet/Lwip/src/apps/altcp_tls|src/Networking/LwipEthernet/Lwip/src/apps/sntp|src/Networking/LwipEthernet/Lwip/src/apps/http|src/Duet3_V06|src/Pccb|src/Networking/LwipEthernet/Lwip/src/apps/mqtt|src/DuetM|src/Networking/LwipEthernet/Lwip/doc|src/Hardware/SAM4S" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
@@ -1973,7 +1976,7 @@
</toolChain>
</folderInfo>
<sourceEntries>
- <entry excluding="src/Hardware/SAM4E|src/Duet3Mini|/src/Networking/LwipEthernet/Lwip/test|src/DuetNG|src/Networking/W5500Ethernet|src/Display|src/Pccb|/src/Networking/LwipEthernet/Lwip/src/apps/mqtt|src/Networking/LwipEthernet/Lwip/doc|src/Networking/LwipEthernet/Lwip/src/apps/smtp|src/Networking/LwipEthernet/Lwip/src/apps/snmp|src/Networking/LwipEthernet/Lwip/src/apps/httpd|src/Hardware/SAME5x|src/Networking/LwipEthernet/Lwip/src/apps/tftp|src/Networking/LwipEthernet/Lwip/src/netif/ppp|src/Networking/LwipEthernet/Lwip/src/apps/lwiperf|src/Networking/LwipEthernet/Lwip/src/apps/altcp_tls|src/Networking/LwipEthernet/Lwip/src/apps/sntp|src/Networking/LwipEthernet/Lwip/src/apps/http|src/Networking/ESP8266WiFi|src/DuetM" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+ <entry excluding="src/Hardware/SAM4E|src/Duet3Mini|/src/Networking/LwipEthernet/Lwip/test|src/DuetNG|src/Networking/W5500Ethernet|src/Display|src/Pccb|/src/Networking/LwipEthernet/Lwip/src/apps/mqtt|src/Networking/LwipEthernet/Lwip/doc|src/Networking/LwipEthernet/Lwip/src/apps/smtp|src/Networking/LwipEthernet/Lwip/src/apps/snmp|src/Networking/LwipEthernet/Lwip/src/apps/httpd|src/Hardware/SAME5x|src/Networking/LwipEthernet/Lwip/src/apps/tftp|src/Networking/LwipEthernet/Lwip/src/netif/ppp|src/Networking/LwipEthernet/Lwip/src/apps/lwiperf|src/Networking/LwipEthernet/Lwip/src/apps/altcp_tls|src/Networking/LwipEthernet/Lwip/src/apps/sntp|src/Networking/LwipEthernet/Lwip/src/apps/http|src/Networking/ESP8266WiFi|src/DuetM|src/Hardware/SAM4S" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
diff --git a/src/DuetNG/Pins_DuetNG.h b/src/DuetNG/Pins_DuetNG.h
index 464c14dd..78e10e09 100644
--- a/src/DuetNG/Pins_DuetNG.h
+++ b/src/DuetNG/Pins_DuetNG.h
@@ -552,6 +552,7 @@ constexpr Pin APIN_SBC_SPI_MOSI = SPI_MOSI;
constexpr Pin APIN_SBC_SPI_MISO = SPI_MISO;
constexpr Pin APIN_SBC_SPI_SCK = SPI_SCK;
constexpr Pin APIN_SBC_SPI_SS0 = SPI_SS0;
+constexpr GpioPinFunction SBCPinPeriphMode = SPIPeriphMode;
constexpr Pin SbcTfrReadyPin = PortDPin(31);
diff --git a/src/Hardware/SAM4E/Main.cpp b/src/Hardware/SAM4E/Main.cpp
index 4d26da64..355443b4 100644
--- a/src/Hardware/SAM4E/Main.cpp
+++ b/src/Hardware/SAM4E/Main.cpp
@@ -7,10 +7,20 @@
*/
#include <CoreIO.h>
+#include <RepRapFirmware.h>
// Program initialisation
void AppInit() noexcept
{
+ // When the reset button is pressed on pre-production Duet WiFi boards, if the TMC2660 drivers were previously enabled then we get
+ // uncommanded motor movements if the STEP lines pick up any noise. Try to reduce that by initialising the pins that control the drivers early here.
+ // On the production boards the ENN line is pulled high by an external pullup resistor and that prevents motor movements.
+ for (size_t drive = 0; drive < MaxSmartDrivers; ++drive)
+ {
+ pinMode(STEP_PINS[drive], OUTPUT_LOW);
+ pinMode(DIRECTION_PINS[drive], OUTPUT_LOW);
+ pinMode(ENABLE_PINS[drive], OUTPUT_HIGH);
+ }
}
// End
diff --git a/src/Hardware/SAM4E/PinDescription.h b/src/Hardware/SAM4E/PinDescription.h
index c39b56ef..d08e16de 100644
--- a/src/Hardware/SAM4E/PinDescription.h
+++ b/src/Hardware/SAM4E/PinDescription.h
@@ -46,4 +46,4 @@ struct PinDescription : public PinDescriptionBase
const char* GetNames() const noexcept { return pinNames; }
};
-#endif /* SRC_HARDWARE_SAME70_PINDESCRIPTION_H_ */
+#endif /* SRC_HARDWARE_SAM4E_PINDESCRIPTION_H_ */
diff --git a/src/Hardware/SAM4S/Devices.cpp b/src/Hardware/SAM4S/Devices.cpp
new file mode 100644
index 00000000..11d01398
--- /dev/null
+++ b/src/Hardware/SAM4S/Devices.cpp
@@ -0,0 +1,74 @@
+/*
+ * Devices.cpp
+ *
+ * Created on: 11 Aug 2020
+ * Author: David
+ */
+
+#include "Devices.h"
+#include <RepRapFirmware.h>
+#include <AnalogIn.h>
+#include <AnalogOut.h>
+#include <pmc/pmc.h>
+
+AsyncSerial Serial (UART0, UART0_IRQn, ID_UART0, 512, 512, [](AsyncSerial*) noexcept { }, [](AsyncSerial*) noexcept { });
+AsyncSerial Serial1(UART1, UART1_IRQn, ID_UART1, 512, 512, [](AsyncSerial*) noexcept { }, [](AsyncSerial*) noexcept { });
+SerialCDC SerialUSB;
+
+void UART0_Handler(void) noexcept
+{
+ Serial.IrqHandler();
+}
+
+void UART1_Handler(void) noexcept
+{
+ Serial1.IrqHandler();
+}
+
+void SerialInit() noexcept
+{
+ SetPinFunction(APIN_Serial0_RXD, Serial0PeriphMode);
+ SetPinFunction(APIN_Serial0_TXD, Serial0PeriphMode);
+ SetPullup(APIN_Serial0_RXD, true);
+
+ SetPinFunction(APIN_Serial1_RXD, Serial1PeriphMode);
+ SetPinFunction(APIN_Serial1_TXD, Serial1PeriphMode);
+ SetPullup(APIN_Serial1_RXD, true);
+}
+
+void SdhcInit() noexcept
+{
+ for (Pin p : HsmciPins)
+ {
+ SetPinFunction(p, HsmciPinsFunction);
+ }
+}
+
+void WireInit() noexcept
+{
+ pmc_enable_periph_clk(WIRE_INTERFACE_ID);
+ SetPinFunction(TWI_Data, TWIPeriphMode);
+ SetPinFunction(TWI_CK, TWIPeriphMode);
+
+ NVIC_DisableIRQ(WIRE_ISR_ID);
+ NVIC_ClearPendingIRQ(WIRE_ISR_ID);
+}
+
+TwoWire Wire(WIRE_INTERFACE, WireInit);
+
+
+// Device initialisation
+void DeviceInit() noexcept
+{
+ LegacyAnalogIn::AnalogInInit();
+ AnalogOut::Init();
+
+ SerialInit();
+ SdhcInit();
+}
+
+void StopAnalogTask() noexcept
+{
+}
+
+// End
diff --git a/src/Hardware/SAM4S/Devices.h b/src/Hardware/SAM4S/Devices.h
new file mode 100644
index 00000000..da8d3c08
--- /dev/null
+++ b/src/Hardware/SAM4S/Devices.h
@@ -0,0 +1,29 @@
+/*
+ * Devices.h
+ *
+ * Created on: 11 Aug 2020
+ * Author: David
+ */
+
+#ifndef SRC_HARDWARE_SAM4S_DEVICES_H_
+#define SRC_HARDWARE_SAM4S_DEVICES_H_
+
+#include <AsyncSerial.h>
+typedef AsyncSerial UARTClass;
+#include <USARTClass.h>
+
+extern AsyncSerial Serial;
+extern AsyncSerial Serial1;
+
+#define SUPPORT_USB 1 // needed by SerialCDC.h
+#include <SerialCDC.h>
+
+extern SerialCDC SerialUSB;
+
+#include <Wire.h>
+extern TwoWire Wire;
+
+void DeviceInit() noexcept;
+void StopAnalogTask() noexcept;
+
+#endif /* SRC_HARDWARE_SAM4S_DEVICES_H_ */
diff --git a/src/Hardware/SAM4S/Main.cpp b/src/Hardware/SAM4S/Main.cpp
new file mode 100644
index 00000000..13261267
--- /dev/null
+++ b/src/Hardware/SAM4S/Main.cpp
@@ -0,0 +1,26 @@
+/*
+ * Main.cpp
+ * Program entry point
+ * Created on: 11 Jul 2020
+ * Author: David
+ * License: GNU GPL version 3
+ */
+
+#include <CoreIO.h>
+#include <RepRapFirmware.h>
+
+// Program initialisation
+void AppInit() noexcept
+{
+ // The prototype boards don't have a pulldown on LCD_BEEP, which causes a hissing sound from the beeper on the 12864 display until the pin is initialised
+ pinMode(LcdBeepPin, OUTPUT_LOW);
+
+ // Set the 12864 display CS pin low to prevent it from receiving garbage due to other SPI traffic
+ pinMode(LcdCSPin, OUTPUT_LOW);
+
+ // On the prototype boards the stepper driver expansion ports don't have external pullup resistors on their enable pins
+ pinMode(ENABLE_PINS[5], OUTPUT_HIGH);
+ pinMode(ENABLE_PINS[6], OUTPUT_HIGH);
+}
+
+// End
diff --git a/src/Hardware/SAM4S/PinDescription.h b/src/Hardware/SAM4S/PinDescription.h
new file mode 100644
index 00000000..6f552cff
--- /dev/null
+++ b/src/Hardware/SAM4S/PinDescription.h
@@ -0,0 +1,49 @@
+/*
+ * PinDescription.h
+ *
+ * Created on: 10 Jul 2020
+ * Author: David
+ */
+
+#ifndef SRC_HARDWARE_SAM4S_PINDESCRIPTION_H_
+#define SRC_HARDWARE_SAM4S_PINDESCRIPTION_H_
+
+#include <CoreIO.h>
+
+// Enum to represent allowed types of pin access
+// We don't have a separate bit for servo, because Duet PWM-capable ports can be used for servos if they are on the Duet main board
+enum class PinCapability: uint8_t
+{
+ // Individual capabilities
+ none = 0,
+ read = 1,
+ ain = 2,
+ write = 4,
+ pwm = 8,
+
+ // Combinations
+ ainr = 1|2,
+ rw = 1|4,
+ wpwm = 4|8,
+ rwpwm = 1|4|8,
+ ainrw = 1|2|4,
+ ainrwpwm = 1|2|4|8
+};
+
+constexpr inline PinCapability operator|(PinCapability a, PinCapability b) noexcept
+{
+ return (PinCapability)((uint8_t)a | (uint8_t)b);
+}
+
+// The pin description says what functions are available on each pin, filtered to avoid allocating the same function to more than one pin..
+// It is a struct not a class so that it can be direct initialised in read-only memory.
+struct PinDescription : public PinDescriptionBase
+{
+ PinCapability cap;
+ const char* pinNames;
+
+ PinCapability GetCapability() const noexcept { return cap; }
+ const char* GetNames() const noexcept { return pinNames; }
+};
+
+#endif /* SRC_HARDWARE_SAM4S_PINDESCRIPTION_H_ */
diff --git a/src/Linux/DataTransfer.cpp b/src/Linux/DataTransfer.cpp
index 72fde11a..9fc485ac 100644
--- a/src/Linux/DataTransfer.cpp
+++ b/src/Linux/DataTransfer.cpp
@@ -39,12 +39,14 @@ constexpr IRQn SBC_SPI_IRQn = SbcSpiSercomIRQn;
#endif
#if USE_DMAC
-# include "dmac/dmac.h"
-# include "matrix/matrix.h"
+# include <dmac/dmac.h>
+# include <matrix/matrix.h>
+# include <pmc/pmc.h>
+# include <spi/spi.h>
#endif
#if USE_XDMAC
-# include "xdmac/xdmac.h"
+# include <xdmac/xdmac.h>
#endif
#if USE_DMAC_MANAGER || SAME70
diff --git a/src/Platform.cpp b/src/Platform.cpp
index f987d84b..a99e3051 100644
--- a/src/Platform.cpp
+++ b/src/Platform.cpp
@@ -163,36 +163,6 @@ int debugLine = 0;
// Global functions
-// Urgent initialisation function
-// This is called before general init has been done, and before constructors for C++ static data have been called.
-// Therefore, be very careful what you do here!
-extern "C" void AppUrgentInit()
-{
-#if defined(DUET_NG)
- // When the reset button is pressed on pre-production Duet WiFi boards, if the TMC2660 drivers were previously enabled then we get
- // uncommanded motor movements if the STEP lines pick up any noise. Try to reduce that by initialising the pins that control the drivers early here.
- // On the production boards the ENN line is pulled high by an external pullup resistor and that prevents motor movements.
- for (size_t drive = 0; drive < MaxSmartDrivers; ++drive)
- {
- pinMode(STEP_PINS[drive], OUTPUT_LOW);
- pinMode(DIRECTION_PINS[drive], OUTPUT_LOW);
- pinMode(ENABLE_PINS[drive], OUTPUT_HIGH);
- }
-#endif
-
-#if defined(DUET_M)
- // The prototype boards don't have a pulldown on LCD_BEEP, which causes a hissing sound from the beeper on the 12864 display until the pin is initialised
- pinMode(LcdBeepPin, OUTPUT_LOW);
-
- // Set the 12864 display CS pin low to prevent it from receiving garbage due to other SPI traffic
- pinMode(LcdCSPin, OUTPUT_LOW);
-
- // On the prototype boards the stepper driver expansion ports don't have external pullup resistors on their enable pins
- pinMode(ENABLE_PINS[5], OUTPUT_HIGH);
- pinMode(ENABLE_PINS[6], OUTPUT_HIGH);
-#endif
-}
-
DriversBitmap AxisDriversConfig::GetDriversBitmap() const noexcept
{
DriversBitmap rslt;
@@ -5208,10 +5178,8 @@ void Platform::Tick() noexcept
// To reduce noise, we use x16 hardware averaging on AFEC0 and x256 on AFEC1. This is hard coded in file AnalogIn.cpp in project CoreNG.
// There is enough time to convert all AFEC0 channels in one tick, but only one AFEC1 channel because of the higher averaging.
LegacyAnalogIn::AnalogInStartConversion(0x0FFF | (1u << (uint8_t) filteredAdcChannels[currentFilterNumber]));
-#elif SAM4E || SAM4S
- LegacyAnalogIn::AnalogInStartConversion();
#elif !SAME5x
- AnalogInStartConversion();
+ LegacyAnalogIn::AnalogInStartConversion();
#endif
}