Firmware For Cheap Bluetooth Modules

Ibluetoothf you’ve ever built anything with a microcontroller, some sort of sensor, and a connection to the outside world, you’re probably wondering how those places in China can pump out cheap electronics for a mere percentage of what it costs you to pull a DIY. It’s not just volume – it’s engineering; if something has Bluetooth, you find a Bluetooth module with a built-in microcontroller so you can write firmware to it.

The BC417 is the System on Chip found in the very popular BlueCore4-Ext Bluetooth module featuring 8Mbits of Flash (75% of which is used for Bluetooth related stuff), somewhere around 12 kB of RAM, with everything run in a virtual machine. [pfalcon] wrote an extremely experimental firmware for this device that allows anyone to create a wireless sensor node for peanuts. These devices are almost as cheap as a bare ATMega, so the possibilities are interesting, to say the least.

At this point, the hardest part of putting custom firmware on these devices is programming them. For that, [Elastic Sheep] comes to the rescue with a parallel port to SPI interface. There’s also a firmware dumper and some breakout boards available. These modules are pretty cheap, and the pitch isn’t too bad, so you might be able to etch your own boards should you want to experiment a little.

Thanks [Peter] for sending this in.

Comments

  1. ejonesss says:

    maybe should be “It’s not just volume – it’s engineering – reverse it’s engineering – it’s stolen designs”

    often we may see the numbers scraped off an ic so a company cant go ” hey that is our stolen design”

  2. fartface says:

    Unless you have the expensive Toolchain all of this is pretty difficult to make any use of.

  3. lja says:

    How exactly does the firmware run in a VM? Why on earth would they do this when there is only 12KB of RAM?

    • Anonymous says:

      The customer code (in this case the ‘firmware’ mentioned) runs on the VM. The real CSR firmware runs elsewhere.

      • mofosyne says:

        Wonder why that kind of setup? Does it make it easier to code for? Or is it more for isolating certain features, to be paid for selectively?

        • pelrun says:

          It’s due to wireless regulation compliance. Locking the module down means that they can get the module FCC/CE/whatever certified, and that certification isn’t invalidated just by sticking it on your own board – since you can’t make the module do things that violate the regs. Otherwise, just by putting the module on your board forces you to pay $$$ to get a full recertification.

  4. steve says:

    Who the hell has a parallel port on their computer these days?

  5. davedarko says:

    i would love to have them stuffed with HID code…

    • Erik Johnson says:

      I believe there are already firmwares floating around for just that. I have a cheap BT micro keyboard that appears to have one of these soldered to it

      • davedarko says:

        I’ve seen some datasheets for the bc417 and also know that it is possible, but wondered why they would not offer a better system for tinkerers to set them to HID mode. I guess it is not so common to use a bluetooth HID stack rather then a serial one and this is were they earn their money. There are solutions out there, but not that cheap or easy to order within Germany, except the RN-42-HID maybe. But 20euros versus 5euros still makes a difference.

  6. Sabas says:

    Programando el bluetooth HC-06 y HC-05 con Stellaris Laucnh Pad http://blog.theinventorhouse.org/programando-el-bluetooth-hc-06-y-hc-05/

  7. hboy007 says:

    FT232HQ and FT2232D support SPI at a level of difficulty of a USB-to-serial converter.

    It is easy to work with and runs both with FTDIs ftdi_libmpsse and the libusb-based open libmpsse. I cleaned up the API a bit and wrote a COM to SPI tool (add a com0com loop and you can control SPI via hterm).

    I can’t see how anyone would still bother using parallel ports. Instead, I encourage everyone to give these chips (or equivalents from other manufacturers) a look.

    ps. some JTAG programmers are also equiped with these chips :)

    • Torque says:

      Because built-in parallel ports just works.
      Minimal fuzz and low level access.
      When USB gets thrown into the mix, things often goes haywire due to the sheer complexity of any USB-to-X converter.
      Same reason some people still uses PS/2 keyboards.

    • pelrun says:

      The programming interface for the module is a proprietary protocol over SPI. You might be able to make a SPI interface easily enough, but the closed-source utilities that know how to program the module don’t recognise that hardware. The parallel port is the simplest hardware a user can build that is supported by the CSR tools. Another option is the firmware I linked elsewhere in the comments that requires a specific Launchpad board.

  8. Quin says:

    Now if only someone can show me a BIP stack on one of these…lots of bluetooth chips with high bandwidth audio, but not a one with a simple command for image push.

  9. occam49 says:
  10. doragasu says:

    Too bad even though the commercial toolchain used to code for these chips is gcc based, it is not open and you need to purchase it do do anything interesting.

  11. gfsnu_nfdis says:

    These are really old modules, you can get the full tool chain for them when you buy the dev kit digikey part number BCES01-EP-ND. Once you buy that you can get on csr support can get new firmware and more example apps etc..

    My advice is move to Bluetooth SMART- the uEnergy starter kit is $100 for the full tools and firmware (DK-CSR1010-10169-1A-ND digikey), with many example apps including HID keyboard and mouse apps. The modules are £10 from BCDmicro in the UK and probably many other places. This dev board also has an official USB to SPI adapter that you can use in blueflash and can be jumpered off the board for programming Bluecore devices as well as uEnergy devices.

  12. Dave. says:

    Does anyone know if the CSR chip can be persuaded to support audio streaming and RS232 at the same time?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s