Revision f4da707a
modules/NUCLEO-F103RB/Makefile | ||
---|---|---|
1 |
################################################################################ |
|
2 |
# AMiRo-OS is an operating system designed for the Autonomous Mini Robot # |
|
3 |
# (AMiRo) platform. # |
|
4 |
# Copyright (C) 2016..2019 Thomas Schöpping et al. # |
|
5 |
# # |
|
6 |
# This program is free software: you can redistribute it and/or modify # |
|
7 |
# it under the terms of the GNU General Public License as published by # |
|
8 |
# the Free Software Foundation, either version 3 of the License, or # |
|
9 |
# (at your option) any later version. # |
|
10 |
# # |
|
11 |
# This program is distributed in the hope that it will be useful, # |
|
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
|
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
|
14 |
# GNU General Public License for more details. # |
|
15 |
# # |
|
16 |
# You should have received a copy of the GNU General Public License # |
|
17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. # |
|
18 |
# # |
|
19 |
# This research/work was supported by the Cluster of Excellence Cognitive # |
|
20 |
# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is # |
|
21 |
# funded by the German Research Foundation (DFG). # |
|
22 |
################################################################################ |
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
################################################################################ |
|
27 |
# Build global options # |
|
28 |
# NOTE: Can be overridden externally. # |
|
29 |
# # |
|
30 |
|
|
31 |
# Compiler options here. |
|
32 |
ifeq ($(USE_OPT),) |
|
33 |
USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16 -fstack-usage |
|
34 |
endif |
|
35 |
|
|
36 |
# C specific options here (added to USE_OPT). |
|
37 |
ifeq ($(USE_COPT),) |
|
38 |
USE_COPT = -std=c11 |
|
39 |
endif |
|
40 |
|
|
41 |
# C++ specific options here (added to USE_OPT). |
|
42 |
ifeq ($(USE_CPPOPT),) |
|
43 |
USE_CPPOPT = -fno-rtti -std=c++17 |
|
44 |
endif |
|
45 |
|
|
46 |
# Enable this if you want the linker to remove unused code and data |
|
47 |
ifeq ($(USE_LINK_GC),) |
|
48 |
USE_LINK_GC = yes |
|
49 |
endif |
|
50 |
|
|
51 |
# Linker extra options here. |
|
52 |
ifeq ($(USE_LDOPT),) |
|
53 |
USE_LDOPT = |
|
54 |
endif |
|
55 |
|
|
56 |
# Enable this if you want link time optimizations (LTO) |
|
57 |
ifeq ($(USE_LTO),) |
|
58 |
USE_LTO = yes |
|
59 |
endif |
|
60 |
|
|
61 |
# If enabled, this option allows to compile the application in THUMB mode. |
|
62 |
ifeq ($(USE_THUMB),) |
|
63 |
USE_THUMB = yes |
|
64 |
endif |
|
65 |
|
|
66 |
# Enable this if you want to see the full log while compiling. |
|
67 |
ifeq ($(USE_VERBOSE_COMPILE),) |
|
68 |
USE_VERBOSE_COMPILE = no |
|
69 |
endif |
|
70 |
|
|
71 |
# If enabled, this option makes the build process faster by not compiling |
|
72 |
# modules not used in the current configuration. |
|
73 |
ifeq ($(USE_SMART_BUILD),) |
|
74 |
USE_SMART_BUILD = no |
|
75 |
endif |
|
76 |
|
|
77 |
# # |
|
78 |
# Build global options # |
|
79 |
################################################################################ |
|
80 |
|
|
81 |
################################################################################ |
|
82 |
# Architecture or project specific options # |
|
83 |
# # |
|
84 |
|
|
85 |
# Stack size to be allocated to the Cortex-M process stack. This stack is |
|
86 |
# the stack used by the main() thread. |
|
87 |
ifeq ($(USE_PROCESS_STACKSIZE),) |
|
88 |
USE_PROCESS_STACKSIZE = 0x400 |
|
89 |
endif |
|
90 |
|
|
91 |
# Stack size to the allocated to the Cortex-M main/exceptions stack. This |
|
92 |
# stack is used for processing interrupts and exceptions. |
|
93 |
ifeq ($(USE_EXCEPTIONS_STACKSIZE),) |
|
94 |
USE_EXCEPTIONS_STACKSIZE = 0x400 |
|
95 |
endif |
|
96 |
|
|
97 |
# Enables the use of FPU on Cortex-M4. |
|
98 |
# Possible selections are: |
|
99 |
# no - no FPU is used (probably equals 'soft') |
|
100 |
# soft - does not use the FPU, thus all floating point operations are emulated |
|
101 |
# softfp - uses the FPU, but uses the integer registers only |
|
102 |
# hard - uses the FPU and passes data via the FPU registers |
|
103 |
ifeq ($(USE_FPU),) |
|
104 |
USE_FPU = no |
|
105 |
endif |
|
106 |
|
|
107 |
# # |
|
108 |
# Architecture or project specific options # |
|
109 |
################################################################################ |
|
110 |
|
|
111 |
################################################################################ |
|
112 |
# Project, sources and paths # |
|
113 |
# # |
|
114 |
|
|
115 |
# Define project name here |
|
116 |
PROJECT := $(patsubst $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))..)/%,%,$(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))) |
|
117 |
|
|
118 |
# Imported source files and paths |
|
119 |
include ../../kernel/kernel.mk |
|
120 |
CHIBIOS := $(AMIROOS_KERNEL) |
|
121 |
AMIROOS = ../.. |
|
122 |
# Licensing files |
|
123 |
include $(CHIBIOS)/os/license/license.mk |
|
124 |
# Startup files |
|
125 |
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk |
|
126 |
# HAL-OSAL files |
|
127 |
include $(CHIBIOS)/os/hal/hal.mk |
|
128 |
include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk |
|
129 |
include $(CHIBIOS)/os/hal/osal/rt/osal.mk |
|
130 |
# RTOS files |
|
131 |
include $(CHIBIOS)/os/rt/rt.mk |
|
132 |
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
|
133 |
# Other files (optional). |
|
134 |
include $(CHIBIOS)/test/lib/test.mk |
|
135 |
include $(CHIBIOS)/test/rt/rt_test.mk |
|
136 |
include $(CHIBIOS)/test/oslib/oslib_test.mk |
|
137 |
# AMiRo-BLT files |
|
138 |
include ../../bootloader/bootloader.mk |
|
139 |
# AMiRo-LLD files |
|
140 |
include ../../periphery-lld/periphery-lld.mk |
|
141 |
# AMiRo-OS files |
|
142 |
include ../modules.mk |
|
143 |
include $(AMIROOS)/core/core.mk |
|
144 |
include $(AMIROOS)/unittests/unittests.mk |
|
145 |
|
|
146 |
# Define linker script file here |
|
147 |
LDSCRIPT= STM32F103xB.ld |
|
148 |
|
|
149 |
# C sources that can be compiled in ARM or THUMB mode depending on the global |
|
150 |
# setting. |
|
151 |
CSRC = $(LICSRC) \ |
|
152 |
$(STARTUPSRC) \ |
|
153 |
$(KERNSRC) \ |
|
154 |
$(PORTSRC) \ |
|
155 |
$(OSALSRC) \ |
|
156 |
$(HALSRC) \ |
|
157 |
$(PLATFORMSRC) \ |
|
158 |
$(MODULESCSRC) \ |
|
159 |
$(TESTSRC) \ |
|
160 |
$(PERIPHERYLLDCSRC) \ |
|
161 |
$(AMIROOSCORECSRC) \ |
|
162 |
$(UNITTESTSCSRC) \ |
|
163 |
$(CHIBIOS)/os/various/evtimer.c \ |
|
164 |
$(CHIBIOS)/os/various/syscalls.c \ |
|
165 |
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \ |
|
166 |
board.c \ |
|
167 |
module.c \ |
|
168 |
$(APPSCSRC) |
|
169 |
|
|
170 |
# C++ sources that can be compiled in ARM or THUMB mode depending on the global |
|
171 |
# setting. |
|
172 |
CPPSRC = $(AMIROOSCORECPPSRC) \ |
|
173 |
$(CHIBIOS)/os/various/cpp_wrappers/syscalls_cpp.cpp \ |
|
174 |
$(APPSCPPSRC) |
|
175 |
|
|
176 |
# C sources to be compiled in ARM mode regardless of the global setting. |
|
177 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
178 |
# option that results in lower performance and larger code size. |
|
179 |
ACSRC = $(APPSACSRC) |
|
180 |
|
|
181 |
# C++ sources to be compiled in ARM mode regardless of the global setting. |
|
182 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
183 |
# option that results in lower performance and larger code size. |
|
184 |
ACPPSRC = $(APPSACPPSRC) |
|
185 |
|
|
186 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
|
187 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
188 |
# option that results in lower performance and larger code size. |
|
189 |
TCSRC = $(APPSTCSRC) |
|
190 |
|
|
191 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
|
192 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
193 |
# option that results in lower performance and larger code size. |
|
194 |
TCPPSRC = $(APPSTCPPSRC) |
|
195 |
|
|
196 |
# List ASM source files here |
|
197 |
ASMSRC = $(APPSASMSRC) |
|
198 |
ASMXSRC = $(STARTUPASM) \ |
|
199 |
$(PORTASM) \ |
|
200 |
$(OSALASM) \ |
|
201 |
$(APPSASMXSRC) |
|
202 |
|
|
203 |
INCDIR = $(LICINC) \ |
|
204 |
$(STARTUPINC) \ |
|
205 |
$(KERNINC) \ |
|
206 |
$(PORTINC) \ |
|
207 |
$(OSALINC) \ |
|
208 |
$(HALINC) \ |
|
209 |
$(PLATFORMINC) \ |
|
210 |
$(MODULESINC) \ |
|
211 |
$(TESTINC) \ |
|
212 |
$(BOOTLOADERINC) \ |
|
213 |
$(CHIBIOS)/os/hal/lib/streams \ |
|
214 |
$(PERIPHERYLLDINC) \ |
|
215 |
$(AMIROOS) \ |
|
216 |
$(AMIROOSCOREINC) \ |
|
217 |
$(UNITTESTSINC) \ |
|
218 |
$(APPSINC) |
|
219 |
|
|
220 |
# # |
|
221 |
# Project, sources and paths # |
|
222 |
################################################################################ |
|
223 |
|
|
224 |
################################################################################ |
|
225 |
# Compiler settings # |
|
226 |
# NOTE: Some can be overridden externally. # |
|
227 |
# # |
|
228 |
|
|
229 |
MCU = cortex-m4 |
|
230 |
|
|
231 |
#TRGT = arm-elf- |
|
232 |
TRGT = arm-none-eabi- |
|
233 |
CC = $(TRGT)gcc |
|
234 |
CPPC = $(TRGT)g++ |
|
235 |
# Enable loading with g++ only if you need C++ runtime support. |
|
236 |
# NOTE: You can use C++ even without C++ support if you are careful. C++ |
|
237 |
# runtime support makes code size explode. |
|
238 |
LD = $(TRGT)gcc |
|
239 |
#LD = $(TRGT)g++ |
|
240 |
CP = $(TRGT)objcopy |
|
241 |
AS = $(TRGT)gcc -x assembler-with-cpp |
|
242 |
AR = $(TRGT)ar |
|
243 |
OD = $(TRGT)objdump |
|
244 |
SZ = $(TRGT)size |
|
245 |
HEX = $(CP) -O ihex |
|
246 |
BIN = $(CP) -O binary |
|
247 |
SREC = $(CP) -O srec --srec-len=248 |
|
248 |
|
|
249 |
# ARM-specific options here |
|
250 |
ifeq ($(AOPT),) |
|
251 |
AOPT = |
|
252 |
endif |
|
253 |
|
|
254 |
# THUMB-specific options here |
|
255 |
ifeq ($(TOPT),) |
|
256 |
TOPT = -mthumb -DTHUMB |
|
257 |
endif |
|
258 |
|
|
259 |
# Define C warning options here |
|
260 |
ifeq ($(CWARN),) |
|
261 |
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes |
|
262 |
endif |
|
263 |
|
|
264 |
# Define C++ warning options here |
|
265 |
ifeq ($(CPPWARN),) |
|
266 |
CPPWARN = -Wall -Wextra -Wundef |
|
267 |
endif |
|
268 |
|
|
269 |
# # |
|
270 |
# Compiler settings # |
|
271 |
################################################################################ |
|
272 |
|
|
273 |
################################################################################ |
|
274 |
# Start of user section # |
|
275 |
# # |
|
276 |
|
|
277 |
# List all user C define here, like -D_DEBUG=1 |
|
278 |
UDEFS += |
|
279 |
|
|
280 |
# Define ASM defines here |
|
281 |
UADEFS += |
|
282 |
|
|
283 |
# List all user directories here |
|
284 |
UINCDIR += |
|
285 |
|
|
286 |
# List the user directory to look for the libraries here |
|
287 |
ULIBDIR += |
|
288 |
|
|
289 |
# List all user libraries here |
|
290 |
ULIBS += |
|
291 |
|
|
292 |
# # |
|
293 |
# End of user defines # |
|
294 |
################################################################################ |
|
295 |
|
|
296 |
################################################################################ |
|
297 |
# Start of targets section # |
|
298 |
# # |
|
299 |
|
|
300 |
# all and its dependencies |
|
301 |
ifeq ($(BUILDDIR),) |
|
302 |
BUILDDIR = ./build |
|
303 |
endif |
|
304 |
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC |
|
305 |
include $(RULESPATH)/rules.mk |
|
306 |
|
|
307 |
# flash |
|
308 |
include $(AMIROOS)/bootloader/bootloader.mk |
|
309 |
|
|
310 |
flash: $(BUILDDIR)/$(PROJECT).elf |
|
311 |
openocd -f interface/stlink-v2-1.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f1x.cfg -c "program build/$(PROJECT).elf verify reset exit" |
|
312 |
|
|
313 |
# # |
|
314 |
# End of targets section # |
|
315 |
################################################################################ |
|
316 |
|
modules/NUCLEO-F103RB/STM32F103xB.ld | ||
---|---|---|
1 |
/* |
|
2 |
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio |
|
3 |
|
|
4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
you may not use this file except in compliance with the License. |
|
6 |
You may obtain a copy of the License at |
|
7 |
|
|
8 |
http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
|
|
10 |
Unless required by applicable law or agreed to in writing, software |
|
11 |
distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
See the License for the specific language governing permissions and |
|
14 |
limitations under the License. |
|
15 |
*/ |
|
16 |
|
|
17 |
/* |
|
18 |
* ST32F103xB memory setup. |
|
19 |
*/ |
|
20 |
MEMORY |
|
21 |
{ |
|
22 |
flash0 : org = 0x08000000, len = 128k |
|
23 |
flash1 : org = 0x00000000, len = 0 |
|
24 |
flash2 : org = 0x00000000, len = 0 |
|
25 |
flash3 : org = 0x00000000, len = 0 |
|
26 |
flash4 : org = 0x00000000, len = 0 |
|
27 |
flash5 : org = 0x00000000, len = 0 |
|
28 |
flash6 : org = 0x00000000, len = 0 |
|
29 |
flash7 : org = 0x00000000, len = 0 |
|
30 |
ram0 : org = 0x20000000, len = 20k |
|
31 |
ram1 : org = 0x00000000, len = 0 |
|
32 |
ram2 : org = 0x00000000, len = 0 |
|
33 |
ram3 : org = 0x00000000, len = 0 |
|
34 |
ram4 : org = 0x00000000, len = 0 |
|
35 |
ram5 : org = 0x00000000, len = 0 |
|
36 |
ram6 : org = 0x00000000, len = 0 |
|
37 |
ram7 : org = 0x00000000, len = 0 |
|
38 |
} |
|
39 |
|
|
40 |
/* For each data/text section two region are defined, a virtual region |
|
41 |
and a load region (_LMA suffix).*/ |
|
42 |
|
|
43 |
/* Flash region to be used for exception vectors.*/ |
|
44 |
REGION_ALIAS("VECTORS_FLASH", flash0); |
|
45 |
REGION_ALIAS("VECTORS_FLASH_LMA", flash0); |
|
46 |
|
|
47 |
/* Flash region to be used for constructors and destructors.*/ |
|
48 |
REGION_ALIAS("XTORS_FLASH", flash0); |
|
49 |
REGION_ALIAS("XTORS_FLASH_LMA", flash0); |
|
50 |
|
|
51 |
/* Flash region to be used for code text.*/ |
|
52 |
REGION_ALIAS("TEXT_FLASH", flash0); |
|
53 |
REGION_ALIAS("TEXT_FLASH_LMA", flash0); |
|
54 |
|
|
55 |
/* Flash region to be used for read only data.*/ |
|
56 |
REGION_ALIAS("RODATA_FLASH", flash0); |
|
57 |
REGION_ALIAS("RODATA_FLASH_LMA", flash0); |
|
58 |
|
|
59 |
/* Flash region to be used for various.*/ |
|
60 |
REGION_ALIAS("VARIOUS_FLASH", flash0); |
|
61 |
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); |
|
62 |
|
|
63 |
/* Flash region to be used for RAM(n) initialization data.*/ |
|
64 |
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); |
|
65 |
|
|
66 |
/* RAM region to be used for Main stack. This stack accommodates the processing |
|
67 |
of all exceptions and interrupts.*/ |
|
68 |
REGION_ALIAS("MAIN_STACK_RAM", ram0); |
|
69 |
|
|
70 |
/* RAM region to be used for the process stack. This is the stack used by |
|
71 |
the main() function.*/ |
|
72 |
REGION_ALIAS("PROCESS_STACK_RAM", ram0); |
|
73 |
|
|
74 |
/* RAM region to be used for data segment.*/ |
|
75 |
REGION_ALIAS("DATA_RAM", ram0); |
|
76 |
REGION_ALIAS("DATA_RAM_LMA", flash0); |
|
77 |
|
|
78 |
/* RAM region to be used for BSS segment.*/ |
|
79 |
REGION_ALIAS("BSS_RAM", ram0); |
|
80 |
|
|
81 |
/* RAM region to be used for the default heap.*/ |
|
82 |
REGION_ALIAS("HEAP_RAM", ram0); |
|
83 |
|
|
84 |
/* Generic rules inclusion.*/ |
|
85 |
INCLUDE rules.ld |
modules/NUCLEO-F103RB/alldconf.h | ||
---|---|---|
1 |
/* |
|
2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
3 |
Copyright (C) 2016..2019 Thomas Schöpping et al. |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU General Public License as published by |
|
7 |
the Free Software Foundation, either version 3 of the License, or |
|
8 |
(at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU General Public License |
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
|
19 |
/** |
|
20 |
* @file |
|
21 |
* @brief AMiRo-LLD configuration file for the NUCLEO-F103RB board. |
|
22 |
* @details Contains the application specific AMiRo-LLD settings. |
|
23 |
* |
|
24 |
* @addtogroup NUCLEO-F103RB_lld_config |
|
25 |
* @{ |
|
26 |
*/ |
|
27 |
|
|
28 |
#ifndef _ALLDCONF_H_ |
|
29 |
#define _ALLDCONF_H_ |
|
30 |
|
|
31 |
/* |
|
32 |
* compatibility guards |
|
33 |
*/ |
|
34 |
#define _AMIRO_LLD_CFG_ |
|
35 |
#define AMIRO_LLD_CFG_VERSION_MAJOR 1 |
|
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 0 |
|
37 |
|
|
38 |
/** |
|
39 |
* @brief Width of the apalTime_t data type. |
|
40 |
* |
|
41 |
* @details Possible values are 8, 16, 32, and 64 bits. |
|
42 |
* By definition time is represented at microsecond precision. |
|
43 |
*/ |
|
44 |
#define AMIROLLD_CFG_TIME_SIZE 32 |
|
45 |
|
|
46 |
#endif /* _ALLDCONF_H_ */ |
|
47 |
|
|
48 |
/** @} */ |
modules/NUCLEO-F103RB/aosconf.h | ||
---|---|---|
1 |
/* |
|
2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
3 |
Copyright (C) 2016..2019 Thomas Schöpping et al. |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU General Public License as published by |
|
7 |
the Free Software Foundation, either version 3 of the License, or |
|
8 |
(at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU General Public License |
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
|
19 |
/** |
|
20 |
* @file |
|
21 |
* @brief AMiRo-OS Configuration file for the NUCLEO-F103RB module. |
|
22 |
* @details Contains the application specific AMiRo-OS settings. |
|
23 |
* |
|
24 |
* @addtogroup NUCLEO-F103RB_aos_config |
|
25 |
* @{ |
|
26 |
*/ |
|
27 |
|
|
28 |
#ifndef _AOSCONF_H_ |
|
29 |
#define _AOSCONF_H_ |
|
30 |
|
|
31 |
/* |
|
32 |
* compatibility guards |
|
33 |
*/ |
|
34 |
#define _AMIRO_OS_CFG_ |
|
35 |
#define _AMIRO_OS_CFG_VERSION_MAJOR_ 2 |
|
36 |
#define _AMIRO_OS_CFG_VERSION_MINOR_ 0 |
|
37 |
|
|
38 |
#include <stdbool.h> |
|
39 |
|
|
40 |
/* |
|
41 |
* Include an external configuration file to override the following default settings only if required. |
|
42 |
*/ |
|
43 |
#if defined(AMIRO_APPS) && (AMIRO_APPS == true) |
|
44 |
#include <osconf.h> |
|
45 |
#endif |
|
46 |
|
|
47 |
/*===========================================================================*/ |
|
48 |
/** |
|
49 |
* @name Kernel parameters and options |
|
50 |
* @{ |
|
51 |
*/ |
|
52 |
/*===========================================================================*/ |
|
53 |
|
|
54 |
/** |
|
55 |
* @brief Flag to enable/disable debug API and logic. |
|
56 |
*/ |
|
57 |
#if !defined(OS_CFG_DBG) |
|
58 |
#define AMIROOS_CFG_DBG true |
|
59 |
#else |
|
60 |
#define AMIROOS_CFG_DBG OS_CFG_DBG |
|
61 |
#endif |
|
62 |
|
|
63 |
/** |
|
64 |
* @brief Flag to enable/disable unit tests. |
|
65 |
* @note Setting this flag will implicitely enable the shell. |
|
66 |
*/ |
|
67 |
#if !defined(OS_CFG_TESTS_ENABLE) |
|
68 |
#define AMIROOS_CFG_TESTS_ENABLE true |
|
69 |
#else |
|
70 |
#define AMIROOS_CFG_TESTS_ENABLE OS_CFG_TESTS_ENABLE |
|
71 |
#endif |
|
72 |
|
|
73 |
/** |
|
74 |
* @brief Flag to enable/disable profiling API and logic. |
|
75 |
*/ |
|
76 |
#if !defined(OS_CFG_PROFILE) |
|
77 |
#define AMIROOS_CFG_PROFILE true |
|
78 |
#else |
|
79 |
#define AMIROOS_CFG_PROFILE OS_CFG_PROFILE |
|
80 |
#endif |
|
81 |
|
|
82 |
/** |
|
83 |
* @brief Mask for the control thread to listen to certain IO events. |
|
84 |
* @note Any mandatory events (e.g. for SSSP) are enabled implicitely despite this configuration. |
|
85 |
*/ |
|
86 |
#if !defined(OS_CFG_MAIN_LOOP_IOEVENT_MASK) |
|
87 |
#define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK MODULE_OS_IOEVENTFLAGS_USERBUTTON |
|
88 |
#else |
|
89 |
#define AMIROOS_CFG_MAIN_LOOP_IOEVENT_MASK OS_CFG_MAIN_LOOP_IOEVENT_MASK |
|
90 |
#endif |
|
91 |
|
|
92 |
/** |
|
93 |
* @brief Timeout value when waiting for events in the main loop in microseconds. |
|
94 |
* @details A value of 0 deactivates the timeout. |
|
95 |
*/ |
|
96 |
#if !defined(OS_CFG_MAIN_LOOP_TIMEOUT) |
|
97 |
#define AMIROOS_CFG_MAIN_LOOP_TIMEOUT 0 |
|
98 |
#else |
|
99 |
#define AMIROOS_CFG_MAIN_LOOP_TIMEOUT OS_CFG_MAIN_LOOP_TIMEOUT |
|
100 |
#endif |
|
101 |
|
|
102 |
/** @} */ |
|
103 |
|
|
104 |
/*===========================================================================*/ |
|
105 |
/** |
|
106 |
* @name SSSP (Startup Shutdown Synchronization Protocol) configuration. |
|
107 |
* @{ |
|
108 |
*/ |
|
109 |
/*===========================================================================*/ |
|
110 |
|
|
111 |
/** |
|
112 |
* @brief Flag to enable SSSP. |
|
113 |
*/ |
|
114 |
#if !defined(OS_CFG_SSSP_ENABLE) |
|
115 |
#define AMIROOS_CFG_SSSP_ENABLE false |
|
116 |
#else |
|
117 |
#define AMIROOS_CFG_SSSP_ENABLE OS_CFG_SSSP_ENABLE |
|
118 |
#endif |
|
119 |
|
|
120 |
/** |
|
121 |
* @brief Flag to set the module as SSSP master. |
|
122 |
* @details There must be only one module with this flag set to true in a system. |
|
123 |
*/ |
|
124 |
#if !defined(OS_CFG_SSSP_MASTER) |
|
125 |
#define AMIROOS_CFG_SSSP_MASTER false |
|
126 |
#else |
|
127 |
#define AMIROOS_CFG_SSSP_MASTER OS_CFG_SSSP_MASTER |
|
128 |
#endif |
|
129 |
|
|
130 |
/** |
|
131 |
* @brief Flag to set the module to be the first in the stack. |
|
132 |
* @details There must be only one module with this flag set to true in a system. |
|
133 |
*/ |
|
134 |
#if !defined(OS_CFG_SSSP_STACK_START) |
|
135 |
#define AMIROOS_CFG_SSSP_STACK_START false |
|
136 |
#else |
|
137 |
#define AMIROOS_CFG_SSSP_STACK_START OS_CFG_SSSP_STACK_START |
|
138 |
#endif |
|
139 |
|
|
140 |
/** |
|
141 |
* @brief Flag to set the module to be the last in the stack. |
|
142 |
* @details There must be only one module with this flag set to true in a system. |
|
143 |
*/ |
|
144 |
#if !defined(OS_CFG_SSSP_STACK_END) |
|
145 |
#define AMIROOS_CFG_SSSP_STACK_END false |
|
146 |
#else |
|
147 |
#define AMIROOS_CFG_SSSP_STACK_END OS_CFG_SSSP_STACK_END |
|
148 |
#endif |
|
149 |
|
|
150 |
/** |
|
151 |
* @brief Delay time (in microseconds) how long a SSSP signal must be active. |
|
152 |
*/ |
|
153 |
#if !defined(OS_CFG_SSSP_SIGNALDELAY) |
|
154 |
#define AMIROOS_CFG_SSSP_SIGNALDELAY 1000 |
|
155 |
#else |
|
156 |
#define AMIROOS_CFG_SSSP_SIGNALDELAY OS_CFG_SSSP_SIGNALDELAY |
|
157 |
#endif |
|
158 |
|
|
159 |
/** |
|
160 |
* @brief Time boundary for robot wide clock synchronization in microseconds. |
|
161 |
* @details Whenever the SSSP S (snychronization) signal gets logically deactivated, |
|
162 |
* All modules need to align their local uptime to the nearest multiple of this value. |
|
163 |
*/ |
|
164 |
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD) |
|
165 |
#define AMIROOS_CFG_SSSP_SYSSYNCPERIOD 1000000 |
|
166 |
#else |
|
167 |
#define AMIROOS_CFG_SSSP_SYSSYNCPERIOD OS_CFG_SSSP_SYSSYNCPERIOD |
|
168 |
#endif |
|
169 |
|
|
170 |
/** @} */ |
|
171 |
|
|
172 |
/*===========================================================================*/ |
|
173 |
/** |
|
174 |
* @name System shell options |
|
175 |
* @{ |
|
176 |
*/ |
|
177 |
/*===========================================================================*/ |
|
178 |
|
|
179 |
/** |
|
180 |
* @brief Shell enable flag. |
|
181 |
*/ |
|
182 |
#if !defined(OS_CFG_SHELL_ENABLE) |
|
183 |
#define AMIROOS_CFG_SHELL_ENABLE true |
|
184 |
#else |
|
185 |
#define AMIROOS_CFG_SHELL_ENABLE OS_CFG_SHELL_ENABLE |
|
186 |
#endif |
|
187 |
|
|
188 |
/** |
|
189 |
* @brief Shell thread stack size. |
|
190 |
*/ |
|
191 |
#if !defined(OS_CFG_SHELL_STACKSIZE) |
|
192 |
#define AMIROOS_CFG_SHELL_STACKSIZE 1024 |
|
193 |
#else |
|
194 |
#define AMIROOS_CFG_SHELL_STACKSIZE OS_CFG_SHELL_STACKSIZE |
|
195 |
#endif |
|
196 |
|
|
197 |
/** |
|
198 |
* @brief Shell thread priority. |
|
199 |
* @details Thread priorities are specified as an integer value. |
|
200 |
* Predefined ranges are: |
|
201 |
* lowest ┌ THD_LOWPRIO_MIN |
|
202 |
* │ ... |
|
203 |
* â”” THD_LOWPRIO_MAX |
|
204 |
* ┌ THD_NORMALPRIO_MIN |
|
205 |
* │ ... |
|
206 |
* â”” THD_NORMALPRIO_MAX |
|
207 |
* ┌ THD_HIGHPRIO_MIN |
|
208 |
* │ ... |
|
209 |
* â”” THD_HIGHPRIO_MAX |
|
210 |
* ┌ THD_RTPRIO_MIN |
|
211 |
* │ ... |
|
212 |
* highest â”” THD_RTPRIO_MAX |
|
213 |
*/ |
|
214 |
#if !defined(OS_CFG_SHELL_THREADPRIO) |
|
215 |
#define AMIROOS_CFG_SHELL_THREADPRIO AOS_THD_NORMALPRIO_MIN |
|
216 |
#else |
|
217 |
#define AMIROOS_CFG_SHELL_THREADPRIO OS_CFG_SHELL_THREADPRIO |
|
218 |
#endif |
|
219 |
|
|
220 |
/** |
|
221 |
* @brief Shell maximum input line length. |
|
222 |
*/ |
|
223 |
#if !defined(OS_CFG_SHELL_LINEWIDTH) |
|
224 |
#define AMIROOS_CFG_SHELL_LINEWIDTH 64 |
|
225 |
#else |
|
226 |
#define AMIROOS_CFG_SHELL_LINEWIDTH OS_CFG_SHELL_LINEWIDTH |
|
227 |
#endif |
|
228 |
|
|
229 |
/** |
|
230 |
* @brief Shell maximum number of arguments. |
|
231 |
*/ |
|
232 |
#if !defined(OS_CFG_SHELL_MAXARGS) |
|
233 |
#define AMIROOS_CFG_SHELL_MAXARGS 4 |
|
234 |
#else |
|
235 |
#define AMIROOS_CFG_SHELL_MAXARGS OS_CFG_SHELL_MAXARGS |
|
236 |
#endif |
|
237 |
|
|
238 |
/** @} */ |
|
239 |
|
|
240 |
#endif /* _AOSCONF_H_ */ |
|
241 |
|
|
242 |
/** @} */ |
modules/NUCLEO-F103RB/board.c | ||
---|---|---|
1 |
/* |
|
2 |
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio |
|
3 |
|
|
4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
you may not use this file except in compliance with the License. |
|
6 |
You may obtain a copy of the License at |
|
7 |
|
|
8 |
http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
|
|
10 |
Unless required by applicable law or agreed to in writing, software |
|
11 |
distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
See the License for the specific language governing permissions and |
|
14 |
limitations under the License. |
|
15 |
*/ |
|
16 |
|
|
17 |
#include "hal.h" |
|
18 |
|
|
19 |
/** |
|
20 |
* @brief PAL setup. |
|
21 |
* @details Digital I/O ports static configuration as defined in @p board.h. |
|
22 |
* This variable is used by the HAL when initializing the PAL driver. |
|
23 |
*/ |
|
24 |
#if HAL_USE_PAL || defined(__DOXYGEN__) |
|
25 |
const PALConfig pal_default_config = |
|
26 |
{ |
|
27 |
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, |
|
28 |
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, |
|
29 |
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, |
|
30 |
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, |
|
31 |
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, |
|
32 |
}; |
|
33 |
#endif |
|
34 |
|
|
35 |
/* |
|
36 |
* Early initialization code. |
|
37 |
* This initialization must be performed just after stack setup and before |
|
38 |
* any other initialization. |
|
39 |
*/ |
|
40 |
void __early_init(void) { |
|
41 |
|
|
42 |
stm32_clock_init(); |
|
43 |
} |
|
44 |
|
|
45 |
/* |
|
46 |
* Board-specific initialization code. |
|
47 |
*/ |
|
48 |
void boardInit(void) { |
|
49 |
} |
modules/NUCLEO-F103RB/board.h | ||
---|---|---|
1 |
/* |
|
2 |
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio |
|
3 |
|
|
4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
you may not use this file except in compliance with the License. |
|
6 |
You may obtain a copy of the License at |
|
7 |
|
|
8 |
http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
|
|
10 |
Unless required by applicable law or agreed to in writing, software |
|
11 |
distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
See the License for the specific language governing permissions and |
|
14 |
limitations under the License. |
|
15 |
*/ |
|
16 |
|
|
17 |
#ifndef _BOARD_H_ |
|
18 |
#define _BOARD_H_ |
|
19 |
|
|
20 |
/* |
|
21 |
* Setup for the ST NUCLEO64-F103RB board. |
|
22 |
*/ |
|
23 |
|
|
24 |
/* |
|
25 |
* Board identifier. |
|
26 |
*/ |
|
27 |
#define BOARD_ST_NUCLEO64_F103RB |
|
28 |
#define BOARD_NAME "STMicroelectronics NUCLEO-F103RB" |
|
29 |
|
|
30 |
/* |
|
31 |
* Board frequencies. |
|
32 |
*/ |
|
33 |
#define STM32_LSECLK 0 |
|
34 |
|
|
35 |
#if defined(NUCLEO_EXTERNAL_OSCILLATOR) |
|
36 |
#define STM32_HSECLK 8000000 |
|
37 |
#define STM32_HSE_BYPASS |
|
38 |
|
|
39 |
#elif defined(NUCLEO_HSE_CRYSTAL) |
|
40 |
#define STM32_HSECLK 8000000 |
|
41 |
|
|
42 |
#else |
|
43 |
#define STM32_HSECLK 0 |
|
44 |
#endif |
|
45 |
|
|
46 |
/* |
|
47 |
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. |
|
48 |
*/ |
|
49 |
#define STM32F103xB |
|
50 |
|
|
51 |
/* |
|
52 |
* IO pins assignments. |
|
53 |
*/ |
|
54 |
#define GPIOA_ARD_A0 0U |
|
55 |
#define GPIOA_ADC1_IN0 0U |
|
56 |
#define GPIOA_ARD_A1 1U |
|
57 |
#define GPIOA_ADC1_IN1 1U |
|
58 |
#define GPIOA_ARD_D1 2U |
|
59 |
#define GPIOA_USART2_TX 2U |
|
60 |
#define GPIOA_ARD_D0 3U |
|
61 |
#define GPIOA_USART2_RX 3U |
|
62 |
#define GPIOA_ARD_A2 4U |
|
63 |
#define GPIOA_ADC1_IN4 4U |
|
64 |
#define GPIOA_LED_GREEN 5U |
|
65 |
#define GPIOA_ARD_D13 5U |
|
66 |
#define GPIOA_ARD_D12 6U |
|
67 |
#define GPIOA_ARD_D11 7U |
|
68 |
#define GPIOA_ARD_D7 8U |
|
69 |
#define GPIOA_ARD_D8 9U |
|
70 |
#define GPIOA_ARD_D2 10U |
|
71 |
#define GPIOA_PIN11 11U |
|
72 |
#define GPIOA_PIN12 12U |
|
73 |
#define GPIOA_SWDIO 13U |
|
74 |
#define GPIOA_SWCLK 14U |
|
75 |
#define GPIOA_PIN15 15U |
|
76 |
|
|
77 |
#define GPIOB_ARD_A3 0U |
|
78 |
#define GPIOB_ADC1_IN8 0U |
|
79 |
#define GPIOB_PIN1 1U |
|
80 |
#define GPIOB_PIN2 2U |
|
81 |
#define GPIOB_SWO 3U |
|
82 |
#define GPIOB_ARD_D3 3U |
|
83 |
#define GPIOB_ARD_D5 4U |
|
84 |
#define GPIOB_ARD_D4 5U |
|
85 |
#define GPIOB_ARD_D10 6U |
|
86 |
#define GPIOB_PIN7 7U |
|
87 |
#define GPIOB_ARD_D15 8U |
|
88 |
#define GPIOB_ARD_D14 9U |
|
89 |
#define GPIOB_ARD_D6 10U |
|
90 |
#define GPIOB_PIN11 11U |
|
91 |
#define GPIOB_PIN12 12U |
|
92 |
#define GPIOB_PIN13 13U |
|
93 |
#define GPIOB_PIN14 14U |
|
94 |
#define GPIOB_PIN15 15U |
|
95 |
|
|
96 |
#define GPIOC_ARD_A5 0U |
|
97 |
#define GPIOC_ADC1_IN11 0U |
|
98 |
#define GPIOC_ARD_A4 1U |
|
99 |
#define GPIOC_ADC1_IN10 1U |
|
100 |
#define GPIOC_PIN2 2U |
|
101 |
#define GPIOC_PIN3 3U |
|
102 |
#define GPIOC_PIN4 4U |
|
103 |
#define GPIOC_PIN5 5U |
|
104 |
#define GPIOC_PIN6 6U |
|
105 |
#define GPIOC_ARD_D9 7U |
|
106 |
#define GPIOC_PIN8 8U |
|
107 |
#define GPIOC_PIN9 9U |
|
108 |
#define GPIOC_PIN10 10U |
|
109 |
#define GPIOC_PIN11 11U |
|
110 |
#define GPIOC_PIN12 12U |
|
111 |
#define GPIOC_BUTTON 13U |
|
112 |
#define GPIOC_PIN14 14U |
|
113 |
#define GPIOC_PIN15 15U |
|
114 |
|
|
115 |
#define GPIOD_OSC_IN 0U |
|
116 |
#define GPIOD_PIN0 0U |
|
117 |
#define GPIOD_OSC_OUT 1U |
|
118 |
#define GPIOD_PIN1 1U |
|
119 |
#define GPIOD_PIN2 2U |
|
120 |
#define GPIOD_PIN3 3U |
|
121 |
#define GPIOD_PIN4 4U |
|
122 |
#define GPIOD_PIN5 5U |
|
123 |
#define GPIOD_PIN6 6U |
|
124 |
#define GPIOD_PIN7 7U |
|
125 |
#define GPIOD_PIN8 8U |
|
126 |
#define GPIOD_PIN9 9U |
|
127 |
#define GPIOD_PIN10 10U |
|
128 |
#define GPIOD_PIN11 11U |
|
129 |
#define GPIOD_PIN12 12U |
|
130 |
#define GPIOD_PIN13 13U |
|
131 |
#define GPIOD_PIN14 14U |
|
132 |
#define GPIOD_PIN15 15U |
|
133 |
|
|
134 |
#define GPIOE_PIN0 0U |
|
135 |
#define GPIOE_PIN1 1U |
|
136 |
#define GPIOE_PIN2 2U |
|
137 |
#define GPIOE_PIN3 3U |
|
138 |
#define GPIOE_PIN4 4U |
|
139 |
#define GPIOE_PIN5 5U |
|
140 |
#define GPIOE_PIN6 6U |
|
141 |
#define GPIOE_PIN7 7U |
|
142 |
#define GPIOE_PIN8 8U |
|
143 |
#define GPIOE_PIN9 9U |
|
144 |
#define GPIOE_PIN10 10U |
|
145 |
#define GPIOE_PIN11 11U |
|
146 |
#define GPIOE_PIN12 12U |
|
147 |
#define GPIOE_PIN13 13U |
|
148 |
#define GPIOE_PIN14 14U |
|
149 |
#define GPIOE_PIN15 15U |
|
150 |
|
|
151 |
#define GPIOF_PIN0 0U |
|
152 |
#define GPIOF_PIN1 1U |
|
153 |
#define GPIOF_PIN2 2U |
|
154 |
#define GPIOF_PIN3 3U |
|
155 |
#define GPIOF_PIN4 4U |
|
156 |
#define GPIOF_PIN5 5U |
|
157 |
#define GPIOF_PIN6 6U |
|
158 |
#define GPIOF_PIN7 7U |
|
159 |
#define GPIOF_PIN8 8U |
|
160 |
#define GPIOF_PIN9 9U |
|
161 |
#define GPIOF_PIN10 10U |
|
162 |
#define GPIOF_PIN11 11U |
|
163 |
#define GPIOF_PIN12 12U |
|
164 |
#define GPIOF_PIN13 13U |
|
165 |
#define GPIOF_PIN14 14U |
|
166 |
#define GPIOF_PIN15 15U |
|
167 |
/* |
|
168 |
* I/O ports initial setup, this configuration is established soon after reset |
|
169 |
* in the initialization code. |
|
170 |
* |
|
171 |
* The digits have the following meaning: |
|
172 |
* 0 - Analog input. |
|
173 |
* 1 - Push Pull output 10MHz. |
|
174 |
* 2 - Push Pull output 2MHz. |
|
175 |
* 3 - Push Pull output 50MHz. |
|
176 |
* 4 - Digital input. |
|
177 |
* 5 - Open Drain output 10MHz. |
|
178 |
* 6 - Open Drain output 2MHz. |
|
179 |
* 7 - Open Drain output 50MHz. |
|
180 |
* 8 - Digital input with PullUp or PullDown resistor depending on ODR. |
|
181 |
* 9 - Alternate Push Pull output 10MHz. |
|
182 |
* A - Alternate Push Pull output 2MHz. |
|
183 |
* B - Alternate Push Pull output 50MHz. |
|
184 |
* C - Reserved. |
|
185 |
* D - Alternate Open Drain output 10MHz. |
|
186 |
* E - Alternate Open Drain output 2MHz. |
|
187 |
* F - Alternate Open Drain output 50MHz. |
|
188 |
* Please refer to the STM32 Reference Manual for details. |
|
189 |
*/ |
|
190 |
|
|
191 |
/* |
|
192 |
* Port A setup. |
|
193 |
* Everything input with pull-up except: |
|
194 |
* PA2 - Alternate output (GPIOA_ARD_D1, GPIOA_USART2_TX). |
|
195 |
* PA3 - Normal input (GPIOA_ARD_D0, GPIOA_USART2_RX). |
|
196 |
* PA5 - Push Pull output (GPIOA_LED_GREEN). |
|
197 |
* PA13 - Pull-up input (GPIOA_SWDIO). |
|
198 |
* PA14 - Pull-down input (GPIOA_SWCLK). |
|
199 |
*/ |
|
200 |
#define VAL_GPIOACRL 0x88384B88 /* PA7...PA0 */ |
|
201 |
#define VAL_GPIOACRH 0x88888888 /* PA15...PA8 */ |
|
202 |
#define VAL_GPIOAODR 0xFFFFBFDF |
|
203 |
|
|
204 |
/* |
|
205 |
* Port B setup. |
|
206 |
* Everything input with pull-up except: |
|
207 |
* PB3 - Pull-up input (GPIOA_SWO). |
|
208 |
*/ |
|
209 |
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ |
|
210 |
#define VAL_GPIOBCRH 0x88888888 /* PB15...PB8 */ |
|
211 |
#define VAL_GPIOBODR 0xFFFFFFFF |
|
212 |
|
|
213 |
/* |
|
214 |
* Port C setup. |
|
215 |
* Everything input with pull-up except: |
|
216 |
* PC13 - Normal input (GPIOC_BUTTON). |
|
217 |
*/ |
|
218 |
#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ |
|
219 |
#define VAL_GPIOCCRH 0x88488888 /* PC15...PC8 */ |
|
220 |
#define VAL_GPIOCODR 0xFFFFFFFF |
|
221 |
|
|
222 |
/* |
|
223 |
* Port D setup. |
|
224 |
* Everything input with pull-up except: |
|
225 |
* PD0 - Normal input (GPIOD_OSC_IN). |
|
226 |
* PD1 - Normal input (GPIOD_OSC_OUT). |
|
227 |
*/ |
|
228 |
#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ |
|
229 |
#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ |
|
230 |
#define VAL_GPIODODR 0xFFFFFFFF |
|
231 |
|
|
232 |
/* |
|
233 |
* Port E setup. |
|
234 |
* Everything input with pull-up except: |
|
235 |
*/ |
|
236 |
#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ |
|
237 |
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ |
|
238 |
#define VAL_GPIOEODR 0xFFFFFFFF |
|
239 |
|
|
240 |
/* |
|
241 |
* USB bus activation macro, required by the USB driver. |
|
242 |
*/ |
|
243 |
#define usb_lld_connect_bus(usbp) |
|
244 |
|
|
245 |
/* |
|
246 |
* USB bus de-activation macro, required by the USB driver. |
|
247 |
*/ |
|
248 |
#define usb_lld_disconnect_bus(usbp) |
|
249 |
|
|
250 |
#if !defined(_FROM_ASM_) |
|
251 |
#ifdef __cplusplus |
|
252 |
extern "C" { |
|
253 |
#endif |
|
254 |
void boardInit(void); |
|
255 |
#ifdef __cplusplus |
|
256 |
} |
|
257 |
#endif |
|
258 |
#endif /* _FROM_ASM_ */ |
|
259 |
|
|
260 |
#endif /* _BOARD_H_ */ |
modules/NUCLEO-F103RB/chconf.h | ||
---|---|---|
1 |
/* |
|
2 |
* AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
3 |
* Copyright (C) 2016..2019 Thomas Schöpping et al. |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, either version 3 of the License, or |
|
8 |
* (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
|
19 |
/** |
|
20 |
* @file |
|
21 |
* @brief ChibiOS Configuration file for the NUCLEO-F103RB module. |
|
22 |
* @details Contains the application specific kernel settings. |
|
23 |
* |
|
24 |
* @addtogroup NUCLEO-F103RB_ch_config |
|
25 |
* @details Kernel related settings and hooks. |
|
26 |
* @{ |
|
27 |
*/ |
|
28 |
|
|
29 |
#ifndef CHCONF_H |
|
30 |
#define CHCONF_H |
|
31 |
|
|
32 |
#define _CHIBIOS_RT_CONF_ |
|
33 |
#define _CHIBIOS_RT_CONF_VER_5_1_ |
|
34 |
|
|
35 |
#include <aosconf.h> |
|
36 |
|
|
37 |
/*===========================================================================*/ |
|
38 |
/** |
|
39 |
* @name System timers settings |
|
40 |
* @{ |
|
41 |
*/ |
|
42 |
/*===========================================================================*/ |
|
43 |
|
|
44 |
/** |
|
45 |
* @brief System time counter resolution. |
|
46 |
* @note Allowed values are 16 or 32 bits. |
|
47 |
*/ |
|
48 |
#if !defined(CH_CFG_ST_RESOLUTION) |
|
49 |
#define CH_CFG_ST_RESOLUTION 16 |
|
50 |
#endif |
|
51 |
|
|
52 |
// more common definition in aos_chconf.h |
|
53 |
|
|
54 |
/** @} */ |
|
55 |
|
|
56 |
/*===========================================================================*/ |
|
57 |
/** |
|
58 |
* @name Kernel parameters and options |
|
59 |
* @{ |
|
60 |
*/ |
|
61 |
/*===========================================================================*/ |
|
62 |
|
|
63 |
// common definitions in aos_chconf.h |
|
64 |
|
|
65 |
/** @} */ |
|
66 |
|
|
67 |
/*===========================================================================*/ |
|
68 |
/** |
|
69 |
* @name Performance options |
|
70 |
* @{ |
|
71 |
*/ |
|
72 |
/*===========================================================================*/ |
|
73 |
|
|
74 |
// common definitions in aos_chconf.h |
|
75 |
|
|
76 |
/** @} */ |
|
77 |
|
|
78 |
/*===========================================================================*/ |
|
79 |
/** |
|
80 |
* @name Subsystem options |
|
81 |
* @{ |
|
82 |
*/ |
|
83 |
/*===========================================================================*/ |
|
84 |
|
|
85 |
// common definitions in aos_chconf.h |
|
86 |
|
|
87 |
/** @} */ |
|
88 |
|
|
89 |
/*===========================================================================*/ |
|
90 |
/** |
|
91 |
* @name Objects factory options |
|
92 |
* @{ |
|
93 |
*/ |
|
94 |
/*===========================================================================*/ |
|
95 |
|
|
96 |
// common definitions in aos_chconf.h |
|
97 |
|
|
98 |
/** @} */ |
|
99 |
|
|
100 |
/*===========================================================================*/ |
|
101 |
/** |
|
102 |
* @name Debug options |
|
103 |
* @{ |
|
104 |
*/ |
|
105 |
/*===========================================================================*/ |
|
106 |
|
|
107 |
// common definitions in aos_chconf.h |
|
108 |
|
|
109 |
/** @} */ |
|
110 |
|
|
111 |
/*===========================================================================*/ |
|
112 |
/** |
|
113 |
* @name Kernel hooks |
|
114 |
* @{ |
|
115 |
*/ |
|
116 |
/*===========================================================================*/ |
|
117 |
|
|
118 |
// common definitions in aos_chconf.h |
|
119 |
|
|
120 |
/** @} */ |
|
121 |
|
|
122 |
/*===========================================================================*/ |
|
123 |
/** |
|
124 |
* @name Port-specific settings (override port settings defaulted in chcore.h). |
|
125 |
* @{ |
|
126 |
*/ |
|
127 |
/*===========================================================================*/ |
|
128 |
|
|
129 |
/** @} */ |
|
130 |
|
|
131 |
/*===========================================================================*/ |
|
132 |
/** |
|
133 |
* @name other |
|
134 |
* @{ |
|
135 |
*/ |
|
136 |
/*===========================================================================*/ |
|
137 |
|
|
138 |
// common definitions in aos_chconf.h |
|
139 |
|
|
140 |
/** @} */ |
|
141 |
|
|
142 |
#include <aos_chconf.h> |
|
143 |
|
|
144 |
#endif /* CHCONF_H */ |
|
145 |
|
|
146 |
/** @} */ |
modules/NUCLEO-F103RB/halconf.h | ||
---|---|---|
1 |
/* |
|
2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform. |
|
3 |
Copyright (C) 2016..2019 Thomas Schöpping et al. |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU General Public License as published by |
|
7 |
the Free Software Foundation, either version 3 of the License, or |
|
8 |
(at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU General Public License |
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
|
|
19 |
/** |
|
20 |
* @file |
|
21 |
* @brief HAL configuration header for the NUCLEO-F103RB module. |
|
22 |
* @details HAL configuration file, this file allows to enable or disable the |
|
23 |
* various device drivers from your application. You may also use |
|
24 |
* this file in order to override the device drivers default settings. |
|
25 |
* |
|
26 |
* @addtogroup NUCLEO-F103RB_HAL_CONF |
|
27 |
* @{ |
|
28 |
*/ |
|
29 |
|
|
30 |
#ifndef _HALCONF_H_ |
|
31 |
#define _HALCONF_H_ |
|
32 |
|
|
33 |
#define _CHIBIOS_HAL_CONF_ |
|
34 |
#define _CHIBIOS_HAL_CONF_VER_6_0_ |
|
35 |
|
|
36 |
#include "mcuconf.h" |
|
37 |
|
|
38 |
/** |
|
39 |
* @brief Enables the PAL subsystem. |
|
40 |
*/ |
|
41 |
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) |
|
42 |
#define HAL_USE_PAL TRUE |
|
43 |
#endif |
|
44 |
|
|
45 |
/** |
|
46 |
* @brief Enables the ADC subsystem. |
|
47 |
*/ |
|
48 |
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) |
|
49 |
#define HAL_USE_ADC FALSE |
|
50 |
#endif |
|
51 |
|
|
52 |
/** |
|
53 |
* @brief Enables the CAN subsystem. |
|
54 |
*/ |
|
55 |
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) |
|
56 |
#define HAL_USE_CAN FALSE |
|
57 |
#endif |
|
58 |
|
|
59 |
/** |
|
60 |
* @brief Enables the cryptographic subsystem. |
|
61 |
*/ |
|
62 |
#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__) |
|
63 |
#define HAL_USE_CRY FALSE |
|
64 |
#endif |
|
65 |
|
|
66 |
/** |
|
67 |
* @brief Enables the DAC subsystem. |
|
68 |
*/ |
|
69 |
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) |
|
70 |
#define HAL_USE_DAC FALSE |
|
71 |
#endif |
|
72 |
|
|
73 |
/** |
|
74 |
* @brief Enables the EXT subsystem. |
|
75 |
*/ |
|
76 |
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) |
|
77 |
#define HAL_USE_EXT FALSE |
|
78 |
#endif |
|
79 |
|
|
80 |
/** |
|
81 |
* @brief Enables the GPT subsystem. |
|
82 |
*/ |
|
83 |
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) |
|
84 |
#define HAL_USE_GPT FALSE |
|
85 |
#endif |
|
86 |
|
|
87 |
/** |
|
88 |
* @brief Enables the I2C subsystem. |
|
89 |
*/ |
|
90 |
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) |
|
91 |
#define HAL_USE_I2C FALSE |
|
92 |
#endif |
|
93 |
|
|
94 |
/** |
|
95 |
* @brief Enables the I2S subsystem. |
|
96 |
*/ |
|
97 |
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) |
|
98 |
#define HAL_USE_I2S FALSE |
|
99 |
#endif |
|
100 |
|
|
101 |
/** |
|
102 |
* @brief Enables the ICU subsystem. |
|
103 |
*/ |
|
104 |
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) |
|
105 |
#define HAL_USE_ICU FALSE |
|
106 |
#endif |
|
107 |
|
|
108 |
/** |
|
109 |
* @brief Enables the MAC subsystem. |
|
110 |
*/ |
|
111 |
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) |
|
112 |
#define HAL_USE_MAC FALSE |
|
113 |
#endif |
|
114 |
|
|
115 |
/** |
|
116 |
* @brief Enables the MMC_SPI subsystem. |
|
117 |
*/ |
|
118 |
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) |
|
119 |
#define HAL_USE_MMC_SPI FALSE |
|
120 |
#endif |
|
121 |
|
|
122 |
/** |
|
123 |
* @brief Enables the PWM subsystem. |
|
124 |
*/ |
|
125 |
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) |
|
126 |
#define HAL_USE_PWM FALSE |
|
127 |
#endif |
|
128 |
|
|
129 |
/** |
|
130 |
* @brief Enables the QEI subsystem. |
|
131 |
*/ |
|
132 |
#if !defined(HAL_USE_QEI) || defined(__DOXYGEN__) |
|
133 |
#define HAL_USE_QEI FALSE |
|
134 |
#endif |
|
135 |
|
|
136 |
/** |
|
137 |
* @brief Enables the QSPI subsystem. |
|
138 |
*/ |
|
139 |
#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) |
|
140 |
#define HAL_USE_QSPI FALSE |
|
141 |
#endif |
|
142 |
|
|
143 |
/** |
|
144 |
* @brief Enables the RTC subsystem. |
|
145 |
*/ |
|
146 |
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) |
|
147 |
#define HAL_USE_RTC TRUE |
|
148 |
#endif |
|
149 |
|
|
150 |
/** |
|
151 |
* @brief Enables the SDC subsystem. |
|
152 |
*/ |
|
153 |
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) |
|
154 |
#define HAL_USE_SDC FALSE |
|
155 |
#endif |
|
156 |
|
|
157 |
/** |
|
158 |
* @brief Enables the SERIAL subsystem. |
|
159 |
*/ |
|
160 |
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) |
|
161 |
#define HAL_USE_SERIAL TRUE |
|
162 |
#endif |
|
163 |
|
|
164 |
/** |
|
165 |
* @brief Enables the SERIAL over USB subsystem. |
|
166 |
*/ |
|
167 |
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) |
|
168 |
#define HAL_USE_SERIAL_USB FALSE |
|
169 |
#endif |
|
170 |
|
|
171 |
/** |
|
172 |
* @brief Enables the SPI subsystem. |
|
173 |
*/ |
|
174 |
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) |
|
175 |
#define HAL_USE_SPI FALSE |
|
176 |
#endif |
|
177 |
|
|
178 |
/** |
|
179 |
* @brief Enables the UART subsystem. |
|
180 |
*/ |
|
181 |
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) |
|
182 |
#define HAL_USE_UART FALSE |
|
183 |
#endif |
|
184 |
|
|
185 |
/** |
|
186 |
* @brief Enables the USB subsystem. |
|
187 |
*/ |
|
188 |
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) |
|
189 |
#define HAL_USE_USB FALSE |
|
190 |
#endif |
|
191 |
|
|
192 |
/** |
|
193 |
* @brief Enables the WDG subsystem. |
|
194 |
*/ |
|
195 |
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) |
|
196 |
#define HAL_USE_WDG FALSE |
|
197 |
#endif |
|
198 |
|
|
199 |
/*===========================================================================*/ |
|
200 |
/* PAL driver related settings. */ |
|
201 |
/*===========================================================================*/ |
|
202 |
|
|
203 |
/** |
|
204 |
* @brief Enables synchronous APIs. |
|
205 |
* @note Disabling this option saves both code and data space. |
|
206 |
*/ |
|
207 |
#if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__) |
|
208 |
#define PAL_USE_CALLBACKS TRUE |
|
209 |
#endif |
|
210 |
|
|
211 |
/** |
|
212 |
* @brief Enables synchronous APIs. |
|
213 |
* @note Disabling this option saves both code and data space. |
|
214 |
*/ |
|
215 |
#if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__) |
|
216 |
#define PAL_USE_WAIT FALSE |
|
217 |
#endif |
|
218 |
|
|
219 |
/*===========================================================================*/ |
|
220 |
/* ADC driver related settings. */ |
|
221 |
/*===========================================================================*/ |
|
222 |
|
|
223 |
/** |
|
224 |
* @brief Enables synchronous APIs. |
|
225 |
* @note Disabling this option saves both code and data space. |
|
226 |
*/ |
|
227 |
#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) |
|
228 |
#define ADC_USE_WAIT TRUE |
|
229 |
#endif |
|
230 |
|
|
231 |
/** |
|
232 |
* @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. |
|
233 |
* @note Disabling this option saves both code and data space. |
|
234 |
*/ |
|
235 |
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) |
|
236 |
#define ADC_USE_MUTUAL_EXCLUSION TRUE |
|
237 |
#endif |
|
238 |
|
|
239 |
/*===========================================================================*/ |
|
240 |
/* CAN driver related settings. */ |
|
241 |
/*===========================================================================*/ |
|
242 |
|
|
243 |
/** |
|
244 |
* @brief Sleep mode related APIs inclusion switch. |
|
245 |
*/ |
|
246 |
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) |
|
247 |
#define CAN_USE_SLEEP_MODE TRUE |
|
248 |
#endif |
|
249 |
|
|
250 |
/** |
|
251 |
* @brief Enforces the driver to use direct callbacks rather than OSAL events. |
|
252 |
*/ |
|
253 |
#if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__) |
|
254 |
#define CAN_ENFORCE_USE_CALLBACKS FALSE |
|
255 |
#endif |
|
256 |
|
|
257 |
/*===========================================================================*/ |
|
258 |
/* CRY driver related settings. */ |
|
259 |
/*===========================================================================*/ |
|
260 |
|
|
261 |
/** |
|
262 |
* @brief Enables the SW fall-back of the cryptographic driver. |
|
263 |
* @details When enabled, this option, activates a fall-back software |
|
264 |
* implementation for algorithms not supported by the underlying |
|
265 |
* hardware. |
|
266 |
* @note Fall-back implementations may not be present for all algorithms. |
|
267 |
*/ |
|
268 |
#if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__) |
|
269 |
#define HAL_CRY_USE_FALLBACK FALSE |
|
270 |
#endif |
|
271 |
|
|
272 |
/** |
|
273 |
* @brief Makes the driver forcibly use the fall-back implementations. |
|
274 |
*/ |
|
275 |
#if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__) |
|
276 |
#define HAL_CRY_ENFORCE_FALLBACK FALSE |
|
277 |
#endif |
|
278 |
|
|
279 |
/*===========================================================================*/ |
|
280 |
/* DAC driver related settings. */ |
|
281 |
/*===========================================================================*/ |
|
282 |
|
|
283 |
/** |
|
284 |
* @brief Enables synchronous APIs. |
|
285 |
* @note Disabling this option saves both code and data space. |
|
286 |
*/ |
|
287 |
#if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__) |
|
288 |
#define DAC_USE_WAIT TRUE |
|
289 |
#endif |
|
290 |
|
|
291 |
/** |
|
292 |
* @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs. |
|
293 |
* @note Disabling this option saves both code and data space. |
|
294 |
*/ |
|
295 |
#if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) |
|
296 |
#define DAC_USE_MUTUAL_EXCLUSION TRUE |
|
297 |
#endif |
|
298 |
|
|
299 |
/*===========================================================================*/ |
|
300 |
/* I2C driver related settings. */ |
|
301 |
/*===========================================================================*/ |
Also available in: Unified diff