ESP8266 Developer Zone The Official ESP8266 Forum 2016-11-23T20:11:51+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=22 2016-11-23T20:11:51+08:00 2016-11-23T20:11:51+08:00 https://bbs.espressif.com:443/viewtopic.php?t=22&p=10625#p10625 <![CDATA[Re: Prevent bootloader dump on startup]]> 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:

//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:

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


Sketch 2 (problem)

Code:

//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:

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.

Statistics: Posted by DhruvAcharya — Wed Nov 23, 2016 8:11 pm


]]>
2014-11-04T15:24:03+08:00 2014-11-04T15:24:03+08:00 https://bbs.espressif.com:443/viewtopic.php?t=22&p=78#p78 <![CDATA[Re: Prevent bootloader dump on startup]]> Statistics: Posted by muris — Tue Nov 04, 2014 3:24 pm


]]>
2014-11-03T23:20:15+08:00 2014-11-03T23:20:15+08:00 https://bbs.espressif.com:443/viewtopic.php?t=22&p=67#p67 <![CDATA[Re: Prevent bootloader dump on startup]]>
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. ;)

Statistics: Posted by costaud — Mon Nov 03, 2014 11:20 pm


]]>
2014-11-03T03:29:03+08:00 2014-11-03T03:29:03+08:00 https://bbs.espressif.com:443/viewtopic.php?t=22&p=55#p55 <![CDATA[Re: Prevent bootloader dump on startup]]>
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).

Statistics: Posted by muris — Mon Nov 03, 2014 3:29 am


]]>
2014-11-03T03:26:26+08:00 2014-11-03T03:26:26+08:00 https://bbs.espressif.com:443/viewtopic.php?t=22&p=54#p54 <![CDATA[Re: Prevent bootloader dump on startup]]>
That is to swap uart tx and rx pin to MTDO and MTCK ,via the code below.

Code:

#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.

Statistics: Posted by costaud — Mon Nov 03, 2014 3:26 am


]]>
2014-11-02T16:35:08+08:00 2014-11-02T16:35:08+08:00 https://bbs.espressif.com:443/viewtopic.php?t=22&p=49#p49 <![CDATA[Prevent bootloader dump on startup]]>
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

Statistics: Posted by muris — Sun Nov 02, 2014 4:35 pm


]]>