Showing results for 
Search instead for 
Did you mean: 

STM32U5: Battery, USB, IMU, microSD development suggestions



I am developing a sensor board that includes an STM32U575CGTx MCU, an IMU, a microSD card slot, USB, and a battery (rough schematic attached). If you have a better suggestion for the MCU, please feel free to suggest it. The data logging rate is relatively low at 60 kB/s, and the IMU sample rate is 1600 Hz.

The basic requirements for the sensor board are as follows:

  1. Act as a USB mass storage device when connected to a computer.
  2. Charge the battery whenever a USB cable is connected.
  3. The MCU should read the battery voltage and act according to instructions.

ChatGPT suggested the following steps to achieve these requirements:

  1. Set up the USB stack on the STM32U5 microprocessor to act as a USB device and implement the MSD class. There are several libraries available, such as the STMicroelectronics USB Host and Device Library or the FatFs library.
  2. Implement the interface between the microprocessor and the microSD card. This can be done using the SDIO interface or SPI.
  3. Use the FatFs library to read the contents of the microSD card and create a virtual file system on the microprocessor.
  4. Respond to the appropriate MSD requests from the host computer, such as reading the directory structure and reading the contents of files.
  5. Send the appropriate responses to the host computer in the correct format.
  6. Handle any errors or exceptions that may occur during the process.

I must point out that I am not highly skilled in programming, although I have completed a similar project using Arduino. This project is a step towards more professional development. Could you point me towards any examples or specific paragraphs in datasheets that may be helpful?

EDIT: more specific questions will follow as the project goes on.