9 years, 12 months ago.

cc3000 hangs at hci_event_handler

I am simply just trying to connect to my home router right now but when I turned on the debug mode, the code hangs at:

[CC3000 : HCI TX] Command Sent : 0x4000

tracing the code, in main.cpp the program hangs at line 49 wifi.init()

tracing wifi.init() back to cc3000.cpp the program lingers at line 86 _wlan.start(0)

tracing _wlan.start(0) back to cc3000_wlan.cpp the program lingers at line 113 simpleLink_init_start(patches_available_host);

tracing simpleLink_init_start(patches_avaliable_host) in cc3000_wlan.cpp the program lingered at line 66 simpleLink_init_start(patches_available_host);

tracing that into ccc3000_events.cpp the program lingers at line 637 simpleLink_init_start(patches_available_host);

tracing that into fuction hci_event_handler(void *ret_param, uint8_t *from, uint8_t *fromlen) is where things start to get interesting:

for recieved_data was equal to 268436353 every single time I tried to connect to a network the code continues onto line 416 and skips the if statement at 425 and then halts at line 433 memcpy(ret_param, pucReceivedParams + HCI_DATA_HEADER_SIZE + argument_size, length - argument_size);

line 433 is the line of code I've traced the problem back to. The wifi module can never connect to any network or even get an "event received" debug message because memcpy is somehow stuck at line 433

If anyone has a solution to this problem please post it here. I've tested this module with an Andruino UNO and it works perfectly fine. I managed to confirm that the firmware on the module is currently v1.24. There just must be something I am doing wrong using the mbed that is not working. Both the mbed and cc3000 arrived 2 days ago. Also I have a dedicated external battery at 5v 1A connected via usb to a usb breakout, so I know it is not an power issue. So that narrows it down to the code and the wiring. However from the previous post answered by Dave, the wiring should be on point. If anyone has some insight to what might be happening, or has gone through a similar problem please post!

UPDATE *if you have an external cc3000 module, despite having an external power supply, both the power supply and the mbed need to have the same ground!!!!! This fixes my problem that I described!**

Question relating to:

This is the same issue as your question you asked here http://developer.mbed.org/questions/5377/Getting-Started-with-Sparkfun-cc3000-LPC/ You either still have a connection problem, or a power supply issue! You have not stated how you are connecting power to your mbed LPC1768 and the sparkfun CC3100. If you are using the same USB connection for both, then this now where the problem is. A single USB power connection cannot supply enough current for both boards. To get around this issue, use a seperate 5v power supply for your CC3000 board, or you can use a USB breakout board connected to a different USB port. If this does not solve the issue, re-check all of your connections.

Dave.

posted by David Fletcher 25 Nov 2014

Connection-wise how I am connecting the sparkfun cc3000 to the LPC1768:

MOSI - > mbed p5

MISO -> mbed p6

SCK -> mbed p7

CS -> mbed p8

INT -> mbed p9

EN -> mbed p10

init

cc3000 wifi(p9, p10, p8, SPI(p5, p6, p7), "ssid", "password", WPA2, false);

Power Supply-wise:

I have a usb powering the mbed and providing serial output. I have a SEPARATE USB female breakout that ONLY provides power to the cc3000 module at 5v 1A. This should be more than enough power for the module, yet the module still can't receive an event. I have switched out my wires multiple times to make sure it isn't my wires that are causing the disconnect. Since I am getting serial readout, I doubt it's a connection issue.

Also I read that if the DEBUG is not even giving me a mac address that it might be an SPI issue. However I've tried both SPI blocks that the mbed provides, so maybe the SPI interface is failing ?

posted by A L 25 Nov 2014
Be the first to answer this question.