2024-05-21 08:06 PM
Hi,
I have to read both image files(BMP and JPEG) and also text files from either uSD or USB pen drive. But - despite having written quite a bit of code through the years - I have never developed any code that does that specifically. nor do I have previously used the STM32 or STM32 tool chain.
Just a couple of questions:
1) which one is easier, faster and simpler to implement? The uSD card or the USB pen drive?
2) would it be better / easier to use also FreeRTOS or not?
3) What are the libraries to install/use? Are there any code samples?
Any additional pointers are also welcomed! :)
Thank you very much :)
Solved! Go to Solution.
2024-05-24 08:29 AM
Hello @Ricko ,
Using uSD card is easier to implement, typically, microSD cards are interfaced through the SPI or SDIO protocols, which are well-supported by the STM32 hardware and software ecosystem. Also it is faster to set up, the STM32CubeMX tool can help you quickly configure the necessary hardware peripherals. Additionally the FatFs library is commonly used for file system operations on SD cards and is relatively straightforward to integrate. Whereas for USB, it requires handling the USB host stack, which can be more complex than SPI or SDIO. You'll also need to configure the USB host and class drivers, which can take more time.
You can refer to this instructional video on YouTube for FatFs, also this video for FreeRTOS. If your application is simple and doesn't require multitasking, you might not need FreeRTOS. However, for more complex applications, an RTOS can be beneficial.
Within STM32Cube MCU Packages , you'll find a variety of related applications depending on your utilized STM32 series.
Hope this may be helpful.
2024-05-22 04:43 AM
- Both uSD or USB drive would have same "difficult".
- Would you use FreeRTOS for anything else? if you are only reading content from uSD or USB drive, easier to dont.
- You can have a look in CubeIDE, create a new project from examples, you can choice a STM32 example that does uSD or USB drive read.
Greetings
2024-05-22 07:26 AM
Thank you @urbito ! :)
Just to get a feel for it, how long do you think it would take to write some simple code (using ST libraries) to read an image file? I have coded before but never with uSD or USB.
s it just a few lines like with the old serial ports on PCs like Open File, Read and Write? Or is it a more complex process with many things to check to write solid code?
Thank you again!
2024-05-22 09:59 PM
it would for sure be "few lines" with something similar to PC, since you would use a library Called "FatFS". Just have a look on the ST Examples and you would get it relative quick :)
Greetings
2024-05-23 06:54 AM
Thank you @urbito :)
2024-05-23 07:06 AM
You can get USB "pen drives" which take a uSD card; eg,
So you could just develop a USB MSC Host - and use one of those to provide the uSD Card support ...
2024-05-23 08:06 AM - edited 2024-05-23 08:07 AM
Thank you @Andrew Neil :)
2024-05-24 08:29 AM
Hello @Ricko ,
Using uSD card is easier to implement, typically, microSD cards are interfaced through the SPI or SDIO protocols, which are well-supported by the STM32 hardware and software ecosystem. Also it is faster to set up, the STM32CubeMX tool can help you quickly configure the necessary hardware peripherals. Additionally the FatFs library is commonly used for file system operations on SD cards and is relatively straightforward to integrate. Whereas for USB, it requires handling the USB host stack, which can be more complex than SPI or SDIO. You'll also need to configure the USB host and class drivers, which can take more time.
You can refer to this instructional video on YouTube for FatFs, also this video for FreeRTOS. If your application is simple and doesn't require multitasking, you might not need FreeRTOS. However, for more complex applications, an RTOS can be beneficial.
Within STM32Cube MCU Packages , you'll find a variety of related applications depending on your utilized STM32 series.
Hope this may be helpful.