Wednesday, September 28, 2011

Upgrade your bluetooth module

Hello,

Here we are. In the post, you will find (i hope) useful information to upgrade your module with HC05 firmware.

CSR support website provides a complete SDK with very useful tools. You only have to register to access to bluesuite 2.4 download page.

During the installation, let's talk about the pinout needed to gain write access to the internal firmware.

CSR BC417 chip native firmware flashing is possible by SPI connection.

SPI pinout :

    • PIN16 : CSB
    • PIN17 : MOSI
    • PIN18 : MISO
    • PIN19 : CLK
On PC side, CSR toolkit uses LPT port to emulate SPI protocol.
With few resistor, you can make your own programmer.


You will need a 3,3 V power source, I opted for a USB 5V with 3,3 V regulator.

When it's done, you will be ready to read the next post about firmware upgrading commands.

76 comments:

  1. I will of course !
    In the next post !
    But it could be temporary if some institution claims is not legal to share firmware.

    ReplyDelete
    Replies
    1. Hello! I'am trying to make a proyect for dissabled ppl and I'am ussing this module to stand in the budget, I wonder if you could share the HC05 dump, Thank you!

      Delete
  2. I'll keep my eyes open for it.
    I just hooked up my HC-06 and working on a adapterboard for it. It's a nice piece, and if it can be "upgraded" it be even more interesting.

    Best regards!!!

    ReplyDelete
  3. Man you are genious in technical writing, I have found all I needed in one minute, in one piece on this blog. Great job, keep it up. I will definitly donate few bucks.

    ReplyDelete
  4. Thank you for your comment. It too much honor !
    Happy that my blog helps a bit !

    ReplyDelete
  5. This should be easier with BusPirate, which nowadays should be in every hacker's drawer.

    ReplyDelete
  6. I would like it. But as the csr toolchain needs to communicate with lpt port, we have to make some drivers...
    And the price is not the same...

    ReplyDelete
  7. OK, since I am on linux, their software does not help anyway :)
    Best approach would be if somebody could use buspirate to sniff their commands for reading/writing firmware, then that data could be used to create some perl scripts for bus pirate. Unfortunately I'm not familiar with buspirate yet.

    ReplyDelete
  8. I have one openbench logic sniffer. I could make some capture, and i think we can get resources from CSR website, including some source code.

    ReplyDelete
  9. How to make BT module's "rts" signal alive - it needs to be used with arduino as it resets arduino before program upload. Any idea?

    ReplyDelete
  10. You may have to disable rts, cts handshake on the arduino side since the bt module don't have extra uart signals

    ReplyDelete
  11. It is not about rts/cts handshake, on arduino rts signal is used for reseting the atmega mcu before the uploading the programe to it. So rts to work tranparently is required (but not for handshake). However, I cannot get it work on HC-05 (BTM-400_6b).

    ReplyDelete
  12. I don't know how arduino is working. there is several board adapter using these BT module, so I think you just need some tweaking to make it works.

    ReplyDelete
  13. Thanks Byron for the many information that you have provided. Finally I've got my BC4 Bluethooth module flashed with the HC-05 firmware.
    Do you have any knowledge about writing/modifing firmware with Bluelab. Is the sourcecode for the HC-05 firmware somewhere available? Or what example is a good starting point for writing a firmware that supports the Bluetooth SPP profile?

    ReplyDelete
  14. Any luck sniffing the CSR tool flashing the module? Making a Python/Perl script to replicate this may not be trivial, and may cost a few bricked devices, but I also don't have Windows (or a native parallel port), but do own a BusPirate and a usbtinyisp which also speaks SPI. CSR won't even let me register (with my company email address ...)

    Oh, and thanks for sharing!

    ReplyDelete
  15. Just a quick question -- is the RTS line controllable via the upgraded firmware? I've been browsing all over the interwebs to find a way to flash my DX dongle with the better firmware, but it may be pointless if I cannot set the RTS line with it either.

    ReplyDelete
  16. Hi Byron,

    I have 2 questions:

    1. On CSR's chips, there are USB pins (USB-DP, USB-DM). Any idea how to connect these 2 pins to my PC (winXP)?
    Directly solder the corresponding wires of a USB cable? OR any resistors (pull-up, etc) are needed?

    2. If I want to use the SPI pins on the chip, but NOT the LPT port on my pc, can I use serial port or USB? If the answer is yes, what is the connection method?

    Thanks,
    Marcus

    ReplyDelete
    Replies
    1. Hi marcus !
      1)The CSR chip can be use to make an USB dongle. so if you want to use USB port you'll need to tweak or find a compatible firmware or try to find the good combination of pskey with a generic firmware... as far as i remember i think that tou will one resistor on each D- and D+ pins to downscale the USB 5V to CSR 3.3 V, I'm not totally sure so i have to make some research to confirm that...

      2) an USB prgrammer is available with the CSR toolkit, so it's possible but not affordable. BUT ... Some geeks are reverse engineering the SPI dll to developp one compatible with arduino board and maybe a bus pirate (30$) device. I don't have some update news of their work, but the proof of concept is done... can't wait to test it !!!!

      Delete
    2. Hi Byron,
      Thanks for your reply. Based on your hints, I just found
      https://github.com/Frans-Willem/CsrSpiDrivers

      I believe this will be very helpful for me, even I still have no idea how to use it.

      Thanks again.

      Delete
    3. oh !!
      I didn't notice that Frans shared his job on github !
      I will take a look to adapt his work to make it compatible with another usb board such as Bus pirate when I can get one !

      Delete
    4. hope can read your 'report' on using this driver very soon!!

      Delete
    5. Byron, any updates on getting it to work with the Bus Pirate?

      Delete
    6. Not yet, I just ordered mine this night.

      Delete
    7. Great. I will keep checking your blog for updates.

      Delete
    8. I've received my bus pirate !
      I succed to send and received som datas with the CSR chip ! but the whole download process isn't working at this stage...
      I have to add my work to frans-willem's spilpt dll...

      Delete
    9. Hey, I'm also working with Frans-Willems files to make them work with an FT232R. I successfully read some data with the pscli tool, but it took hours! ;)

      As I don't have a already working solution: Could someone provide me a screenshot of the communication. The best would be the first signal edges when starting BlueFlashCmd from _BlueLab4.1_ as this should be the same here.

      Delete
  17. Hello Byron,
    Really it is a nice website and very lucid explanations. Thanks. i have a doubt. I think HC-05 supports till SPP protocol [Correct me if i am wrong ]. I want to use LPC2129 as host for HC-05 and want to do file transfer with smart phones. My idea is to port any of the open source stack [like openobex] on my host in order to do file transfer etc. whether this idea is feasible ? Please give some suggestions.
    Thanks in advance.


    Regards
    bvin.

    ReplyDelete
  18. Hi Byron, could you please let me know how to contact you?
    Id like to find out which GPIOS are exposed to that board in order to try and develop my custom firmware.
    Regards,
    D

    ReplyDelete
    Replies
    1. See CSR's Bluecore-4Ext datasheet, it's all there and module leads connect most if not all of the chip's pins.

      Delete
  19. Its an easy way to upgrade Bluetooth module.. i will definitely try this device.. it will work.

    ReplyDelete
  20. Fernando CosentinoMay 30, 2012 at 12:06 AM

    Just curious...

    this HC-05 firmware is extremely popular and spreaded around, but seems to be brought to life by magic. Is it an official firmware from CSR? Is it another company's firmware? Who is the author after all?

    ReplyDelete
  21. Hi, thanks for your research, but I have a little question : we need an usb connection to do this upgrade ? we can't do it by bluetooth ? I don't understand how we connect it to the pc ? the big connectors is for the bluetooth card, right ? And the other ?

    Thanks for your help !!

    Madzz

    ReplyDelete
  22. hi Byron !
    i have a module i buy on ebay.http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=190673725698 i'm not sure it's hc05 or hc06, but when i supply power, led on pin32 get high level,after i paired it with computer successful,it get low level. it's name on my computer is"i-printer" . when i put pin 34 on high level, i send AT command but i don't have any reply. can u give me some idea about it ?
    thanks very much !!!

    ReplyDelete
    Replies
    1. Since your module is paired you shouldn't be able to enter AT mode.

      Delete
  23. Does anyone know if the SPI bus is only used for programming or can data be transmitted via bluetooth using the SPI bus?

    Thanks,

    Ryan

    ReplyDelete
  24. Hi Robin, many thanks for linvor's AT commands! It was very useful!
    Do you know if it possible for this module to make custom firmware which can support non-standard baud rates?
    I need 8192 bps, so tried to convert speed with arduino, but it doesn't work properly...

    ReplyDelete
    Replies
    1. Hi Roman, were you able to set non-standard baud rates on the HC-05? I am trying to do the same. I posted a question here as well --- http://arduino.stackexchange.com/questions/18132/setting-baud-rate-of-250k-for-the-hc-05-bluetooth-module

      Delete
  25. Hi Brian, just wondering if I could get some help trying to get my bluetooth project off the ground. Im using one of the cheap ebay bluetooth adapters but I cant seem to get any response with the AT commands using my arduinos serial port. but even if I can get into the AT commands, it seems all I will be able to do is change what the device type is called... what I want to do is read AVRCP data from my ipod. Do you think there is any chance of doing this??

    Cheers Harry

    ReplyDelete
    Replies
    1. I want to do the same please let me know if its possible

      Delete
  26. Hi Robin, please, I'm prototyping one Bluetooth keyboard and until so far this CSR module seems to be the cheapest one out there - the only inconvenient is that it does not came with HID/L2CAP/HIC.

    Then I saw your blog (it was more than 1 year ago) ...

    The thing is that I got the BlueLab 4.1 from the CSR site and there is one HID Keyboard sample on it's installation but I'm kind lost, it mentions that it requires the "CaSiRa" dev module and one dev keyboard. My question is if you already saw this CaSiRa module or this dev keyboard (couldn't find this CSR dev keyboard in the web) and if this HID sample that I saw is really "installed" inside the CSR bluetooth module or inside the CaSiRa dev board ...

    We were planing to use the RN-42 module just because it already come with one HID firmware but the RN module is not so cheap than the CSR one. The LUFA has one partial HID implementation but I don't think we would have time to code what is missing - I think it would take more than 6 months only to understand what Deam Camera did just to be able to continue his work ...

    The funniest thing is that Sparkfun sells this RN-42 module with and without the HID firmware - most probably they just upload the HID firmware into it (so so what I would like to do with the CSR module).

    Please, any hint would be welcome ...

    And thanks very, very, very much by your post my friend!
    I'm right now burning down my fingers trying to solder one "programmer" just like yours.

    ReplyDelete
    Replies
    1. Did you manage to flash a hid enabled firmware? I was looking into the same thing.

      Delete
    2. Here are my tools and scripts for flashing Custom HID firmware onto the HC-05 (Hebrew but pics and files shuld be enugth)
      http://www.makers.co.il/mfs/showthread.php?91-%E4%EE%F8%FA-HC-03-Bluetooth-Module-%EE%E1%E5%F1%F1-CSR-%EC-HID-Device

      Delete
  27. Something is wrong with your schematic. SPI_MISO is not connected a voltage divider circuit. The voltage is not converted down to 3.3V and still remains at 5V. This can fry the Bluetooth module.

    ReplyDelete
    Replies
    1. I think that is OK. The MISO signal is going from the bluetooth module (3.3V signal) into the parallel port (expecting 5V). The MOSI line needs to be kept below 3.3V and it is.

      I was hoping to be able to program my module using bus pirate but it seems I am going to need to dig out a PC with a parallel port.

      Delete
  28. Question... can arduinoISP be used as a programmer for this bluetooth module? These days, LPT ports are hard to come by. I know ArduinoISP has been used to flash a variety of devices like LCD's, other arduino boards, and so on. I have the original HC05 and 06 firmwares ready to be flashed. I have 3 identical modules that say linvor 1.5 but it appears that all 3 do indeed have different firmware revisions preinstalled, and only one module works.

    Thanks in advance!

    ReplyDelete
    Replies
    1. you should take a look at Franz Willem jobs
      https://github.com/Frans-Willem/CsrSpiDrivers

      I promise to make test of this solution, but I don't have enough time to make investigation for now...

      Delete
    2. As I Mentioned earlier,
      Frans-Willem driveres (bitbang) works amazingly well.
      See other posts in this thread

      Delete
  29. Hello

    What a great information you have shared with us and I think this information is useful for us and also for those people who want to upgrade their Bluetooth modules.

    ReplyDelete
  30. Thanks for such a informative post to convert the simpleBluetooth module into the HC05 firmware

    ReplyDelete
  31. can i use usb to parallel converter? Would this work?

    ReplyDelete
  32. Yes please, I would also like to know if I should by an USB to Parallel converter. Will it work? thanks

    ReplyDelete
  33. Has anyone tried the HID Firmware BC-04? Apparently it can be flashed to these modules. It is available here: https://mega.co.nz/#!6UwlUISC!QH6x4DpZXe4Y1rT50VeszCaZT1pBWMykDHH5wIJBMAo

    ReplyDelete
    Replies
    1. That's mine :D
      Its a somehoe moddified version of the XIDE's sample code for HID

      Delete
  34. the readme file in the zip is not readable in regular wordpad.
    it looks like that:
    "àðé ìà äîöòúé ùåí ãáø, ôùåè òùéúé äøáä îç÷ø åìé÷èúé ãáøéí ùàôùø ìîöåà áàéðèøðè, äí îøåëæéí ëàï."

    ReplyDelete
    Replies
    1. Hebrew ISO encoding, use google translate
      more information here: http://www.makers.co.il/mfs/showthread.php?91-%E4%EE%F8%FA-HC-03-Bluetooth-Module-%EE%E1%E5%F1%F1-CSR-%EC-HID-Device (Again, Hebrew)

      Delete
  35. Hi i am trying to use Frans-Willem code to program Via usb +arduino
    i Have successfully use BlueFlesh to bern existing *.xpv *.xdv
    to my HC-05 module .
    but when I am trying to develop my one firmware in BlueLab at some point it's writing "Unable to query BlueCore over SPI"
    do you have any idea how can i solve it ?

    ReplyDelete
  36. sir i have hc 05 and the hid firmware but i cant find bluelab 4.1
    can u provide some link

    ReplyDelete
  37. Same here. I cant download the blueLab software. I try to register on the CSR website but it doesn't recognize my email as a business address and tells me to go away...

    ReplyDelete
  38. https://dl.dropboxusercontent.com/u/94589680/BlueLab-4.1-Release.exe

    ReplyDelete
  39. I saw sometime ago two HID modules being sold in US that seems to be our loveable CSR module with a custom firmware (and a metallic enclosure just to hide up what it really is):

    Bluefruit EZ-Link - http://www.adafruit.com/products/1588
    Bluefruit EZ-Key - http://www.adafruit.com/products/1535
    both from Adafruit

    I'm curios to know if it's possible to download the firmware of this module and burn it into one HC-05. Right now I don't have this module at hands but I'll check it.

    Any of you already tried this module?

    ReplyDelete
    Replies
    1. I'v tried to do that a while back. I Actually did managed to do that using a firmware of a different device (forgot it's name) but it had some kind of DRM on it and connection was denied (device name was 'Licensing error' or similar).
      I believe that there are more then a few of retail CSR-BC3-EXT based HID BT devices out there. It is worth a shot with any firmware you'd find.

      I Guess this would be the best approach for guys who want HID from a HC-03. Or write your one firmware using xIDE (BlueLab)

      Delete
  40. Hey, I'm looking at using some of these HC05 Modules in a project I'm working on but because they're cheap and coming form china I'm a bit concerned that they might have duplicate MAC Addresses. Does anyone know if it's possible that if I get that BlueSuite 2.4 or 2.5 (or I guess the current one as of today is 2.5.8) could I create the MAC address themselves in the radio? I'm not really looking to reflash (or reprogram) the slave modules to a Master Module. I'm just wanting to be able to put in my own MAC Addresses. Or perhaps the MAC Addresses are hard coded directly into the chip and I don't need to worry about duplicate MAC Addresses at all?

    Any Thoughts would be appreciated.

    Thanks,

    ReplyDelete
    Replies
    1. I'm answering my own question. Yes it is possible to reprogram a new mac address however the format that reads out isn't exactly the same. so it takes a little trial and error to figure it out right but again. Yes I am able to change the MAC address with this radio.

      Delete
  41. Hi Byron. Hi everyone. im new to bt module and protocol. i want to connect a headphone to my android. i brought a Hc-06 TTL and later realise that i need a2dp to send audio.
    1.i was wondering does Hc-06 Support a2dp? and how to set it?
    2. if cannot,is there any firmware or bt module that i can use? i was hoping i could just load my Hc-06 with a new firmware to support a2dp rather than buy a new bt module.
    Thank for any help.

    ReplyDelete
  42. Hi man,

    I really appreciate what you've done here, thank you a lot this blog.
    Do you know if is possible to change the bluetooth profile to AVRCP or any other?

    best regards

    ReplyDelete
  43. Hi Byron. Looking at the specs of the modules, I noticed these two sets of magic words. The first: MOSI, MISO, CSB and CLK. The second: USB D+, USB D-. That would make this little board easily accessible from an Arduino through SPI, and from a PC through a USB port. Would you know if this is possible / has been tried? I´m particularly interested in the possibility of reflashing a HC06 into a HC05 in this fashion.

    Cheers

    ReplyDelete
    Replies
    1. Hi, have you found an answer? Can a HC-06 flashed to be a HC-05?

      Delete
  44. What if do not have a parallel port?

    ReplyDelete
  45. in what programming language can i program frimware of HC05 i am having no idea pls help me

    ReplyDelete
  46. hello, i'm trying to flash the firmware...
    i could not get the LPT port connection to work so i tried the FTDI
    connection with the custom drivers but now when it is connected the blueflash is not openning

    ReplyDelete

Note: Only a member of this blog may post a comment.