Prevent bootloader dump on startup

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

Prevent bootloader dump on startup

Postby muris » Sun Nov 02, 2014 4:35 pm

Hello,

Is there any way to disable the bootloader dumping startup information on UART? Should I use UART1 instead?

I am going to make a bridge (connect) ESP8266 to XBEE and this bootloader information is being transferred to XBEE on startup :?

Regards,
Muris

costaud
Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

Re: Prevent bootloader dump on startup

Postby costaud » Mon Nov 03, 2014 3:26 am

There is a indirect way to prevent uart output during startup period.

That is to swap uart tx and rx pin to MTDO and MTCK ,via the code below.

Code: Select all

#define FUNC_U0CTS    4
#define FUNC_U0RTS    4

void user_init(void)
{
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, FUNC_U0CTS);//CONFIG MTCK PIN FUNC TO U0CTS
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_U0RTS);//CONFIG MTDO PIN FUNC TO U0RTS
SET_PERI_REG_MASK(0x3ff00028 , BIT2);//SWAP PIN : U0TXD<==>U0RTS(MTDO) , U0RXD<==>U0CTS(MTCK)
......
}


original func:
U0TXD=>pin:U0TXD
U0RXD=>pin:U0RXD
U0CTS=>pin:MTCK
U0RTS=>pin:MTDO

after pin swap:
U0TXD=>pin:MTDO
U0RXD=>pin:MTCK
U0CTS=>pin:U0RXD
U0RTS=>pin:U0TXD

So that you can connect the MTDO and MTCK to MCU port as UART tx/rx.
The bootup info will be output via U0TXD pin , but after start-up, the UART0 output data via MTDO and receive via MTCK.

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

Re: Prevent bootloader dump on startup

Postby muris » Mon Nov 03, 2014 3:29 am

Ok, thank you very much for this.

Also, where can I download the latest "Download Tool" to flash the chip? I am currently using the python version... (I saw your screenshot on another post).

costaud
Posts: 138
Joined: Fri Oct 24, 2014 7:40 pm

Re: Prevent bootloader dump on startup

Postby costaud » Mon Nov 03, 2014 11:20 pm

muris wrote:Ok, thank you very much for this.

Also, where can I download the latest "Download Tool" to flash the chip? I am currently using the python version... (I saw your screenshot on another post).


This tool is also based on the esptool.py and use wxpython2.8 for the GUI.I will post the source code soon. ;)

muris
Posts: 35
Joined: Fri Oct 24, 2014 7:25 pm
Location: Bosnia-Herzegovina
Contact:

Re: Prevent bootloader dump on startup

Postby muris » Tue Nov 04, 2014 3:24 pm

Ok thanks for all the help!

DhruvAcharya
Posts: 1
Joined: Wed Nov 23, 2016 8:04 pm

Re: Prevent bootloader dump on startup

Postby DhruvAcharya » Wed Nov 23, 2016 8:11 pm

Problem Description
I am using Arduino IDE to program ESP-12E. I want to use Serial.swap() and send-receive my application data on D15-D13 after boot-up in binary form. But after Serial.swap(), it can not send 0x00 data on UART. I have tried two sketches, which involves cases of not using and using of "Serial.swap()". I tried to send 0x00 0x01 0x02 in loop in both cases. I am using Serial.swap() after having the need of connecting other MCU on UART with ESP. I have searched this page and this thread. which suggest me that actually I can use this Serial.swap() which will avoid the startup dump and programming problem with UART0 and use this out of box UART0 for data communication.

Hardware
Hardware: ESP-12E
Core Version: 2.3.0

Settings in IDE
Module: Generic ESP8266 Module (ESP-12E)
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 80Mhz
Upload Using: SERIAL
Reset Method: nodemcu

System Setup
I am using ESP-12E, a separate power supply and programing it with Serial to TTL in Arduino Eclipse Plug-in called Sloeber. I am using terminal.exe as my Serial Monitor. I have connected second Serial To TTL on D15-D13, for Serial.swap() UART.

Codes and Outputs are as follows:

Sketch 1 (successful)

Code: Select all

//The setup function is called once at startup of the sketch
void setup()
{
   Serial.begin(115200);
}

// The loop function is called in an endless loop
void loop()
{
   for(uint8_t i=0;i<3;i++)
   {
      Serial.write(i);
      delay(1000);
   }
}


Output at terminal.exe in HEX mode

Code: Select all

00 01 02 00 01 02 00 01 02 00 01 02


Sketch 2 (problem)

Code: Select all

//The setup function is called once at startup of the sketch
void setup()
{
   Serial.begin(115200);

   // Swap serial port to continue on other uart.
   Serial.swap();
}

// The loop function is called in an endless loop
void loop()
{
   for(uint8_t i=0;i<3;i++)
   {
      Serial.write(i);
      delay(1000);
   }
}


Output 2 in terminal.exe in Hex mode

Code: Select all

01 02 01 02 01 02 01 02


The problem is when I use Serial.swap() it does not send the 0x00 data on UART. Am I missing something?

Original thread is here
I have also tired Software Serial, but with the same problem and result. Original discussion I have posted here.
I have also raised the issue with github.
Please have a look and help.

Who is online

Users browsing this forum: No registered users and 13 guests