espressif / esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
Other
693 stars 160 forks source link

STM32F4 SPI + ESP32_S3 FG communication issue #522

Open czagaadam opened 3 hours ago

czagaadam commented 3 hours ago

Checklist

Issue or Suggestion Description

Can someone help how to proceed with STM32F4 SPI + ESP32_S3 FG firmware implementation?

Where I stuck:

I generated a normal STM32F4 (STM32F407VGTX) project with CubeIDE which includes: SPI1, UART5, FREERTOS(CMSIS_V1), + CS, RESET, HANDSHAKE, DATA READY pins.

I followed the guide and put everything together in cube IDE. I can compile the firmware but I think I missed something or do not understand something well.

So my main.c contains this: image I removed freertos.c file and I'm using the MX_FREERTOS_Init implementation from app_main.c

_Running the application and putting a break point in MX_FREERTOS_Init in from app_main.c:_ For me the value of transport_driver_event_handler looks strange: image

_Storing the event handler in transport_init in spi_drv.c_ image

Continue running the application: I'm getting an ESP-Hosted for ESP32-C2/C3/C6/S2/S3 message in CoolTerm, but error from ESP E (144959) SPI_DRIVER: rx_pkt len+offset[131070]>max[1600], dropping it and threads seems to be blocked image

Modification: I made a small modification in spi_drv.c I had to comment out these lines because application thinks STM32 is connected to a ESP32 instead of ESP32_S3: image

If I uncomment them in CoolTerm I'm getting: ESP-Hosted for ESP32 message instead of ESP-Hosted for ESP32-C2/C3/C6/S2/S3 and no error message from ESP, but I'm using ESP32_S3

_Do I have to run any default task in MX_FREERTOS_Init in from app_main.c: ?_ _Why application thinks it is an ESP instead of ESP32S3? _Why I'm getting this error: E (144959) SPI_DRIVER: rx_pkt len+offset[131070]>max[1600], dropping it_

Thank you!

mantriyogesh commented 1 hour ago

Did you use master code base or feature/esp_as_mcu_host branch?

czagaadam commented 5 minutes ago

Did you use master code base or feature/esp_as_mcu_host branch?

Do you mean in this esp-hosted repository ? I'm using all of these files under esp_hosted_fg: image and calling MX_FREERTOS_Init from app_main.c in my main.c generated by CubeIDE

They are linked in my CubeIDE project: image

For ESP I just pulled the esp-idf and did the export.ps1 stuffs...