GPIO9 and GPIO10 cause wdt reset

gailu
Posts: 49
Joined: Fri May 29, 2015 2:03 pm

GPIO9 and GPIO10 cause wdt reset

Postby gailu » Thu Jun 25, 2015 4:56 pm

Hi Experts,

We are using ESP-12E board from AI Thinker and SDK1.1.0 (esp_iot_sdk_v1.1.0_15_05_26.zip).

ESP-12E has two additional GPIO pins (GPIO9 and GPIO10) that were not there in ESP-12 board. We are trying to use these additional GPIO pins and configured the mux according but we are facing wdt rest if we output any value on these pins. Below is out user_init.c file to reproduce the problem

Code: Select all

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"
#include "gpio.h"

void user_rf_pre_init(void)
{
}

void user_init(void)
{
    uart_reattach();

    os_printf("SDK version:%s\n", system_get_sdk_version());

    PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA2_U, FUNC_GPIO9);
    GPIO_OUTPUT_SET(GPIO_ID_PIN(9), 0);
    PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA3_U, FUNC_GPIO10);
    GPIO_OUTPUT_SET(GPIO_ID_PIN(10), 0);
}


If we use other pins like GPIO14 it works fine and we do not see any wdt reset. Please see code working below for GPIO14

Code: Select all

#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"
#include "gpio.h"

void user_rf_pre_init(void)
{
}

void user_init(void)
{
    uart_reattach();

    os_printf("SDK version:%s\n", system_get_sdk_version());

    PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, FUNC_GPIO14);
    GPIO_OUTPUT_SET(GPIO_ID_PIN(14), 0);
}


Can you please let us know if anything special is required to use GPIO9 and GPIO10 on ESP-12E board

Thank you in advance.

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: GPIO9 and GPIO10 cause wdt reset

Postby rudi » Thu Jun 25, 2015 11:22 pm

gailu wrote:Hi Experts,

We are using ESP-12E board from AI Thinker and SDK1.1.0 (esp_iot_sdk_v1.1.0_15_05_26.zip).

ESP-12E has two additional GPIO pins (GPIO9 and GPIO10) that were not there in ESP-12 board. We are trying to use these additional GPIO pins and configured the mux according but we are facing wdt rest if we output any value on these pins. Below is out user_init.c file to reproduce the problem




Hi

i think this will be the right for you:

"Flashing firmware
Changes to firmware required to select Dual I/O mode instead of Quad I/O mode. Otherwise the module will not boot. Depending on tools used to build and flash your firmware the required steps may differ.

If the firmware is created with "esptool.py elf2image" then you need to add "--flash_mode dio" option.

$(ESPTOOL) elf2image --flash_mode dio ...Alternatively patch the 0x00000.bin file manually - change low nibble of the third byte form 0x0 to 0x2

"

Code: Select all

// Example code using GPIO9 and GPIO10
// Note, the following code will not work as expected on unmodified hardware
// *****************************************************************************************

// assign SD_DATA2 and SD_DATA2 GPIO function
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA2_U, FUNC_GPIO9);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA3_U, FUNC_GPIO10);

// set GPIO9 and GPIO10 low
gpio_output_set(0, BIT9, BIT9, 0);
gpio_output_set(0, BIT10, BIT10, 0);

// set GPIO9 and GPIO10 high
gpio_output_set(BIT9, 0, BIT9, 0);
gpio_output_set(BIT10, 0, BIT10, 0);





perhabs this helps?

short version: see pic

the long version you will find here:
http://smarpl.com/content/esp8266-esp-2 ... and-gpio10


best wishes
rudi ;-)
Attachments
schematics.png
schematics.png (15.96 KiB) Viewed 22536 times

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

gailu
Posts: 49
Joined: Fri May 29, 2015 2:03 pm

Re: GPIO9 and GPIO10 cause wdt reset

Postby gailu » Fri Jun 26, 2015 1:34 am

Hi Rudi,

Thank you very much for the details and link. I built image with DIO option instead of QIO and also selected DIO option in flash download tool while flashing image with no luck. I believe it is not possible to use them on ESP12-E without hardware modification similar to what is suggested in the link.

These extra pins are useless and can not be used for GPIO. They can be used only for external flash I believe. Not sure who really need them as this module already have 4MB flash.

Thank you again.

Adex
Posts: 2
Joined: Wed Jan 14, 2015 3:54 am

Re: GPIO9 and GPIO10 cause wdt reset

Postby Adex » Sun Jul 19, 2015 2:21 am

If you want to use GPIO9 and GPIO10 you must lift flash pins (3 - WP and 7 - HOLD) and pull up to VCC, then you can use these GPIOs (9&10).

When flashing firmware (for example with Espressif Flash Tool) you must select DIO mode or change it manually in firmware.

csc13
Posts: 1
Joined: Sun Jun 12, 2016 7:57 am

Re: GPIO9 and GPIO10 cause wdt reset

Postby csc13 » Sun Jun 12, 2016 8:09 am

Hi,
I had the same problem using the ESP Flash Download Tool v2.4. I had some circuit connected to GPIO9 and GPIO10 pulling these high. Also changing to from QUAD to DIO in the flash tool didn't help. After disconnecting these two pins the flash process worked.

I now guess, that the DIO option in the flash tool changes the firmware binary used for flashing. But since installed firmware on the ESP-12-E module is a QUAD version, the flash operation would not work.

I did not test, but after flashing with a DIO version (with GPIO9 and 10 disconnected) later flashing attempts should work.

Am i correct? Can someone please confirm or correct this?

I write these lines, since this problem costs me a full day.

Thanks,
Christian

bad_mood
Posts: 1
Joined: Mon Jun 13, 2016 10:31 pm

Re: GPIO9 and GPIO10 cause wdt reset

Postby bad_mood » Tue Jun 14, 2016 4:24 pm

Hey !
For the ESP12-E module, the GPIO 9 and GPIO 10 pins can be used with DIO flash mode. Yes, it can be done and I have done it. When using the esptool.py, set the --flash_mode dio option for the write_flash option. You can also use GHex (.bin file editor program) to manually change the yourfilename-0x00000.bin file obtained after making, although I did not need to do that. Since the GPIOs 9 and 10 are available to us there is no need for hardware modification. Also, I would like to mention that this procedure was not successful with Nodemcu module (LoLin board) that I have.

Code: Select all

#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "os_type.h"

static const int pin = 10;
static volatile os_timer_t some_timer;

void some_timerfunc(void *arg)
{
  //Do blinky stuff
  if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & (1<<pin))
  {
    // set gpio low
    gpio_output_set(0, (1<<pin), 0, 0);
  }
  else
  {
    // set gpio high
    gpio_output_set((1<<pin), 0, 0, 0);
  }
}

void ICACHE_FLASH_ATTR user_init()
{
  // init gpio subsytem
  gpio_init();

  // configure UART TXD to be GPIO1, set as output
  PIN_FUNC_SELECT(PERIPHS_IO_MUX_SD_DATA3_U , FUNC_GPIO10);
  gpio_output_set(0, 0, (1<<pin), 0);

  // setup timer (500ms, repeating)
  os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);
  os_timer_arm(&some_timer, 500, 1);
}


This is the version of Blinky I ran successfully on the GPIO 10 of the ESP12-E module. Hope this helps ! Cheers :D

Who is online

Users browsing this forum: No registered users and 290 guests