10 years, 2 months ago.

Working Code for CC3000 and Nucleo F030R8?

Hello,

Does anyone have some working sample code for getting a CC3000 (adafruit breakout board) working with a Nucleo board (STM32F030R8)?

I just need some sample code to do a simple GET request. I've tried some of Martin's http_client code, but can't seem to get it to work. I'm trying to figure out what settings to use in the init() file, and also to figure out what pins to connect. I think I have the SPI pins right, but which pins can I use on the nucleo board for the IRQ?

I'm fairly new to mbed and ARM, so any help would be appreciated. I just want to get a sample code going and then I can mess around with it.

Thank you!

________

Edit:

Ok, I've imported Martin Kojtal's CC3000_websocket_demo program and I've put the following in the pin definition section (in main.cpp):

pin connection details

/* cc3000 module declaration specific for user's board. Check also init() */
#if (MY_BOARD == WIGO)
cc3000 wifi(PTA16, PTA13, PTD0, SPI(PTD2, PTD3, PTC5), "ssid", "key", WPA2, false);
Serial pc(USBTX, USBRX);
#elif (MY_BOARD == WIFI_DIPCORTEX)
cc3000 wifi(p28, p27, p30, SPI(p21, p14, p37), "ssid", "key", WPA2, false);
Serial pc(UART_TX, UART_RX);
#elif (MY_BOARD == MBED_BOARD_EXAMPLE)
cc3000 wifi(p9, p10, p8, SPI(p5, p6, p7), "ssid", "key", WPA2, false);
Serial pc(USBTX, USBRX);
#else
cc3000 wifi(PB_3, PB_4, PB_6, SPI(PA_7, PA_6, PA_5), "MySSID", "MyPass", WPA2, false);  //irq, en, cs, spi(MOSI, MISO, SCK), irq-port
Serial pc(PA_2, PA_3); // tx, rx


#endif

Above, I'm assuming that since I define my board as "UNDEFINED" in the main.h file, it will go to the #else condition...

My main.h file has the following:

main.h contents

#ifndef MAIN_H
#define MAIN_H

#define WIGO               1
#define WIFI_DIPCORTEX     2
#define MBED_BOARD_EXAMPLE 3
#define UNDEFINED          4

#define MY_BOARD UNDEFINED

void init();

#endif

Assuming this is defined correctly, what else do I need to change in the Init() function for this to work with nucleo F401RE/F030R8 boards?

btw, if I compile the code with the above changes, I get the following errors:

1) Identifier "first_IRQ_number" is undefined "for(irqnum = first_IRQ_number ; irqnum < last_IRQ_number + 1; irqnum++)"

Do I need to define the first_IRQ_number and last_IRQ_number somewhere? Do I need to do anything in the NVIC_set_all_priorities files?

Thanks so much for the help!

Any pin should work as IRQ pin (when using a recent mbed lib). I would skip the init file for now, I have no idea why they change SPI interrupt priority there, since it isn't used afaik. Higher priority for the InterruptIn is required when there are also other interrupts active in your system, but at first that won't be the case for a simple situation.

What is definatley important is making sure you can supply enough power to the module, an external power supply might be required. I think the dipcortex can get enough from USB by being a fairly low powered board, but my first attempts for example on the Wi-Go board failed, and they did succeed after I finally bothered to include the extra battery, where it can draw peak power from.

posted by Erik - 04 Sep 2014

Same request here. Does anybody have a working example of the CC3000 with a nucleo board?

The error I am getting is the program gets stuck when checking the value of the INT pin in the initialization of the module. It is not a forever while, it just jumps somewhere unknown

posted by Cristian Fuentes 23 May 2016

1 Answer

10 years, 2 months ago.

Hi,

I don't have this board so, please post more information about what errors you are seeing, and what pins you are using. Please use code tags if you post any code. I will then do my best to help.

Dave.