cancel
Showing results for 
Search instead for 
Did you mean: 

USB without USB-Host

MLope.3
Associate II

Greetings.

I have a custom metering board with a STM32L151CB.

I intended to use FATFS to store data on a USB key since the MCU has USB support, but I recently realized that the feature I needed (USB - Host) was not included in the MCU.

Is there any documentation that you could recommend me using ? I wish I could find a way to create a .txt file and transfer it to a PC, but I am open to any other forms of data transfer at that point.

I tried switching to COM-PORT in USB CDC and RealTerm to display the data for now, but I only manage to display text, not numerical data.

Thanks for reading me out.

5 REPLIES 5
SBEN .2
Senior II

Hello @MLope.3​ ,

>> I tried switching to COM-PORT in USB CDC and RealTerm to display the data for now, but I only manage to display text, not numerical data.

If you can transfer text, you can transfer any data format you'd think of. What is text but a series of bytes? Even in RealTerm you can be configured to re-interpret the incoming data:

0693W00000BctvvQAB.png 

Best regards,

@SBEN .2​ 

MLope.3
Associate II

Thanks for your awnser,

I have just figured this issue and I can read my data on the COM-PORT by using the Sprintf() function.

Although, I am still looking for a way to store the data properly, either on a pc or on a flash drive...

Someone recommended that I convert the microcontroller memory to another type, but I am unsure how to then extract the data from it.

Hello @MLope.3​ ,

At the risk of being too outdated as a solution, you can store the data on the micro's internal flash (or external flash) and upload them to the PC using XMODEM for example. If you elaborate more about your use case, maybe another solution can be found.

Best regards,

@SBEN .2​ 

I will try to be as exhaustive as I can.

We are using two ADC channels to register data on an electronic component (current and voltage) every time the voltage rises above a certain treshold.

We first wanted to use fat-fs on an USB key to store that data in a .txt file (and a matching backup.txt) that looks like a basic table.

The plan was then to put the key on a PC and use a simple program to either format it to be much more readable, or import it in an excel sheet..

Due to not having access to USB-Host, we are open to other things than an USB Key, like plugging the PC to the card directly with USB.

I think that covers the use case pretty much entirely.

Thank you for the insight.

I will be giving XMODEM a look shortly.

Hello @MLope.3​ ,

Why not use an SDMMC card to store the data on?

Best regards,

@SBEN .2​