2023-01-23 11:12 PM
Hi,
I am using STM32 in my project. The use case includes the following :-
1) ID accessory(pen drive) ----> STM32.
In this STM32 should act as a USB host and detect the ID accessory as well as do some data transfer. We are going to use MAX3421E which will turn STM32 into USB peripheral . I have library for MAX3421 which I will be including in the code.
github.com/jakakordez/max3421e-stm32/tree/master/Src
My doubt is will I need USB drivers here? If yes which class drivers should I add?
2) The ID accessory will be having a Flash chip with file system mounted on it. It will also have a unique Device ID. The STM32 will have to read that device ID whenever ID accessory is plugged in to the device. The RX and TX of this communication will happen via SPI protocol I assume. In the library I have seen the code for detecting USB and enumerating it. But how to send data to the ID accessory(flash chip) and how to receive data from ID accessory?? I am confused on that.
Your help will be appreciated.
Thanks & Regards,
Snehal Bundele.
2023-06-21 04:49 PM
If anyone needs a good library for MAX3421e, this is the best I know of, supports multiple HID interfaces, joypad, unfortunately it has not been ported to STM32 yet (it would be very good if ST ported it, due to the errors that are occurring with the internal PHY):
2023-06-21 05:09 PM - edited 2023-06-21 05:18 PM
@Snehal wrote:Actually the block diagram will be of this kind:-
1) ID accessory(Kind of pen drive- not actually a pen drive) ----> NRF52840.
In case 1 STM32 should act as a USB host and detect the ID accessory as well as do some data transfer. So we are using MAX3421e which will support host operations.
Help needed for CASE 1.
STM32 will have to fetch data from the FLASH 2 and send this raw data to MCU 1 via MAX3421.
1)For this which USB stack will be needed is my question?
2)In the library which I shared above I have seen the code for detecting USB and enumerating it. But how to send data to the MCU 1(samd20) and how to receive data from MCU 1(samd20)?? I am confused on that.
3) How will USB drivers in case 1 be used with SPI drivers?
Thanks & Regards,
Snehal
About the project, if you are going to communicate 2 MCU that have SPI, wouldn't it be possible to use USB 3.0 port connectors, and transfer data via SPI?
"While the SPI communication method is generally suitable for distances up to approximately 10 m"
"with the LTC6820, distances of up to 100 m"
https://www.analog.com/en/technical-articles/isolated-spi-communication-made-easy.html