diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-22 16:01:28 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-22 16:01:28 +0000 |
commit | dd525d05dbf985837da4616ee52ffb1b732df607 (patch) | |
tree | 6e05b97b7c9dde43655f382ecc096ce5abcdb4a5 /testhal/STM32 | |
parent | 43972ad3c82a8f2b0c78b1997d81da162d958ce5 (diff) | |
download | ChibiOS-dd525d05dbf985837da4616ee52ffb1b732df607.tar.gz ChibiOS-dd525d05dbf985837da4616ee52ffb1b732df607.tar.bz2 ChibiOS-dd525d05dbf985837da4616ee52ffb1b732df607.zip |
Updated LSM6DS0 driver and related STM32 Nucleo F401RE demo
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9770 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32')
6 files changed, 10 insertions, 64 deletions
diff --git a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/Makefile b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/Makefile index 9882b4a32..31b3ede4c 100644 --- a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/Makefile +++ b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/Makefile @@ -203,7 +203,7 @@ CPPWARN = -Wall -Wextra -Wundef UDEFS = -DCHPRINTF_USE_FLOAT=1 -DSHELL_CMD_TEST_ENABLED=0 \
-DLSM6DS0_USE_ADVANCED=0 -DLSM6DS0_GYRO_USE_ADVANCED=0 \
-DLSM6DS0_ACC_USE_ADVANCED=0
-
+
# Define ASM defines here
UADEFS =
diff --git a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/debug/STM32F4xx-SPI-L3GD20 (OpenOCD, Flash and Run).launch b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/debug/STM32F4xx-SPI-L3GD20 (OpenOCD, Flash and Run).launch deleted file mode 100644 index 21c597ad1..000000000 --- a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/debug/STM32F4xx-SPI-L3GD20 (OpenOCD, Flash and Run).launch +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
-<stringAttribute key="bad_container_name" value="\STM32F4xx-SPI-L3GD20\debug"/>
-<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="1"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="true"/>
-<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="set remotetimeout 20 monitor reset init monitor sleep 50 "/>
-<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"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
-<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3333"/>
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
-<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="main"/>
-<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"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
-<stringAttribute key="org.eclipse.cdt.debug.mi.core.DEBUG_NAME" value="arm-none-eabi-gdb"/>
-<stringAttribute key="org.eclipse.cdt.debug.mi.core.commandFactory" value="Standard"/>
-<stringAttribute key="org.eclipse.cdt.debug.mi.core.protocol" value="mi"/>
-<booleanAttribute key="org.eclipse.cdt.debug.mi.core.verboseMode" value="false"/>
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
-<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="<?xml version="1.0" encoding="UTF-8" standalone="no"?><contentList><content id="null-read_raw-(format)" val="1"/></contentList>"/>
-<stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <globalVariableList/> "/>
-<stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList/> "/>
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="./build/ch.elf"/>
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="STM32F4xx-SPI-L3GD20"/>
-<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="0.603687198"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/STM32F4xx-SPI-L3GD20"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="4"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
-</listAttribute>
-</launchConfiguration>
diff --git a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/halconf.h b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/halconf.h index 82602b403..07b0143bd 100644 --- a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/halconf.h +++ b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/halconf.h @@ -76,7 +76,7 @@ * @brief Enables the I2C subsystem.
*/
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
-#define HAL_USE_I2C FALSE
+#define HAL_USE_I2C TRUE
#endif
/**
diff --git a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/main.c b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/main.c index fdf0199f4..196e2d8d7 100644 --- a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/main.c +++ b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/main.c @@ -38,11 +38,9 @@ static char axisID[LSM6DS0_ACC_NUMBER_OF_AXES] = {'X', 'Y', 'Z'}; static uint32_t i;
static const I2CConfig i2ccfg = {
- STM32_TIMINGR_PRESC(15U) |
- STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) |
- STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U),
- 0,
- 0
+ OPMODE_I2C,
+ 400000,
+ FAST_DUTY_CYCLE_2,
};
static const LSM6DS0AccConfig lsm6ds0acccfg = {
@@ -301,8 +299,8 @@ int main(void) { halInit();
chSysInit();
- palSetLineMode(LINE_ARD_D14, PAL_MODE_ALTERNATE(4) | PAL_STM32_OSPEED_HIGH);
- palSetLineMode(LINE_ARD_D15, PAL_MODE_ALTERNATE(4) | PAL_STM32_OSPEED_HIGH);
+ palSetLineMode(LINE_ARD_D14, PAL_MODE_ALTERNATE(4));
+ palSetLineMode(LINE_ARD_D15, PAL_MODE_ALTERNATE(4));
/*
* Activates the serial driver 2 using the driver default configuration.
diff --git a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/mcuconf.h b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/mcuconf.h index 2c62a87f2..166f04112 100644 --- a/testhal/STM32/STM32F4xx/I2C-LSM6DS0/mcuconf.h +++ b/testhal/STM32/STM32F4xx/I2C-LSM6DS0/mcuconf.h @@ -111,7 +111,7 @@ /*
* I2C driver system settings.
*/
-#define STM32_I2C_USE_I2C1 FALSE
+#define STM32_I2C_USE_I2C1 TRUE
#define STM32_I2C_USE_I2C2 FALSE
#define STM32_I2C_USE_I2C3 FALSE
#define STM32_I2C_BUSY_TIMEOUT 50
diff --git a/testhal/STM32/STM32L4xx/I2C-LSM6DS0/Makefile b/testhal/STM32/STM32L4xx/I2C-LSM6DS0/Makefile index bdfbb5c70..0a74c53b4 100644 --- a/testhal/STM32/STM32L4xx/I2C-LSM6DS0/Makefile +++ b/testhal/STM32/STM32L4xx/I2C-LSM6DS0/Makefile @@ -5,7 +5,7 @@ # Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
+ USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
@@ -203,7 +203,7 @@ CPPWARN = -Wall -Wextra -Wundef UDEFS = -DCHPRINTF_USE_FLOAT=1 -DSHELL_CMD_TEST_ENABLED=0 \
-DLSM6DS0_USE_ADVANCED=0 -DLSM6DS0_GYRO_USE_ADVANCED=0 \
-DLSM6DS0_ACC_USE_ADVANCED=0
-
+
# Define ASM defines here
UADEFS =
|