aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-09-04 08:04:11 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-09-04 08:04:11 +0000
commitc1f3c5cb218e185c805f0b7a50a8ad81aa6e2de0 (patch)
treee288f9ab662f7b42bf2f56f146b389a402a393ee /testhal/STM32
parentfc3f6b32fcbfda905ed747126bd79cb15d1c188e (diff)
downloadChibiOS-c1f3c5cb218e185c805f0b7a50a8ad81aa6e2de0.tar.gz
ChibiOS-c1f3c5cb218e185c805f0b7a50a8ad81aa6e2de0.tar.bz2
ChibiOS-c1f3c5cb218e185c805f0b7a50a8ad81aa6e2de0.zip
Fixed bug #377.
Tested ULPI support. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8274 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32')
-rw-r--r--testhal/STM32/STM32F7xx/USB_CDC/main.c12
-rw-r--r--testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h2
-rw-r--r--testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c30
3 files changed, 22 insertions, 22 deletions
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/main.c b/testhal/STM32/STM32F7xx/USB_CDC/main.c
index b4e41c396..92894ee5a 100644
--- a/testhal/STM32/STM32F7xx/USB_CDC/main.c
+++ b/testhal/STM32/STM32F7xx/USB_CDC/main.c
@@ -27,7 +27,7 @@
#include "usbcfg.h"
/* Virtual serial port over USB.*/
-SerialUSBDriver SDU1;
+SerialUSBDriver SDU2;
/*===========================================================================*/
/* Command line related. */
@@ -113,7 +113,7 @@ static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) {
}
while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) {
- chSequentialStreamWrite(&SDU1, buf, sizeof buf - 1);
+ chSequentialStreamWrite(&SDU2, buf, sizeof buf - 1);
}
chprintf(chp, "\r\n\nstopped\r\n");
}
@@ -127,7 +127,7 @@ static const ShellCommand commands[] = {
};
static const ShellConfig shell_cfg1 = {
- (BaseSequentialStream *)&SDU1,
+ (BaseSequentialStream *)&SDU2,
commands
};
@@ -173,8 +173,8 @@ int main(void) {
/*
* Initializes a serial-over-USB CDC driver.
*/
- sduObjectInit(&SDU1);
- sduStart(&SDU1, &serusbcfg);
+ sduObjectInit(&SDU2);
+ sduStart(&SDU2, &serusbcfg);
/*
* GPIOI1 is programmed as output (board LED).
@@ -207,7 +207,7 @@ int main(void) {
* sleeping in a loop and check the button state.
*/
while (true) {
- if (!shelltp && (SDU1.config->usbp->state == USB_ACTIVE))
+ if (!shelltp && (SDU2.config->usbp->state == USB_ACTIVE))
shelltp = shellCreate(&shell_cfg1, SHELL_WA_SIZE, NORMALPRIO);
else if (chThdTerminatedX(shelltp)) {
chThdRelease(shelltp); /* Recovers memory of the previous shell. */
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h b/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h
index c0a6dbbd6..8931b4ffe 100644
--- a/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h
+++ b/testhal/STM32/STM32F7xx/USB_CDC/mcuconf.h
@@ -366,7 +366,7 @@
/*
* USB driver system settings.
*/
-#define STM32_USB_USE_OTG1 TRUE
+#define STM32_USB_USE_OTG1 FALSE
#define STM32_USB_USE_OTG2 TRUE
#define STM32_USB_OTG1_IRQ_PRIORITY 14
#define STM32_USB_OTG2_IRQ_PRIORITY 14
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
index f825ec239..73ada5cc0 100644
--- a/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
+++ b/testhal/STM32/STM32F7xx/USB_CDC/usbcfg.c
@@ -18,11 +18,11 @@
#include "hal.h"
/*
- * Endpoints to be used for USBD1.
+ * Endpoints to be used for USBD2.
*/
-#define USBD1_DATA_REQUEST_EP 1
-#define USBD1_DATA_AVAILABLE_EP 1
-#define USBD1_INTERRUPT_REQUEST_EP 2
+#define USBD2_DATA_REQUEST_EP 1
+#define USBD2_DATA_AVAILABLE_EP 1
+#define USBD2_INTERRUPT_REQUEST_EP 2
/*
* USB Device Descriptor.
@@ -100,7 +100,7 @@ static const uint8_t vcom_configuration_descriptor_data[67] = {
USB_DESC_BYTE (0x01), /* bSlaveInterface0 (Data Class
Interface). */
/* Endpoint 2 Descriptor.*/
- USB_DESC_ENDPOINT (USBD1_INTERRUPT_REQUEST_EP|0x80,
+ USB_DESC_ENDPOINT (USBD2_INTERRUPT_REQUEST_EP|0x80,
0x03, /* bmAttributes (Interrupt). */
0x0008, /* wMaxPacketSize. */
0xFF), /* bInterval. */
@@ -116,12 +116,12 @@ static const uint8_t vcom_configuration_descriptor_data[67] = {
4.7). */
0x00), /* iInterface. */
/* Endpoint 3 Descriptor.*/
- USB_DESC_ENDPOINT (USBD1_DATA_AVAILABLE_EP, /* bEndpointAddress.*/
+ USB_DESC_ENDPOINT (USBD2_DATA_AVAILABLE_EP, /* bEndpointAddress.*/
0x02, /* bmAttributes (Bulk). */
0x0040, /* wMaxPacketSize. */
0x00), /* bInterval. */
/* Endpoint 1 Descriptor.*/
- USB_DESC_ENDPOINT (USBD1_DATA_REQUEST_EP|0x80, /* bEndpointAddress.*/
+ USB_DESC_ENDPOINT (USBD2_DATA_REQUEST_EP|0x80, /* bEndpointAddress.*/
0x02, /* bmAttributes (Bulk). */
0x0040, /* wMaxPacketSize. */
0x00) /* bInterval. */
@@ -262,7 +262,7 @@ static const USBEndpointConfig ep2config = {
* Handles the USB driver global events.
*/
static void usb_event(USBDriver *usbp, usbevent_t event) {
- extern SerialUSBDriver SDU1;
+ extern SerialUSBDriver SDU2;
switch (event) {
case USB_EVENT_RESET:
@@ -275,11 +275,11 @@ static void usb_event(USBDriver *usbp, usbevent_t event) {
/* Enables the endpoints specified into the configuration.
Note, this callback is invoked from an ISR so I-Class functions
must be used.*/
- usbInitEndpointI(usbp, USBD1_DATA_REQUEST_EP, &ep1config);
- usbInitEndpointI(usbp, USBD1_INTERRUPT_REQUEST_EP, &ep2config);
+ usbInitEndpointI(usbp, USBD2_DATA_REQUEST_EP, &ep1config);
+ usbInitEndpointI(usbp, USBD2_INTERRUPT_REQUEST_EP, &ep2config);
/* Resetting the state of the CDC subsystem.*/
- sduConfigureHookI(&SDU1);
+ sduConfigureHookI(&SDU2);
chSysUnlockFromISR();
return;
@@ -307,8 +307,8 @@ const USBConfig usbcfg = {
* Serial over USB driver configuration.
*/
const SerialUSBConfig serusbcfg = {
- &USBD1,
- USBD1_DATA_REQUEST_EP,
- USBD1_DATA_AVAILABLE_EP,
- USBD1_INTERRUPT_REQUEST_EP
+ &USBD2,
+ USBD2_DATA_REQUEST_EP,
+ USBD2_DATA_AVAILABLE_EP,
+ USBD2_INTERRUPT_REQUEST_EP
};