9 years, 8 months ago.

Adafruit CC3000 Wifi Shield + FRDMKL46Z: DHCP configure fail

Hello,

I am trying to get the Adafruit CC3000 Wifi shield working with a freescale FRDM-KL46z. I have been going around and around in circles for days, unable to proceed forward. It seems there are a number of other people asking questions about the Adafruit shield but I can't seem to find anyone one that can confirm it works with mbed.

To get started I am using the basic cc3000_hello_world_demo with the cc3000_hostdriver_mbedsocket library. All lastest versions.

My only changes are as follows:

main.cpp

//SSID & AP_KEY defined above

#elif (MY_BOARD == ADAFRUIT)

SPI spi(PTD6, PTD7, PTD5); //mosi, miso, sclk

cc3000 wifi(PTA12, PTA5, PTD4,spi, SSID, AP_KEY, AP_SECURITY, false); //create the wifi object

Serial pc(USBTX, USBRX);

#else

init.cpp

    NVIC_set_all_irq_priorities(3);

    NVIC_SetPriority(SPI1_IRQn, 0x0);
    NVIC_SetPriority(PORTA_IRQn, 0x1);

    // SysTick set to lower priority than Wi-Fi SPI bus interrupt
    NVIC_SetPriority(SysTick_IRQn, 0x2);

Everything compiles and loads ok. When I reset and run the board. Here is the output I get, with debugging enabled:

Quote:

  • [CC3000 : HCI TX] Command Sent : 0x4000
  • [CC3000 : HCI RX] Event Received : 0x4000
  • [CC3000 : HCI TX] Command Sent : 0x400B
  • [CC3000 : HCI RX] Event Received : 0x400B
  • [CC3000 : HCI TX] Command Sent : 0x2001
  • [CC3000 : HCI RX] Event Received : 0x2001 - DHCP
  • [CC3000 : HCI TX] Command Sent : 0x4000
  • [CC3000 : HCI RX] Event Received : 0x4000
  • [CC3000 : HCI TX] Command Sent : 0x400B
  • [CC3000 : HCI RX] Event Received : 0x400B
  • [CC3000 : HCI TX] Command Sent : 0x0008
  • [CC3000 : HCI RX] Event Received : 0x0008 - Event Mask
  • [CC3000 : HCI TX] Command Sent : 0x0004
  • [CC3000 : HCI RX] Event Received : 0x0004 - Connect Policy
  • [CC3000 : HCI TX] Command Sent : 0x0001
  • [CC3000 : HCI RX] Event Received : 0x0001 - Connecting
  • [CC3000] while(is_dhcp_configured)
  • [CC3000] Connection to AP failed
  • Failed to connect. Please verify connection details and try again.
  • [CC3000 : HCI TX] Command Sent : 0x0002
  • [CC3000 : HCI RX] Event Received : 0x0002 - Disconnect

I added the message, "while(is_dhcp_configured)" To indicate the the connection failure seems to occur in this while loop.

Things I have checked so far:

1. The board seems to be correctly powered. I checked the current with a multimeter and there seems to be no issues, the board is able to draw enough current. If the KL46Z is plugged into USB the 5v output pin comes straight from the USB according to the schematic. I tried multiple USB ports and computers. Always the same results. Either way the multimeter says the current is OK.

2. I haven't been able to confirm or update the firmware version. However Adafruit claims: "Adafruit CC3000 modules come with either firmware version 1.19 or 1.24." My shield works correctly with an arduino + the adafruit CC3000 library which checks the firmware version before it runs.

3. WPA2 secure wifi & a open wifi. Same results.

4. 3 different wifi routers.

5. I triple checked all the pins, messed around with the NVIC priority and added debug statements all over the library. All to no avail.

Can anyone confirm the adafruit cc3000 shield works with the cc3000_hostdriver_mbedsocket library? With any mbed platform? Anyone manage to make it work with the KL46z or any other freescale platform? Is there a function to read the firmware version? Any ideas to try?

Noah,

I think I have the KL46z. I need to find it first, then I will take a look at solving your problem. It may take me a day, so please wait, unless someone else can solve it for you.

Dave.

posted by David Fletcher 03 Aug 2014

Hi Dave, Thanks that would be great!

posted by Noah Shibley 04 Aug 2014

1 Answer

9 years, 8 months ago.

Noah,

I have now had a chance to look at your above posted problem. It works for me! using the Hello world demo. I have attached my program here /media/uploads/dflet/cc3000_hello_world_demo_kl46z_full.zip Please try it, you will need to insert your "ssid" and "key". Also note that their maybe a newer mbed lib than the one included, it maybe a good idea to update it. Please let me know how you get on.

Dave.

Hi Dave,

Hmmm, thats an interesting result. So no issues at all? I can't really see any real differences in your code. However I will give your code a try as soon as I am able. (busy week here.) I was wondering if your FRDM-KL46z firmware is up to date, I am thinking to update mine. Maybe there is an issue there. I will let you know about my results with your code soon.

Thanks Noah

posted by Noah Shibley 05 Aug 2014

Hi Dave,

Sorry for the slooow response. I finally got a chance to try your code. I had some issues updating my mbed board since I was away from home and didn't have access to a PC, only a mac. Anyway I updated the FRDM-KL46z firmware, tried your code and it still doesn't work. However I also got my hands on a friends adafruit cc3000 board and tried both your code and my previous code and they both work great!? So it seems there is something incompatible with my adafruit cc3000 shield and mbed. However I am currently not sure what the issue is. The shield still works with the arduino, so its clearly not broken. The only external differences between my shield and my friend shield is I have the SPI jumpers soldered on the bottom. As far as I can tell that shouldn't make a difference. I am going to check the shields firmware versions and see if there is a difference there.

posted by Noah Shibley 21 Aug 2014

So, nope the two shields list the same firmware version:

Initialising the CC3000 ... Firmware V. : 1.24

I used the adafruit CC3000 library test program for the arduino and was able to get the same 1.24 version result. I think this means that both shields have a firmware version of 1.11.1. 1.24 is the service pack version. So not the latest but not the oldest either. I was also able to connect to the wifi and ping adafruit.com with both shields.

So could the problem be with those SPI solder jumpers causing an issue for the FRDM-KL46z? Perhaps since the FRDM doesn't have SPI programmer pins on the end like an arduino. I assumed the shield would use the other SPI pins since they are other pins connected to nothing when plugged into the FRDM, but perhaps not. I guess there is only one way to find out. De-solder those jumpers

posted by Noah Shibley 21 Aug 2014