HY32 and CC3000

Posted on
  • Hey,

    I'd like to connect my CC3000 to my HY-MiniSTM32V 3.2 and wonder if and how this would work best. Or at all.

    I saw that while the boards have pin declaration files in the source, the CC3000 Pins seem to be hardwired in the CC3000 includes.

    Now, since the CC3000 uses CS, EN and IRQ lines in addition to the SPI lines and the defined IRQ-Pin (B6) is also used by the touch screen, I wonder if there is any conflict (or if there can be multiple IRQs handled by the same line. Sorry if this might be a stupid question).

    I see that we can now have SPIs on any pin combo but the CC3000 class still seems not to be configurable. And since I don't want to fry anthing...

    So, anyway, how would I connect the CC3000 to the HY32? Or would I have to do a custom build?


  • I didn't realise about the pin conflicts... I think you'll have to do a custom build (CC3000 isn't enabled for that board by default anyway) - but once you had done that, changing the pins is as easy as changing the header file here:


  • Yes, that's where I looked at. Darn pin.
    I really thought I would get around that toolchain thing :)
    I would like to have it run on my Mac natively, but that would mean less optimized compilers.

    (Bold suggestion: As doing our own builds seems part of the game right now, do you think it would be feasible (for you, ideally :) to provide the community with a working toolchain image for Virtual Box or something? After all, we only need a software solution that creates the .bin and then would be able to use our native environment to upload it to the board.)

    Other than that, is there a reason why the CC3000 does not allow for setting it up with any SPI plus the additional pins like it's already the case for displays and other devices? Any special needs for that module?

    Best and thanks

  • http://forum.espruino.com/conversations/­151/?offset=25

    I've shared an AMI (for making Amazon EC2 instance from) that has the Espruino build environment set up on it - see that thread. Not sure if this is useful to you.

  • Oh, that's very cool, indeed. Thanks for sharing that work.
    Hadn't looked at that particular thread for some time now.
    So, now I'll be on Amazon cloud to get that damn board working :)
    (Ideally with a new credit card that allows for some free test time...)

    Nice. Thanks again.

  • Well, there isn't much of a reason for the lack of pin configurability - apart from it being more development work. It's been on my list of stuff to do, but quite a lot of stuff is higher priority I'm afraid.

  • Ok, just wondered if there were any magic performed on the lower level to fix the stabilty issues or whatever and whether I had to "wisely" choose pins.

    Is there a list what pins might work for what? SPI is a bit picky about what it accepts and I haven't found out exactly what the criteria was. (Then again, I haven't looked into the pin features yet, as I am mostly using the platform as a less complex - than RasPi - software environment right now)

  • No, it's fine - you just have to choose pins that are actually on a proper SPI peripheral. Software SPI won't work with CC3000/WIZnet (at the moment).

    Have you seen http://www.espruino.com/ReferenceHYSTM32­_32 ? There's a list of them at the top of http://www.espruino.com/Reference - that's basically the main list of available pins and what they can be used for. On the STM32F1 boards you can only use 'groups' of SPI pins together though - for instance B3,B4,B5 - but not B3,B4,A7.

  • So... I managed to connect the CC3000 to the HY32. But it would only accept SPI2 and crashes deep (Display backlight and USB led go dark) when trying to use SPI1. Also the Reference image shows SPI3 on the same pins as SPI1, however, the board's config says it only has 2 SPIs, anyway. So SPI3 is actually not defined. Maybe the pin info for the board is not clear/clean on some details?

    I now reconfigured the cc3000 to use SPI2 (B13, B14, B15) with B12, B8 and B9 for the additional Pins, which worked right away.

    I also saw that the pin reference shows USB as a function for three pins. Can that be used for anything right now? It's probably for OTG/Host mode?

    I have now a new problem, "too many recursions" when doing the MD5 on the HY32. I'll open a new thread for that one.


  • The USB is for USB Virtual Com Port (on the other USB connector) - it's a bit faster than the standard Serial port connection. There's no OTG though - I don't think F103 chips are even capable of it.

    Not sure why you had the trouble with SPI1 - sounds strange that the backlight would dim - maybe it's on one of those pins? The board config could just be wrong and you could update it to 3 SPIs and try that - but if SPI2 works it's maybe best just to keep it!

  • Sorry, ignore this post, I had posted to wrong thread :(

  • I was curious how you connected the CC3000 to the HY32? I've been stumbling around trying to find the CC3000.js file to copy over to a SD card. Im really new to the module side so anything that can point me into the right direction would be great.

  • The CC3000 driver is actually built into the firmware (it's part of the binary, not a JS file).

    I'm afraid you're out of luck unless you compile your own version of the firmware with it in...

  • I think you need to build with:
    USE_NET=1 HYSTM32_32=1

  • I suppose NetworkJS is also in the bin? Any way to get wifi on the HY32? I have screens coming for my picos but it would be nice to do more testing with the HY32. Maybe DrAzzy could elaborate on that a little bit? Thanks all.

  • Yes, I'm afraid NetworkJS needs a recompile too.

    I think @DrAzzy means that if you set up using the instructions here you should then be able to build by typing the command:

    USE_NET=1 HYSTM32_32=1 RELEASE=1 make
  • Hey,

    I re-compiled everything. Fortunately the makefile quality just had improved back then... The main issue was to get the tool chain set up on my mac and to flash the HY32 which had some timing issues with the mac drivers.

    I can look up the files if you need anything. Should have them somewhere.

  • Are we able to select SPI2 when calling connect now? If not then it sounds like I have to modify that board_spi.h file?

  • Ya -

    SPI2.setup({ mosi:B15, miso:B14, sck:B13 });
    var eth = require("WIZnet").connect(SPI2, B10); //or whatever pin you're using for CS.
  • ok thanks and I did not see this explanation until now

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

HY32 and CC3000

Posted by Avatar for Stev @Stev