BSP

eli@global-rd.com
Posts: 6
Joined: Thu Aug 04, 2016 4:14 pm

BSP

Postby eli@global-rd.com » Thu Aug 04, 2016 4:40 pm

Hi
I am new to the forum
I am an experienced designer, I developed a sensor that should send the data trough WiFi
I decided to use the ESP8266 for that, after analyzing the device trough the modules ESP-01 and SparkFun Ting Dev.
I developed my hardware accordingly with that boards but oppositely with the modules I can't program the flash on my PCB.
In order to simplify the debugging I did the following:
- Assembled a second PCB with only the essential part required for the ESP8266 to work
- Program the flash in the ESP-01 with a simple led blink program and transferred the programmed flash to my PCB
So the PCB should start working, but it doesn't, on the contrary of pin GPIO0 that should blink in the program I get 26MHz so:
- the ESP8266 works,
- the oscillator works,
- the power is 3.3V steady
- GPIO2 is all times High
- GPIO15 is all times Low
- GPIO0 is pulled HIGH during reset to boot from the Flash or Pulled LOW during reset to program the Flash from the UART
But I get 26MHz on GPIO0 all the time (but during reset)
- For GPIO0=HIGH@reset I read at 74888 on the serial monitor:
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
ets_main.c ְ

- For GPIO0=LOW@reset I read at 74888 on the serial monitor:
ets Jan 8 2013,rst cause:2, boot mode:(1,7)
sometimes
-ets Jan 8 2013,rst cause:2, boot mode:(1,6)

I try to program trough Arduino an I get the following message:
Uploading 223696 bytes from to flash at 0x00000000
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
error: espcomm_upload_mem failed

sometimes
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed


I could supply my drawing if required

What is the problem?

Thanks
Eli Jacob

pratik

Re: BSP

Postby pratik » Thu Aug 04, 2016 11:45 pm

Hello Eli,

Thank you for your interest in ESP8266!

I have a simple blinking LED (RTOS SDK based) demo on my website here:
http://www.pratikpanda.com/esp8266-blin ... d-example/

You may use that code for reference. Note that you must configure the compilation options correctly (such as flash size and whether flash is QIO or DIO, etc). ESP-01 module is not comfortable to work with, an ESP-12 is recommended. And finally, make sure you flashed the blank.bin and other .bin files right.
The 26MHz clock frequency on startup is normal. As for the espconn messages, you may ignore them if you are not really programming the Wi-Fi features for now. The ESP8266 defaults to station mode so you may get random messages if you did not initialize Wi-Fi.

Do let me know if you get the blinking LED code working.

eli@global-rd.com
Posts: 6
Joined: Thu Aug 04, 2016 4:14 pm

Re: BSP

Postby eli@global-rd.com » Fri Aug 05, 2016 2:17 am

Thank you for your answer however the problem is not software.
I found the problem while connecting a LSA to the pins of the Flash
It happens that the lines from ESP8266 to the flash are very short (under 1 cm) and there is not enough delay for correct flashing.
I will try and error what should be delayed, however I would prefer to have a more official answer on what should be the timing / or if clock should be delayed/ or if on the contrary data should be delayed / or what is really needed to reliable interface between the flash and the ESP 8266 .
I am using a 104MHz Flash , maybe you can recommend which one is best.

Note: since on the same PCB there are sensitive analog circuitry working from the same 3.3V supply, the 3.3V is very stable and with negligible noise.

By now my PCB work only with the LSA attached to the Flash pins (all of them)

Regards
Eli Jacob

pratik

Re: BSP

Postby pratik » Fri Aug 05, 2016 10:47 pm

Can you please provide your circuit diagram and if possible, the PCB layout? The ESP8266 can interface to QIO flash with trace lengths less than 1cm without any issues. However, if you are looking for PCB design troubleshooting, please make sure:
- Flash chip is functional and properly soldered
- trace lengths to all signal pins of flash are equal, clock trace can be about 20% longer
- make sure CLK signal line has source termination
You may refer to the schematic of the ESP-WROOM-02 module:
WROOM-02 schematic.png


As for flash chip, Winbond 25Qxx is a good place to start with.
From the information you provided in the first post, it seems like the data to/from the flash is getting corrupted. Can you please scope the signal pins (CLK and one data line) and share the screenshot?

eli@global-rd.com
Posts: 6
Joined: Thu Aug 04, 2016 4:14 pm

Re: BSP

Postby eli@global-rd.com » Mon Aug 08, 2016 4:20 pm

Hi
I scope the signals , however it must be taken in account several factors:
1- since the PCB is very small the image was taken using a tiny and relatively long wire for GND
2- The clock signal at the Flash (Yellow trace) is after 200ohm resistor +10pF (Scope probe loads)

I already noticed that those 10pF are minimum needed and 20pF (2 probes) work better:
With only one probe the ESP8266 got stuck once, with 2 it works non stop.

What is the correct timing?
Do you have information on what the signals timing should look like?
Is the data sampled by the ESP8266 at the rise or the fall edge?

Thanks
Eli Jacob
Attachments
MDBACX_PCB.GIF
G88A0FWW.png

eli@global-rd.com
Posts: 6
Joined: Thu Aug 04, 2016 4:14 pm

Re: BSP

Postby eli@global-rd.com » Mon Aug 08, 2016 5:09 pm

Hi
About my drawing.
Since I had problems with the full circuit I partially assembled one PCB with the attached circuit.
All the Flashing and blink programming run was tested on it.
It is essentially the same as your circuit with the addition of the default boot pins.
Attachments
MDBACXflash_SHT.GIF

eli@global-rd.com
Posts: 6
Joined: Thu Aug 04, 2016 4:14 pm

Re: BSP

Postby eli@global-rd.com » Wed Aug 10, 2016 2:32 pm

Hi
I found that an addition to the ckock line of a 10pF capacitor to ground at the flash solves the problem.
That also fit with the large value resistor of 200ohm, that's no termination, termination would be 33ohm, 200ohm+parasite capacitance of the PCB is delay, in my case short lines of only 4 mill wide have very small capacitance.
Therefore in my case the addition of 10pF can be required.
It also fit with Partik say that clock line can be 20% longer, that is also delay.

However I would like to know what is the optimal delay value between clock and data, instead of guessing.
Do anyone have that value?

pratik

Re: BSP

Postby pratik » Thu Aug 11, 2016 2:01 pm

Hello,

Most designs with the grounded metal shielding can and ground plane included usually make up for over 10pF capacitance. There are some good PCB trace capacitance estimators available which you can use in case of your particular design.
The screenshot where you attached 20pF load probe seems pretty good to me for entering data at the rising edge of the clock!
Also, the 200 ohm resistance is not really just termination, it is also needed to limit the transition current so that the digital noise is not too severe. ESP8266 has rather powerful GPIO driving capability. RF circuits get way complicated, especially when you have everything on just one chip!

As for the timings, the flash chip datasheet is the way to go. If you want to manipulate the SPI bus timing, you may use the SPI register descriptions and do so, but that is not recommended. The best option would be to check the flash chip's pin characteristics and match things as required. From my experience, it is the flash chip that causes issues most of the time.
Sorry but the PCB layout component markings are not clear, extremely difficult to make out details. But I don't see a ground plane below signal traces. You probably have it hidden? It is necessary to have that even though space is constrained.

eli@global-rd.com
Posts: 6
Joined: Thu Aug 04, 2016 4:14 pm

Re: BSP

Postby eli@global-rd.com » Fri Aug 12, 2016 1:17 am

Thanks Pratik

The Ground Plane and Power plane are hidden, to make the image more clear.
With 10pF I always can program, no problems.
But still sometimes the ESP8266 doesn't correctly boot from Flash.
Increasing the capacitance to 22pF make it better.
I am using a 104MHz Flash
It is better to use a slower speed?

pratik

Re: BSP

Postby pratik » Fri Aug 12, 2016 10:45 am

Hello,

The flash access speed should be 40MHz. Faster the flash specification, the better it should be.
If you doubt the flash chip series (if it is compatible or not), you may try simply dropping the flash into a working, readily available ESP-8266 module. If that also fails, you know something is wrong with the choice of flash.

Who is online

Users browsing this forum: No registered users and 3 guests