Categories

[ZeROSEro7] WiFi and SD Card

Since my last post (a long time ago), I made several improvements.

I continued to work on WiFi chip and important parts in downloading and uploading files are finished. More specifically, from a smartphone, we can choose to upload or download a file.

Upload button will make the user choosing a file from smartphone memory and send it through http in blocks. WiFi chip will save each block into its FLASH as files. At the same time, STM32 will read and delete each block through UART. The content will be printed using RTT.

About downloading, a whole file, saved into WiFi chip FLASH, can be downloaded into smartphone “Download/” folder.

Before continuing WiFi communications, I want to make STM32 able to read and write in SD Card and to communicate with BLE. Now, files are not saved into STM32 memory so I want to implement SD Card interface . Moreover, STM32 doesn’t know when it need to wait for an upload (from smartphone), smartphone doesn’t know when WiFi chip FLASH is full and it doesn’t know available files to download. These problems can be solved using BLE to communicate from STM32 to smartphone.

I also worked on SD Card communications. I implemented and tested four main functions using ChibiOS:

sd_write_byte # Write a single byte at specified addresse

sd_write # Write several bytes from a buffer

sd_read_byte # Read a single byte at specified addresse

sd_read # Read a memory area

To deal with file saving, I will begin softly with only one file saved. Then, I want to use FAT C libraries to deal with files. I read the AmpeROSE post about SD Card and I would like to use the same API.

This week, I will continue to work on SD Card and on WiFi communications.

See you next week.

5 comments to [ZeROSEro7] WiFi and SD Card

  • Alexis

    “[…] smartphone doesn’t know when WiFi chip FLASH is full and it doesn’t know available files to download. These problems can be solved using BLE to communicate from STM32 to smartphone.” I don’t quite understand why you’d use BLE for that. You have a WiFi connection at your disposal, why don’t you implement a simple REST API for this?

  • VincentG

    To save battery, WiFi will be shutdown most of the time. Therefore, in order to upload or download a file, we start with a BLE connection between STM32 and smartphone. Then, STM32 wakes up WiFi chip and communication can start. So we have to use BLE. I want to use BLE for these information because it’s easier for us. ZentriOS-W, used on WiFi chip, do not simply redirect request from UART to HTTP.

  • Alexis

    And if I understand the document correctly, you can do the same in the COMMAND mode (with tcp_client / tcp_server, stream_read / stream_write functions).

  • VincentG

    Until now, I used command mode and I made it work.
    Command mode is not compatible with stream mode so I didn’t use it, but it’s a good advice, I will try stream mode soon.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

This site uses Akismet to reduce spam. Learn how your comment data is processed.