Electrical – Using STM32 to transfer a file via bluetooth

bluetoothdata storagesdstm32stm32f10x

So far I have been doing projects with Arduino, RPi, ATtiny etc. But now I have project in mind where these things doesnt seem to suit. I need your help.

OK, now on the project:

I have a file on my android device (an image and a .ppt file). I want to transfer it to a SD card wirelessly (bluetooth or WiFi). I will be providing a USB port to access the data in SD card.

Now, I want to assemble/make all the electronics required around the SD card.

  1. (Q1) Which one to choose Bluetooth or WiFi (my requirement is only short range, no internet involved) I want to know what Bluetooth module should I use (I have read that the HC06 is for SPP and I cannot transfer whole .ppt and do a FTP on that).

  2. (Q2) I don't want to use RPi or any ready made development board, I want to make my own minimum development board. Will this be possible using STM32F103 and do the Bluetooth transfer, if not which platform should I choose and how to make my own dev board?

  3. (Q3) Is there a specific bluetooth module for FTP? Or any bluetooth module can be used for FTP.. Because when i see the modules they are specified as being Serial.
    Please get me started on this. My question might be incomplete, please ask if any information required. (Please note: I had asked this question else where but I have tried to elaborate the question here, I have deleted the earlier question).

Best Answer

disclaimer: This answer is biased by someone who'd incorporate the amount of work necessary to make a "minimally sufficient" platform do what would trivial given a "commodity hardware" platform into system cost. Hence, it's written in a manner that suggests the STM32 platform is unsuitable for the task – it's not, but getting everything, from bluetooth to filesystems on a USB storage device to work on a MMU-free MCU is in my opinion not worth the trouble.


so, the point is to handle large file transfers over relatively high-rate links such as modern Bluetooth or Wifi, a raw ARM Cortex-M like the STM32 is plain the wrong platform.

What your project needs is

  1. an operating system handling
    • wifi/bluetooth stack
    • a file transfer service for the above stack
    • a USB storage device stack
    • a filesystem driver to be able to write files to the storage medium
  2. the computational power to communicate with communication device on one side of your circuit, and USB on the other side.

Arduino or ARM Mbed or STM32 Cube offers none of that, and you can but rudimentarily get something like a filesystem using Arduino or Mbed libraries; if you're going raw STM32, you'd have to write your own operating system...

You picked the wrong platform. Simple as that.

Look for things that run a typical operating system (vxworks, Linux, NetBSD...) and come with the interfaces you need and drivers for the operating system. Typical candidates would be < $10 devices like the raspberry pi zero, cheap Linux Routers (like the vocore.io).

I don't want to use RPi or any ready made development board, I want to make my own minimum development board. Will this be possible using STM32F103 and do the Bluetooth transfer, if not which platform should I choose and how to make my own dev board?

Well, I'd strongly recommend getting a ready, working board first, getting familiar with that, and then designing your own. As said, Linux-Running boards are cheap to get, because they can order a couple thousand of Router-typical MCUs at once – it's going to be extremely difficult for you to buy a couple of these controllers at comparable prices to fully working boards.