0
\$\begingroup\$

I'm using an ESP32S3 chip and trying to implement OTA through a cellular modem. The size of the bin file is 1250KB. The cellular modem has an AT command that downloads all the content in one go. Since there is no option to read it in chunks and there is not enough RAM to hold that 1250 KB of data. So I have decided to read the data in chunks from the RX FIFO buffer.

Now when I'm reading the data from UART and printing it, I'm receiving all the data properly. But when I'm trying to store the downloaded content into a local file in the file system. Data is being missed. I understood that this UART task should be performed uninterrupted.

For this, I tried running file writing tasks separately using xSemaphoreCreateMutex() but still the data is missing. Now I'm trying to use software flow control by sending XON and XOFF values. But still, the data is missing.

I'm sending XON before reading data and I'm sending XOFF immediately after data reading. Is this the correct way of using this? or Do I have to initialize something for software flow control?

Also please let me know if there is any alternative solution for downloading the file using the cellular modem and saving it in the partition.

Thanks.

\$\endgroup\$
6
  • \$\begingroup\$ "The size of the bin file" Sounds like something we already know about, but you never introduced. || If you can receive the file and print it, then it must've been properly transferred, don't you think? Why then the need to use XON/XOFF or any other technique? \$\endgroup\$
    – MiNiMe
    Commented Nov 8, 2023 at 6:30
  • \$\begingroup\$ The bin file represents the firmware format for the ESP32 chipset. Moving on to the next point, successful data reception occurs when I simply print it. However, when I attempt to write the data to a file, which is a more resource-intensive task, some of the printed data is also being lost. \$\endgroup\$ Commented Nov 8, 2023 at 6:42
  • \$\begingroup\$ Thank you for clarifying, So the ESP gets the file, and print it to serial?, and then you compare to the original? I'm not to try answer your question, only to understand it. \$\endgroup\$
    – MiNiMe
    Commented Nov 8, 2023 at 6:51
  • \$\begingroup\$ yeah that's correct \$\endgroup\$ Commented Nov 8, 2023 at 6:53
  • \$\begingroup\$ What's the speed between ESP and modem and computer, respectively? \$\endgroup\$
    – MiNiMe
    Commented Nov 8, 2023 at 6:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.