aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorRocco Marco Guglielmi <roccomarco.guglielmi@live.com>2017-08-06 17:24:27 +0000
committerRocco Marco Guglielmi <roccomarco.guglielmi@live.com>2017-08-06 17:24:27 +0000
commit99dc081e54aeb135d2a030b116518290f3d8c7f6 (patch)
treeb02c9834b5a7686c9f8e5ecaeb07e4b01afc0177 /demos
parent5c29264cca2db57852cc6d8767d7d8f97731a94d (diff)
downloadChibiOS-99dc081e54aeb135d2a030b116518290f3d8c7f6.tar.gz
ChibiOS-99dc081e54aeb135d2a030b116518290f3d8c7f6.tar.bz2
ChibiOS-99dc081e54aeb135d2a030b116518290f3d8c7f6.zip
Added clock tree management for ATSAMA5D2 (Still uncomplete)
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10361 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/debug/RT-SAMA5D2-XPLAINED (Load and Run).launch6
-rwxr-xr-xdemos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c11
-rw-r--r--demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h11
3 files changed, 20 insertions, 8 deletions
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/debug/RT-SAMA5D2-XPLAINED (Load and Run).launch b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/debug/RT-SAMA5D2-XPLAINED (Load and Run).launch
index 2ff6d2d67..ea0aca12c 100644
--- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/debug/RT-SAMA5D2-XPLAINED (Load and Run).launch
+++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/debug/RT-SAMA5D2-XPLAINED (Load and Run).launch
@@ -6,7 +6,7 @@
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="mon reg cpsr = 0xd3&#10;set *0xF8048000 = 0xA5000004&#10;set *0x00A00100 = 0&#10;set *0xF8048044 = 0x00008000&#10;mon cp15 1 0 0 0 = 0x00C50078&#10;set *0xF0014004 = 0x4&#10;set *0xF0014014 = 1&lt;&lt;13&#10;"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value="mon reg cpsr = 0xd3&#13;&#10;set *0xF8048000 = 0xA5000004&#13;&#10;set *0x00A00100 = 0&#13;&#10;set *0xF8048044 = 0x00008000&#13;&#10;mon cp15 1 0 0 0 = 0x00C50078&#13;&#10;set *0xF0014004 = 0x4&#13;&#10;set *0xF0014014 = 1&lt;&lt;13&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="true"/>
@@ -17,7 +17,7 @@
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="Reset_Handler"/>
+<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="sama_clock_init"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
@@ -33,7 +33,7 @@
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
-<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList/&gt;"/>
+<stringAttribute key="org.eclipse.cdt.launch.FORMAT" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;contentList&gt;&lt;content id=&quot;null-sama_clock_init-(format)&quot; val=&quot;4&quot;/&gt;&lt;/contentList&gt;"/>
<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;globalVariableList/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList/&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c
index d0680cc8c..44b9c0f4b 100755
--- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c
+++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/main.c
@@ -14,9 +14,8 @@
limitations under the License.
*/
-#include <stdbool.h>
-
#include "ch.h"
+#include "hal.h"
static uint32_t counter = 0;
/*
@@ -24,6 +23,14 @@ static uint32_t counter = 0;
*/
int main(void) {
+ /*
+ * System initializations.
+ * - HAL initialization, this also initializes the configured device drivers
+ * and performs the board-specific initializations.
+ * - Kernel initialization, the main() function becomes a thread and the
+ * RTOS is active.
+ */
+ halInit();
chSysInit();
while (true) {
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h
index a1bf19193..3cf952cd7 100644
--- a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h
+++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED/mcuconf.h
@@ -22,9 +22,14 @@
/*
* HAL driver system settings.
*/
-#define SAMA_NO_INIT FALSE
+#define SAMA_NO_INIT TRUE
#define SAMA_MOSCRC_ENABLED TRUE
-#define SAMA_MOSCXT_ENABLED TRUE
+#define SAMA_MOSCXT_ENABLED FALSE
#define SAMA_MOSC_SEL SAMA_MOSC_MOSCRC
-#define SAMA_OSC_SEL SAMA_OSC_OSCRC
+#define SAMA_OSC_SEL SAMA_OSC_OSCXT
+#define SAMA_MCK_SEL SAMA_MCK_PLLA_CLK
+#define SAMA_MCK_PRES SAMA_MCK_PRE_DIV2
+#define SAMA_MCK_MDIV SAMA_MCK_MDIV_DIV1
+#define SAMA_PLLA_MUL_VALUE 83
+#define SAMA_PLLADIV2_EN FALSE
#endif /* MCUCONF_H */