From 4edc7535306e2ea7e00bd89f50c1234477a7c74c Mon Sep 17 00:00:00 2001
From: Terraneo Federico <fede.tft@hotmail.it>
Date: Fri, 6 Apr 2012 19:16:48 +0200
Subject: [PATCH] Added EthBoardV2 Netbeans configuration

---
 Makefile                                      |  2 +-
 main.cpp                                      |  2 -
 miosix/config/Makefile.inc                    |  4 +-
 miosix/doc/textdoc/Changelog.txt              |  1 +
 .../Package-stm32f207zg_ethboard_v2.bash      | 75 +++++++++++++++++++
 miosix_np_2/nbproject/configurations.xml      | 46 +++++++++++-
 .../nbproject/private/configurations.xml      | 33 ++++++++
 miosix_np_2/nbproject/project.xml             |  4 +
 8 files changed, 160 insertions(+), 7 deletions(-)
 create mode 100644 miosix_np_2/nbproject/Package-stm32f207zg_ethboard_v2.bash

diff --git a/Makefile b/Makefile
index 277dd02a..6c8092c3 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ SUBDIRS := miosix
 ## List here your source files (both .s, .c and .cpp)
 ##
 SRC :=                                  \
-miosix/testsuite/testsuite.cpp
+main.cpp
 
 ##
 ## List here additional static libraries with relative path
diff --git a/main.cpp b/main.cpp
index c5ca354d..8764b9fa 100644
--- a/main.cpp
+++ b/main.cpp
@@ -8,6 +8,4 @@ using namespace miosix;
 int main()
 {
     //iprintf("Hello world, write your application here\n");
-    
-    //RAM is @ 0x60000000, test it!
 }
diff --git a/miosix/config/Makefile.inc b/miosix/config/Makefile.inc
index eb117900..a57e80cb 100644
--- a/miosix/config/Makefile.inc
+++ b/miosix/config/Makefile.inc
@@ -13,14 +13,14 @@
 ## architecture
 ##
 #OPT_BOARD := lpc2138_miosix_board
-#OPT_BOARD := stm32f103ze_stm3210e-eval
+OPT_BOARD := stm32f103ze_stm3210e-eval
 #OPT_BOARD := stm32f103ve_mp3v2
 #OPT_BOARD := stm32f100rb_stm32vldiscovery
 #OPT_BOARD := stm32f103ve_strive_mini
 #OPT_BOARD := stm32f103ze_redbull_v2
 #OPT_BOARD := stm32f407vg_stm32f4discovery
 #OPT_BOARD := stm32f207ig_stm3220g-eval
-OPT_BOARD := stm32f207zg_ethboard_v2
+#OPT_BOARD := stm32f207zg_ethboard_v2
 
 ##
 ## Optimization flags, choose one.
diff --git a/miosix/doc/textdoc/Changelog.txt b/miosix/doc/textdoc/Changelog.txt
index ebbf71fd..7ade4167 100644
--- a/miosix/doc/textdoc/Changelog.txt
+++ b/miosix/doc/textdoc/Changelog.txt
@@ -1,6 +1,7 @@
 Changelog for Miosix np embedded OS
 
 v1.60
+- Added EthBoardV2 board to the list of supported boards
 - Added configurations support to the Netbeans project. There is now one
   configuration for each supported board. This improves code completion for
   architecture and board specific symbols. Note that selecting a board from the
diff --git a/miosix_np_2/nbproject/Package-stm32f207zg_ethboard_v2.bash b/miosix_np_2/nbproject/Package-stm32f207zg_ethboard_v2.bash
new file mode 100644
index 00000000..597f61a3
--- /dev/null
+++ b/miosix_np_2/nbproject/Package-stm32f207zg_ethboard_v2.bash
@@ -0,0 +1,75 @@
+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=ARM_MIOSIX_EABI-Linux-x86
+CND_CONF=stm32f207zg_ethboard_v2
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=MissingOutputInProject
+OUTPUT_BASENAME=MissingOutputInProject
+PACKAGE_TOP_DIR=miosixnp2/
+
+# Functions
+function checkReturnCode
+{
+    rc=$?
+    if [ $rc != 0 ]
+    then
+        exit $rc
+    fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+    mkdir -p "$1"
+    checkReturnCode
+    if [ "$2" != "" ]
+    then
+      chmod $2 "$1"
+      checkReturnCode
+    fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+    cp "$1" "$2"
+    checkReturnCode
+    if [ "$3" != "" ]
+    then
+        chmod $3 "$2"
+        checkReturnCode
+    fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${NBTMPDIR}
+mkdir -p ${NBTMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory "${NBTMPDIR}/miosixnp2"
+copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/miosixnp2.tar
+cd ${NBTMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/miosixnp2.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${NBTMPDIR}
diff --git a/miosix_np_2/nbproject/configurations.xml b/miosix_np_2/nbproject/configurations.xml
index ad722623..87736cb2 100644
--- a/miosix_np_2/nbproject/configurations.xml
+++ b/miosix_np_2/nbproject/configurations.xml
@@ -177,9 +177,7 @@
                 <in>console.cpp</in>
                 <in>hwmapping.h</in>
               </df>
-              <in>EthBoardV2.cfg</in>
               <in>board_settings.h</in>
-              <in>stm32_1m+128k_rom.ld</in>
             </df>
           </df>
           <df name="cortexM4_stm32f4">
@@ -746,5 +744,49 @@
         </makeTool>
       </makefileType>
     </conf>
+    <conf name="stm32f207zg_ethboard_v2" type="0">
+      <toolsSet>
+        <remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>
+        <compilerSet>ARM_MIOSIX_EABI|GNU</compilerSet>
+      </toolsSet>
+      <makefileType>
+        <makeTool>
+          <buildCommandWorkingDir>..</buildCommandWorkingDir>
+          <buildCommand>${MAKE} -f Makefile</buildCommand>
+          <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
+          <executablePath></executablePath>
+          <cTool>
+            <incDir>
+              <pElem>..</pElem>
+              <pElem>../miosix</pElem>
+              <pElem>../miosix/arch/common</pElem>
+              <pElem>../miosix/arch/cortexM3_stm32f2/common</pElem>
+              <pElem>../miosix/arch/cortexM3_stm32f2/stm32f207zg_EthBoardV2</pElem>
+            </incDir>
+            <preprocessorList>
+              <Elem>_ARCH_CORTEXM3_STM32F2</Elem>
+              <Elem>_BOARD_ETHBOARDV2</Elem>
+              <Elem>_MIOSIX</Elem>
+              <Elem>_POSIX_THREADS</Elem>
+            </preprocessorList>
+          </cTool>
+          <ccTool>
+            <incDir>
+              <pElem>..</pElem>
+              <pElem>../miosix</pElem>
+              <pElem>../miosix/arch/common</pElem>
+              <pElem>../miosix/arch/cortexM3_stm32f2/common</pElem>
+              <pElem>../miosix/arch/cortexM3_stm32f2/stm32f207zg_EthBoardV2</pElem>
+            </incDir>
+            <preprocessorList>
+              <Elem>_ARCH_CORTEXM3_STM32F2</Elem>
+              <Elem>_BOARD_ETHBOARDV2</Elem>
+              <Elem>_MIOSIX</Elem>
+              <Elem>_POSIX_THREADS</Elem>
+            </preprocessorList>
+          </ccTool>
+        </makeTool>
+      </makefileType>
+    </conf>
   </confs>
 </configurationDescriptor>
diff --git a/miosix_np_2/nbproject/private/configurations.xml b/miosix_np_2/nbproject/private/configurations.xml
index 22c89007..ad5c7713 100644
--- a/miosix_np_2/nbproject/private/configurations.xml
+++ b/miosix_np_2/nbproject/private/configurations.xml
@@ -299,5 +299,38 @@
         </environment>
       </runprofile>
     </conf>
+    <conf name="stm32f207zg_ethboard_v2" type="0">
+      <toolsSet>
+        <developmentServer>localhost</developmentServer>
+        <platform>2</platform>
+      </toolsSet>
+      <dbx_gdbdebugger version="1">
+        <gdb_pathmaps>
+        </gdb_pathmaps>
+        <gdb_interceptlist>
+          <gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
+        </gdb_interceptlist>
+        <gdb_options>
+          <DebugOptions>
+          </DebugOptions>
+        </gdb_options>
+        <gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
+      </dbx_gdbdebugger>
+      <nativedebugger version="1">
+        <engine>gdb</engine>
+      </nativedebugger>
+      <runprofile version="9">
+        <runcommandpicklist>
+          <runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
+        </runcommandpicklist>
+        <runcommand>"${OUTPUT_PATH}"</runcommand>
+        <rundir></rundir>
+        <buildfirst>true</buildfirst>
+        <terminal-type>0</terminal-type>
+        <remove-instrumentation>0</remove-instrumentation>
+        <environment>
+        </environment>
+      </runprofile>
+    </conf>
   </confs>
 </configurationDescriptor>
diff --git a/miosix_np_2/nbproject/project.xml b/miosix_np_2/nbproject/project.xml
index e228dbd3..a277459d 100644
--- a/miosix_np_2/nbproject/project.xml
+++ b/miosix_np_2/nbproject/project.xml
@@ -50,6 +50,10 @@
                     <name>stm32f207ig_stm3220g-eval</name>
                     <type>0</type>
                 </confElem>
+                <confElem>
+                    <name>stm32f207zg_ethboard_v2</name>
+                    <type>0</type>
+                </confElem>
             </confList>
         </data>
     </configuration>
-- 
GitLab