2016-09-16 07:54 AM
Hello to everyone,
I am developing an application that reads data from sensors mounted on a STM32L4 discovery board, but since I need to log for hours I need to save data on a big storage support, such as an USB.Is it possible to do so using the microUSB link on the board?I read some posts here suggesting to use the DFU usb profile, but I don't think this is the right case...Has someone some sample code or at least any useful suggestion on how to implement the function I described?Thank you #power #stm32l4 #usb #stm32cube2016-09-16 10:18 AM
You'd probably want an MSC OTG w/FATFS, the F4 DISCO had a firmware upgrader example that demonstrated the use of USB Sticks to update the board, but could just as easily write files, etc.
Not using the L4 or HAL/CUBE, but I'd presume a similar set of functionality would be workable.2016-09-20 02:48 AM
Thank you clivel,
in fact I've based my program on the stm32f4 FATFS example. The problem that I have is that seems that Vdd pin is not managed, so the usb is not powered (I measured it with a tester and I can see it since USB LED is turned off).If I force that pin to high as a generic IO pin I get only 3V out, which are not sufficient to power on the device.Has someone some suggestions about it?2016-09-20 03:42 AM
An update:
I managed to correctly handle the Vdd line by acting on PowerSwitchOn pin; now I have almost 5V (really 4.7, there are some losses around...).But since the voltage is sent to USB, a continuous series of interrupts is issued and the program flow is stopped. Any clue?2016-09-20 04:15 AM
2016-09-20 04:32 AM
It seems I got it...
the function that chooses between interrupts seems to do not correctly interprete the connection interrup HPRTINT...More correctly the values that I see from Registers tab in IAR debugger do not agree with value assigned by the function USB_ReadInterrupts: