jeelabs / esp-link

esp8266 wifi-serial bridge, outbound TCP, and arduino/AVR/LPC/NXP programmer
Other
2.82k stars 720 forks source link

uC reset pulse length #403

Closed KjellVerb closed 5 years ago

KjellVerb commented 5 years ago

Hi, when measuring the pulse length of the reset I get about 2ms. This is too short for the debouncer that I have on that reset line. I want to stretch this but I can't find where exactly the 2ms comes from... Could somebody please help?

tve commented 5 years ago

https://github.com/jeelabs/esp-link/blob/master/serial/serbridge.c#L262

But there are other places too... Search for mcu_reset_pin...

KjellVerb commented 5 years ago

Thanks, I'll try it out and measure the result.

KjellVerb commented 5 years ago

I've adapted it but it seems that my self-built image just keeps the ESP in a reboot loop instead of starting up... I used docker to build the images on a WIN10 x64 PC, following the steps in the readme and adapting the command to "docker run -v ${PWD}:/esp-link jeelabs/esp-link" Any suggestions on what I'm doing wrong? EDIT: aside from not using Linux 😆

KjellVerb commented 5 years ago
python -m esptool --port COM7 --baud 460800 write_flash -fs 4m -ff 40m 0x1000 user1.bin 0x7E000
blank.bin 0x000 boot_v1.7.bin
WARNING: Flash size arguments in megabits like '4m' are deprecated.
Please use the equivalent size '512KB'.
Megabit arguments may be removed in a future release.
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 343828 bytes to 253221...
Wrote 343828 bytes (253221 compressed) at 0x00001000 in 21.1 seconds (effective 130.2 kbit/s)...

A fatal error occurred: Timed out waiting for packet header

This is what happens when flashing my self-built user1.bin, when flashing the one from the esp-link firmware drop it works perfectly fine.

KjellVerb commented 5 years ago

Fixed it... python -m esptool --port COM7 --baud 460800 write_flash --flash_size 512KB --flash_freq 40m 0x1000 user1.bin 0x7E000 blank.bin 0x7C000 esp_init_data_default.bin 0x000 boot_v1.7.bin

Now I was able to check the impact of my code change and it stretched the reset pulse as expected. Case closed!

Changes: here and here