From 92c371470649d58e1e76e6c255fe3c010fc8ef54 Mon Sep 17 00:00:00 2001 From: barthess Date: Fri, 28 Oct 2016 14:25:08 +0300 Subject: USB_MSD. Added READ_FORMAT_CAPACITIES handler --- testhal/STM32/STM32F7xx/USB_MSD/main.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'testhal/STM32/STM32F7xx/USB_MSD') diff --git a/testhal/STM32/STM32F7xx/USB_MSD/main.c b/testhal/STM32/STM32F7xx/USB_MSD/main.c index 2d17088..cae2b74 100644 --- a/testhal/STM32/STM32F7xx/USB_MSD/main.c +++ b/testhal/STM32/STM32F7xx/USB_MSD/main.c @@ -52,6 +52,15 @@ RamDisk ramdisk; __attribute__((section("DATA_RAM"))) static uint8_t ramdisk_storage[RAMDISK_BLOCK_SIZE * RAMDISK_BLOCK_CNT]; static uint8_t blkbuf[RAMDISK_BLOCK_SIZE]; +BaseSequentialStream *GlobalDebugChannel; + +static const SerialConfig sercfg = { + 115200, + 0, + 0, + 0 +}; + /* * Application entry point. */ @@ -67,6 +76,9 @@ int main(void) { halInit(); chSysInit(); + sdStart(&SD3, &sercfg); + GlobalDebugChannel = (BaseSequentialStream *)&SD3; + /* * 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 @@ -75,7 +87,6 @@ int main(void) { usbDisconnectBus(&USBD1); chThdSleepMilliseconds(1500); usbStart(&USBD1, &usbcfg); - usbConnectBus(&USBD1); /* * start RAM disk @@ -93,6 +104,11 @@ int main(void) { msdObjectInit(&USBMSD1); msdStart(&USBMSD1, &USBD1, (BaseBlockDevice *)&ramdisk, blkbuf, NULL); + /* + * + */ + usbConnectBus(&USBD1); + /* * Starting threads. */ -- cgit v1.2.3