From 2e5a3b195d4c363dd756b93b3f9eff8964b07775 Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Sat, 8 Jul 2017 07:48:51 +0000 Subject: Fixed Bug #857 git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10305 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/STM32/RT-STM32L053-DISCOVERY/Makefile | 4 ++-- ...TM32L053-DISCOVERY (OpenOCD, Flash and Run).launch | 2 +- demos/STM32/RT-STM32L053-DISCOVERY/halconf.h | 6 +++--- demos/STM32/RT-STM32L053-DISCOVERY/main.c | 19 +++---------------- demos/STM32/RT-STM32L053-DISCOVERY/mcuconf.h | 5 ++--- 5 files changed, 11 insertions(+), 25 deletions(-) (limited to 'demos') diff --git a/demos/STM32/RT-STM32L053-DISCOVERY/Makefile b/demos/STM32/RT-STM32L053-DISCOVERY/Makefile index 284b65007..d4faea106 100644 --- a/demos/STM32/RT-STM32L053-DISCOVERY/Makefile +++ b/demos/STM32/RT-STM32L053-DISCOVERY/Makefile @@ -5,7 +5,7 @@ # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 + USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). @@ -113,7 +113,7 @@ CSRC = $(STARTUPSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ $(TESTSRC) \ - usbcfg.c main.c + main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. diff --git a/demos/STM32/RT-STM32L053-DISCOVERY/debug/RT-STM32L053-DISCOVERY (OpenOCD, Flash and Run).launch b/demos/STM32/RT-STM32L053-DISCOVERY/debug/RT-STM32L053-DISCOVERY (OpenOCD, Flash and Run).launch index db4138630..dd74e27f1 100644 --- a/demos/STM32/RT-STM32L053-DISCOVERY/debug/RT-STM32L053-DISCOVERY (OpenOCD, Flash and Run).launch +++ b/demos/STM32/RT-STM32L053-DISCOVERY/debug/RT-STM32L053-DISCOVERY (OpenOCD, Flash and Run).launch @@ -33,7 +33,7 @@ - + diff --git a/demos/STM32/RT-STM32L053-DISCOVERY/halconf.h b/demos/STM32/RT-STM32L053-DISCOVERY/halconf.h index 63c29ccef..82602b403 100644 --- a/demos/STM32/RT-STM32L053-DISCOVERY/halconf.h +++ b/demos/STM32/RT-STM32L053-DISCOVERY/halconf.h @@ -139,14 +139,14 @@ * @brief Enables the SERIAL subsystem. */ #if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE +#define HAL_USE_SERIAL TRUE #endif /** * @brief Enables the SERIAL over USB subsystem. */ #if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB TRUE +#define HAL_USE_SERIAL_USB FALSE #endif /** @@ -167,7 +167,7 @@ * @brief Enables the USB subsystem. */ #if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE +#define HAL_USE_USB FALSE #endif /** diff --git a/demos/STM32/RT-STM32L053-DISCOVERY/main.c b/demos/STM32/RT-STM32L053-DISCOVERY/main.c index 80498c166..ffa768f53 100644 --- a/demos/STM32/RT-STM32L053-DISCOVERY/main.c +++ b/demos/STM32/RT-STM32L053-DISCOVERY/main.c @@ -16,8 +16,6 @@ #include "ch.h" #include "hal.h" -#include "usbcfg.h" - #include "ch_test.h" /* @@ -52,21 +50,10 @@ int main(void) { chSysInit(); /* - * Initializes a serial-over-USB CDC driver. + * Activates the serial driver 1 using the driver default configuration. */ - sduObjectInit(&SDU1); - sduStart(&SDU1, &serusbcfg); + sdStart(&SD1, NULL); - /* - * Activates the USB driver and then the USB bus pull-up on D+. - * Note, a delay is inserted in order to not have to disconnect the cable - * after a reset. - */ - usbDisconnectBus(serusbcfg.usbp); - chThdSleepMilliseconds(1000); - usbStart(serusbcfg.usbp, &usbcfg); - usbConnectBus(serusbcfg.usbp); - chThdSleepMilliseconds(1000); /* * Creates the blinker thread. */ @@ -78,7 +65,7 @@ int main(void) { */ while (true) { if (palReadLine(LINE_BUTTON)) - test_execute((BaseSequentialStream *)&SDU1); + test_execute((BaseSequentialStream *)&SD1); chThdSleepMilliseconds(500); } } diff --git a/demos/STM32/RT-STM32L053-DISCOVERY/mcuconf.h b/demos/STM32/RT-STM32L053-DISCOVERY/mcuconf.h index f8cdcecc2..a517c7872 100644 --- a/demos/STM32/RT-STM32L053-DISCOVERY/mcuconf.h +++ b/demos/STM32/RT-STM32L053-DISCOVERY/mcuconf.h @@ -126,7 +126,7 @@ /* * SERIAL driver system settings. */ -#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART1 TRUE #define STM32_SERIAL_USE_USART2 FALSE #define STM32_SERIAL_USE_LPUART1 FALSE #define STM32_SERIAL_USART1_PRIORITY 3 @@ -172,9 +172,8 @@ /* * USB driver system settings. */ -#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_USE_USB1 FALSE #define STM32_USB_LOW_POWER_ON_SUSPEND FALSE -#define STM32_USB_USB1_HP_IRQ_PRIORITY 2 #define STM32_USB_USB1_LP_IRQ_PRIORITY 3 /* -- cgit v1.2.3