![]() With this demo, you can use your Nucleo board as a Mass Storage Device that shows on your PC as a removable flash drive. You will find the complete demo in my GitHub repository: This demo is a Cocoox COIDE 1.7.7 project using ARM GCC. Without this modification the USB host lib never enumerate the connected flash drive. The modification in USB host core state machine proposed by Michele in this forum.His USB MSC device demo is posted in this forum. Clive1 stm32F4 discovery SDIO driver with modification to support cards with capacity larger than 4GB.Tilen Majerle RTC library to use the internal RTC of the microcontroller ( link here).Tilen Majerle FATFS and SDIO interface for SD card ( link here).All these resources where very helpful and I would like to thank the authors for sharing their knowledge: Nevertheless, in order to make it work the way I wanted to, I merged several pieces of code from several places. The USB library from ST is the "core" of this demo. ![]() Beneath the Nucleo board is the SD card socket. Overview of the breakout board with USB connector. You can also use the FATFS to access the SD card. That is, if you connect a USB flash drive, you can access its contents using the FATFS library. The code also works as a HOST for Mass Storage Devices. That is, in DEVICE mode, your Nucleo will become a generic USB storage device when connected to the USB port of your computer. So, this post is about of programming a Nucleo-F401RE board to use the STM32F401RE USB peripheral as a DEVICE Mass Storage Class with SDCARD (connected with 4bit SDIO interface) as the media. ![]() Most of the codes you will find spread in other examples and libraries. I believe that (at least these days) you will not find another internet site with all the stuff I'm posting here in one place. Starting read test.This post is a result of several hours of hard work, thinking, planning, trial-and-error, debugging, and searching the internet for working code in order to make the USB peripheral of a STM32 act as an USB device (mass storage) and HOST (mass storage too). Maximum latency: 25258 usec, Minimum Latency: 12206 usec, Avg Latency: 12989 usec Here is the first result, no attempt to optimize: This is with a simple polled SPI library, not DMA. I now have a new, not SdFat, file system library running well enough to do a first benchmark. I am using a stock Adafruit data logging shield. Wow! The NUCLEO-F401RE is really fast with just polled SPI. Its three 12-bit ADCs can run in interleaved mode to digitize a signal at up to 7.2 MSPS.Įdit: Just checked and Future electronics now sells the 32F429IDISCOVERY for $24.00, about the same as an Uno. The external SRAM has a 16-bit data bus and runs at 80 MHz. 256 KB internal RAM, 8 MB external SRAM, 2 MB flash, 180 MHz clock, 2.4" TFT touch screen. I also bought a 32F429IDISCOVERY board for $33.60. 4-bit SDIO should be very fast since it should run at 50 MHz. I plan to support SD on SPI, SD on 4-bit SDIO, and USB flash drives. I have almost finished porting a new FAT32/FAT16/FAT12 generic file system to the STM32. The 12-bit ADC seems to be very accurate. I have tested the ADC on these boards and it is at least 50 times faster than the Uno, 2.4 MSPS. There are three SPI controllers, three I2C controllers, and three UARTs. It is faster, 100 MHz, has more SRAM, 128 KB, and 512 KB of flash. There is a new NUCLEO-F411RE ($10.33 from Future Electronics). This does not interrupt the connection to the serial monitor since there is a second STM32F103 that handles the serial monitor, programming flash, and debug. I now program flash by drag and drop of the apps. I continue to be pleased with the Nucleo boards. STM Studio reads data through the ST-Link SWD debug port so it does not interfere with the real-time behavior of applications. STMStudio reads the elf file generated by the linker to find and displays variables in real-time. Several people have posted Makefiles templates to build projects generated by STM32CubeMX. STM32CubeMX creates a project with the generated start-up code and copies needed library code to the project. The power-consumption wizard estimates the application's power usage. The peripherals-and-middleware wizard aids configuration to avoid unusable settings. The user interface is a diagram of the clock tree and you just edit this diagram. The clock-tree wizard assigns clocks and performs dynamic validation. The STM32CubeMX pin-out wizard assists pin assignment to avoid conflicts and has a constraints solver. STM32CubeMX is a graphical configuration tool that automates configuration and generation of STM32 initialization C code. STM32CubeMX - STM32Cube initialization code generator - STMicroelectronics ![]() STM32CubeMX is a big improvement over previous ST configuration tools. I have started using STM32CubeMX to configure Nucleo projects and several other STM32 boards. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |