ESP8266-01S causes FRDM-K64F to not power on after making connections.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ESP8266-01S causes FRDM-K64F to not power on after making connections.

跳至解决方案
312 次查看
mitgobla
Contributor II

Hello, I am trying to use an ESP8266-01S from AZDelivery to function with my FRDM-K64F board.

Before I have been able to start any programming, the board does not power on as soon as I make the required connections with the ESP8266-01S. My connections are as follows:

3V3 -> 3V3
RX -> TX (PTC17/D1)
RST -> NC
IO0 -> NC
EN -> 3V3
IO2 -> NC
TX -> RX (PTC16/D0)
GND -> GND

As soon as I disconnect the 3v3 or GND lead from the ESP8266-01S, the microcontroller boots as normal. From what I could find little of online, most mention that it is a power output issue. I am powering the FRDM-K64F over USB from a USB-3 port on my computer. No other components at this time are being used on the board.

I am hoping there is a solution that I have missed. The only post I could find online with the FRDM-K64F is using an ESP8266 module, not the 01S variant. This also required them to use an external power supply and level converter. I believe the only other option is to use an external power source and then use a level converter to go from 5V to 3.3V, and share a common ground. Sadly this option isn't too viable for me as I am working inside a restricted project box size, but I can consider it with some more research.

Any help is massively appreciated.

标签 (1)
0 项奖励
1 解答
174 次查看
mitgobla
Contributor II

I just want to confirm that I finally got this working!

I did get a replacement ESP8266 board in the end, as I noticed the original one wouldn't blink the onboard LED during boot. Whereas the replacement did.

I still had quite the struggle to get any code to work, and getting the controller to respond to AT commands.

In the end, it was down to starting up the ESP8266 driver in client mode, which wasn't clear from other examples I saw online from older versions of Mbed.

I did purchase some 5v to 3v3 level converters which worked exactly as expected - I got my multimeter to confirm it was outputting 3.3V before connecting up the ESP8266 so I wouldn't accidentally fry it.

I am also powering it from the power bank, not from the 3.3V/5V output on the FRDM-K64F board.

Then for pinout from ESP8266 to breadboard/FRDM board:
VCC -> 3V3
CHPD(ENABLE) -> 3V3
TXD -> RXD (D0)
RXD -> TXD (D1)
GP0 -> 3V3 (or leave disconnected)

I didn't use the J199 pins in the end.

I tried numerous different versions of code, including using the FRDM board as a middleman serial between my PC and the ESP8266. I would get no response or AT timeouts. Even tried updating the firmware to no evail. Finally, after reading through the driver code and running the startup method, I could see networks being printed in the terminal.

I never like those forum posts that say they solved the problem without giving the solution. Here is my code now:

 

#include "mbed.h"
#include "ESP8266.h"

// Debug is true so I could figure out what was happening.
ESP8266 wifi(ARDUINO_UNO_D1, ARDUINO_UNO_D0, true);

// Built-in LED on FRDM-K64F board. Red for no networks, green for networks found.
DigitalOut red(LED1);
DigitalOut green(LED2);

// Store up to 10 results
WiFiAccessPoint accessPoints[10];
WiFiAccessPoint* accessPointsPointer = accessPoints;

// main() runs in its own thread in the OS
int main()
{
    red = 1;
    green = 1;
    // Verify that we start up in client mode.
    if (wifi.startup(1)) {
        printf("Startup: yes\n");
    } else {
        printf("Startup: no\n");
    }
    ThisThread::sleep_for(1s);
    // Verify we can start sending AT commands.
    if (wifi.at_available()) {
        printf("Available: yes\n");
    } else {
        printf("Available: no\n");
    }
    ThisThread::sleep_for(1s);
    while (true) {
        ThisThread::sleep_for(2s);
        printf("Scanning...\n");
        int count = wifi.scan(accessPointsPointer, 10, wifi.SCANMODE_ACTIVE, ESP8266_SCAN_TIME_MIN_DEFAULT, ESP8266_SCAN_TIME_MAX_DEFAULT);
        if (count <= 0) {
            red = 0;
            green = 1;
            printf("No networks found.\n");
        } else {
            printf("Number of networks found: %d\n", count);
            red = 1;
            green = 0;
            for (int i = 0; i < count; i++) {
                printf("- Network: %s RSSI: %d\n", accessPoints[i].get_ssid(), accessPoints[i].get_rssi());
            }
        }
    }
}

 

I hope anyone else in the future who comes across this problem can be saved by this post, I can't estimate how many hours I spent trying to get this working. Now to make some wireless stuff!

在原帖中查看解决方案

0 项奖励
4 回复数
285 次查看
mitgobla
Contributor II

Hi, apologies for not understanding the terminology, do you mind explaining what the J199 is for the FRDM-K64F, I couldn't find information on what that is.

If what you've mentioned that the 3.3VDC can provide a maximum of 120mA, then it is likely that the ESP8266-01S is consuming more than that during immediate connection as it can spike up to 430mA. Its likely I will have to use a separate 5V input and use a level converter to step down to 3.3V.

I'm in the process of getting a total power consumption of the system, my current multimeter decided not to function.

0 项奖励
273 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I attached the image from the schematic about the max current with the USB cable is 40ma. Maybe you could use a USBmeter to check the maximum current with devices attached.

Pavel_Hernandez_0-1711504602356.png

This is the J199 that was mentioned on the thread that you put in your last message, did you test it here?

Pavel_Hernandez_1-1711504656544.png

Best regards,
Pavel

0 项奖励
175 次查看
mitgobla
Contributor II

I just want to confirm that I finally got this working!

I did get a replacement ESP8266 board in the end, as I noticed the original one wouldn't blink the onboard LED during boot. Whereas the replacement did.

I still had quite the struggle to get any code to work, and getting the controller to respond to AT commands.

In the end, it was down to starting up the ESP8266 driver in client mode, which wasn't clear from other examples I saw online from older versions of Mbed.

I did purchase some 5v to 3v3 level converters which worked exactly as expected - I got my multimeter to confirm it was outputting 3.3V before connecting up the ESP8266 so I wouldn't accidentally fry it.

I am also powering it from the power bank, not from the 3.3V/5V output on the FRDM-K64F board.

Then for pinout from ESP8266 to breadboard/FRDM board:
VCC -> 3V3
CHPD(ENABLE) -> 3V3
TXD -> RXD (D0)
RXD -> TXD (D1)
GP0 -> 3V3 (or leave disconnected)

I didn't use the J199 pins in the end.

I tried numerous different versions of code, including using the FRDM board as a middleman serial between my PC and the ESP8266. I would get no response or AT timeouts. Even tried updating the firmware to no evail. Finally, after reading through the driver code and running the startup method, I could see networks being printed in the terminal.

I never like those forum posts that say they solved the problem without giving the solution. Here is my code now:

 

#include "mbed.h"
#include "ESP8266.h"

// Debug is true so I could figure out what was happening.
ESP8266 wifi(ARDUINO_UNO_D1, ARDUINO_UNO_D0, true);

// Built-in LED on FRDM-K64F board. Red for no networks, green for networks found.
DigitalOut red(LED1);
DigitalOut green(LED2);

// Store up to 10 results
WiFiAccessPoint accessPoints[10];
WiFiAccessPoint* accessPointsPointer = accessPoints;

// main() runs in its own thread in the OS
int main()
{
    red = 1;
    green = 1;
    // Verify that we start up in client mode.
    if (wifi.startup(1)) {
        printf("Startup: yes\n");
    } else {
        printf("Startup: no\n");
    }
    ThisThread::sleep_for(1s);
    // Verify we can start sending AT commands.
    if (wifi.at_available()) {
        printf("Available: yes\n");
    } else {
        printf("Available: no\n");
    }
    ThisThread::sleep_for(1s);
    while (true) {
        ThisThread::sleep_for(2s);
        printf("Scanning...\n");
        int count = wifi.scan(accessPointsPointer, 10, wifi.SCANMODE_ACTIVE, ESP8266_SCAN_TIME_MIN_DEFAULT, ESP8266_SCAN_TIME_MAX_DEFAULT);
        if (count <= 0) {
            red = 0;
            green = 1;
            printf("No networks found.\n");
        } else {
            printf("Number of networks found: %d\n", count);
            red = 1;
            green = 0;
            for (int i = 0; i < count; i++) {
                printf("- Network: %s RSSI: %d\n", accessPoints[i].get_ssid(), accessPoints[i].get_rssi());
            }
        }
    }
}

 

I hope anyone else in the future who comes across this problem can be saved by this post, I can't estimate how many hours I spent trying to get this working. Now to make some wireless stuff!

0 项奖励
295 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, I reviewed the thread and your issue, but I need more information, what is the behavior if you use the same J199? What is the power consumption in total? 

Pavel_Hernandez_0-1711401791893.png

this is the maximum using USB as a power supply.

Best regards,
Pavel

0 项奖励