Skip to content

Commit c42939f

Browse files
committed
Preliminary firmware
A preliminary firmware was added, based on the STM32F4-DISVOCERY demo. It has support (initialization) for: _ PAL _ MAC RMII _ SERIAL _ UART _ USB FS _ SERIAL/USB (CDC) Andrea Zoppi
1 parent 3bc55fa commit c42939f

File tree

17 files changed

+11876
-0
lines changed

17 files changed

+11876
-0
lines changed

fw/.cproject

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<?fileVersion 4.0.0?>
3+
4+
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
5+
<storageModule moduleId="org.eclipse.cdt.core.settings">
6+
<cconfiguration id="0.97092617">
7+
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.97092617" moduleId="org.eclipse.cdt.core.settings" name="Default">
8+
<externalSettings/>
9+
<extensions>
10+
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
11+
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
12+
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
13+
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
14+
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
15+
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
16+
</extensions>
17+
</storageModule>
18+
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
19+
<configuration buildProperties="" description="" id="0.97092617" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
20+
<folderInfo id="0.97092617." name="/" resourcePath="">
21+
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.393868061" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
22+
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.393868061.481910769" name=""/>
23+
<builder id="org.eclipse.cdt.build.core.settings.default.builder.343974975" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
24+
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1723012745" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
25+
<tool id="org.eclipse.cdt.build.core.settings.holder.680661856" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
26+
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.518959051" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
27+
</tool>
28+
<tool id="org.eclipse.cdt.build.core.settings.holder.380167970" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
29+
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1041112538" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
30+
</tool>
31+
<tool id="org.eclipse.cdt.build.core.settings.holder.1883912791" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
32+
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.561008877" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
33+
</tool>
34+
</toolChain>
35+
</folderInfo>
36+
</configuration>
37+
</storageModule>
38+
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
39+
</cconfiguration>
40+
</storageModule>
41+
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
42+
<project id="R2D_GW_module.null.1896759637" name="R2D_GW_module"/>
43+
</storageModule>
44+
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
45+
<storageModule moduleId="refreshScope"/>
46+
<storageModule moduleId="scannerConfiguration">
47+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
48+
<scannerConfigBuildInfo instanceId="0.114656749">
49+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
50+
</scannerConfigBuildInfo>
51+
<scannerConfigBuildInfo instanceId="0.77913033">
52+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
53+
</scannerConfigBuildInfo>
54+
<scannerConfigBuildInfo instanceId="0.97092617">
55+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
56+
</scannerConfigBuildInfo>
57+
<scannerConfigBuildInfo instanceId="0.799087055">
58+
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
59+
</scannerConfigBuildInfo>
60+
</storageModule>
61+
</cproject>

fw/.directory

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Dolphin]
2+
Timestamp=2012,9,25,14,25,42
3+
Version=2
4+
5+
[Settings]
6+
ShowDotFiles=true

fw/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
.dep

fw/.project

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>ARMCM4-STM32F407-DISCOVERY-MEMS</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
10+
<triggers>clean,full,incremental,</triggers>
11+
<arguments>
12+
<dictionary>
13+
<key>?name?</key>
14+
<value></value>
15+
</dictionary>
16+
<dictionary>
17+
<key>org.eclipse.cdt.make.core.append_environment</key>
18+
<value>true</value>
19+
</dictionary>
20+
<dictionary>
21+
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
22+
<value>all</value>
23+
</dictionary>
24+
<dictionary>
25+
<key>org.eclipse.cdt.make.core.buildArguments</key>
26+
<value>-j1</value>
27+
</dictionary>
28+
<dictionary>
29+
<key>org.eclipse.cdt.make.core.buildCommand</key>
30+
<value>make</value>
31+
</dictionary>
32+
<dictionary>
33+
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
34+
<value>clean</value>
35+
</dictionary>
36+
<dictionary>
37+
<key>org.eclipse.cdt.make.core.contents</key>
38+
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
39+
</dictionary>
40+
<dictionary>
41+
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
42+
<value>false</value>
43+
</dictionary>
44+
<dictionary>
45+
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
46+
<value>true</value>
47+
</dictionary>
48+
<dictionary>
49+
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
50+
<value>true</value>
51+
</dictionary>
52+
<dictionary>
53+
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
54+
<value>all</value>
55+
</dictionary>
56+
<dictionary>
57+
<key>org.eclipse.cdt.make.core.stopOnError</key>
58+
<value>true</value>
59+
</dictionary>
60+
<dictionary>
61+
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
62+
<value>true</value>
63+
</dictionary>
64+
</arguments>
65+
</buildCommand>
66+
<buildCommand>
67+
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
68+
<triggers>full,incremental,</triggers>
69+
<arguments>
70+
</arguments>
71+
</buildCommand>
72+
</buildSpec>
73+
<natures>
74+
<nature>org.eclipse.cdt.core.cnature</nature>
75+
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
76+
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
77+
<nature>org.eclipse.cdt.core.ccnature</nature>
78+
</natures>
79+
<linkedResources>
80+
<link>
81+
<name>os</name>
82+
<type>2</type>
83+
<locationURI>CHIBIOS/os</locationURI>
84+
</link>
85+
<link>
86+
<name>test</name>
87+
<type>2</type>
88+
<locationURI>CHIBIOS/test</locationURI>
89+
</link>
90+
</linkedResources>
91+
</projectDescription>

fw/Makefile

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
##############################################################################
2+
# Build global options
3+
# NOTE: Can be overridden externally.
4+
#
5+
6+
# Compiler options here.
7+
ifeq ($(USE_OPT),)
8+
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
9+
endif
10+
11+
# C specific options here (added to USE_OPT).
12+
ifeq ($(USE_COPT),)
13+
USE_COPT =
14+
endif
15+
16+
# C++ specific options here (added to USE_OPT).
17+
ifeq ($(USE_CPPOPT),)
18+
USE_CPPOPT = -fno-rtti
19+
endif
20+
21+
# Enable this if you want the linker to remove unused code and data
22+
ifeq ($(USE_LINK_GC),)
23+
USE_LINK_GC = yes
24+
endif
25+
26+
# If enabled, this option allows to compile the application in THUMB mode.
27+
ifeq ($(USE_THUMB),)
28+
USE_THUMB = yes
29+
endif
30+
31+
# Enable this if you want to see the full log while compiling.
32+
ifeq ($(USE_VERBOSE_COMPILE),)
33+
USE_VERBOSE_COMPILE = no
34+
endif
35+
36+
#
37+
# Build global options
38+
##############################################################################
39+
40+
##############################################################################
41+
# Architecture or project specific options
42+
#
43+
44+
# Enables the use of FPU on Cortex-M4.
45+
ifeq ($(USE_FPU),)
46+
USE_FPU = no
47+
endif
48+
49+
# Enable this if you really want to use the STM FWLib.
50+
ifeq ($(USE_FWLIB),)
51+
USE_FWLIB = no
52+
endif
53+
54+
#
55+
# Architecture or project specific options
56+
##############################################################################
57+
58+
##############################################################################
59+
# Project, sources and paths
60+
#
61+
62+
# Define project name here
63+
PROJECT = ch
64+
65+
# Imported source files and paths
66+
CHIBIOS = /home/texzk/ChibiStudio/chibios
67+
include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk
68+
include $(CHIBIOS)/os/hal/hal.mk
69+
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F4xx/port.mk
70+
include $(CHIBIOS)/os/kernel/kernel.mk
71+
include $(CHIBIOS)/test/test.mk
72+
73+
# Define linker script file here
74+
LDSCRIPT= $(PORTLD)/STM32F407xG.ld
75+
#LDSCRIPT= $(PORTLD)/STM32F407xG_CCM.ld
76+
77+
# C sources that can be compiled in ARM or THUMB mode depending on the global
78+
# setting.
79+
CSRC = $(PORTSRC) \
80+
$(KERNSRC) \
81+
$(TESTSRC) \
82+
$(HALSRC) \
83+
$(PLATFORMSRC) \
84+
$(CHIBIOS)/os/various/shell.c \
85+
$(CHIBIOS)/os/various/chprintf.c \
86+
main.c board.c usbcfg.c
87+
88+
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
89+
# setting.
90+
CPPSRC =
91+
92+
# C sources to be compiled in ARM mode regardless of the global setting.
93+
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
94+
# option that results in lower performance and larger code size.
95+
ACSRC =
96+
97+
# C++ sources to be compiled in ARM mode regardless of the global setting.
98+
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
99+
# option that results in lower performance and larger code size.
100+
ACPPSRC =
101+
102+
# C sources to be compiled in THUMB mode regardless of the global setting.
103+
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
104+
# option that results in lower performance and larger code size.
105+
TCSRC =
106+
107+
# C sources to be compiled in THUMB mode regardless of the global setting.
108+
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
109+
# option that results in lower performance and larger code size.
110+
TCPPSRC =
111+
112+
# List ASM source files here
113+
ASMSRC = $(PORTASM)
114+
115+
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
116+
$(HALINC) $(PLATFORMINC) $(BOARDINC) \
117+
$(CHIBIOS)/os/various/devices_lib/accel \
118+
$(CHIBIOS)/os/various
119+
120+
#
121+
# Project, sources and paths
122+
##############################################################################
123+
124+
##############################################################################
125+
# Compiler settings
126+
#
127+
128+
MCU = cortex-m4
129+
130+
#TRGT = arm-elf-
131+
TRGT = arm-none-eabi-
132+
CC = $(TRGT)gcc
133+
CPPC = $(TRGT)g++
134+
# Enable loading with g++ only if you need C++ runtime support.
135+
# NOTE: You can use C++ even without C++ support if you are careful. C++
136+
# runtime support makes code size explode.
137+
LD = $(TRGT)gcc
138+
#LD = $(TRGT)g++
139+
CP = $(TRGT)objcopy
140+
AS = $(TRGT)gcc -x assembler-with-cpp
141+
OD = $(TRGT)objdump
142+
HEX = $(CP) -O ihex
143+
BIN = $(CP) -O binary
144+
145+
# ARM-specific options here
146+
AOPT =
147+
148+
# THUMB-specific options here
149+
TOPT = -mthumb -DTHUMB
150+
151+
# Define C warning options here
152+
CWARN = -Wall -Wextra -Wstrict-prototypes
153+
154+
# Define C++ warning options here
155+
CPPWARN = -Wall -Wextra
156+
157+
#
158+
# Compiler settings
159+
##############################################################################
160+
161+
##############################################################################
162+
# Start of default section
163+
#
164+
165+
# List all default C defines here, like -D_DEBUG=1
166+
DDEFS =
167+
168+
# List all default ASM defines here, like -D_DEBUG=1
169+
DADEFS =
170+
171+
# List all default directories to look for include files here
172+
DINCDIR =
173+
174+
# List the default directory to look for the libraries here
175+
DLIBDIR =
176+
177+
# List all default libraries here
178+
DLIBS =
179+
180+
#
181+
# End of default section
182+
##############################################################################
183+
184+
##############################################################################
185+
# Start of user section
186+
#
187+
188+
# List all user C define here, like -D_DEBUG=1
189+
UDEFS =
190+
191+
# Define ASM defines here
192+
UADEFS =
193+
194+
# List all user directories here
195+
UINCDIR =
196+
197+
# List the user directory to look for the libraries here
198+
ULIBDIR =
199+
200+
# List all user libraries here
201+
ULIBS =
202+
203+
#
204+
# End of user defines
205+
##############################################################################
206+
207+
ifeq ($(USE_FPU),yes)
208+
USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
209+
DDEFS += -DCORTEX_USE_FPU=TRUE
210+
else
211+
DDEFS += -DCORTEX_USE_FPU=FALSE
212+
endif
213+
214+
ifeq ($(USE_FWLIB),yes)
215+
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
216+
CSRC += $(STM32SRC)
217+
INCDIR += $(STM32INC)
218+
USE_OPT += -DUSE_STDPERIPH_DRIVER
219+
endif
220+
221+
include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk

0 commit comments

Comments
 (0)