The reasons I have described above lead me to ask you whether you can help somehow ... either modify something within the MP or give a good advice on how to deal with this problem. I communicate with the author of uPL and he will surely be able to do anything needed on his side. Many thanks in advance for your help.
Code: Select all
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:4332
load:0x40078000,len:0
load:0x40078000,len:10992
entry 0x4007a6c4
[0;32mI (204) cpu_start: Pro cpu up.[0m
[0;32mI (204) cpu_start: Single core mode[0m
[0;32mI (205) heap_init: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (208) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM[0m
[0;32mI (214) heap_init: At 3FFDCD60 len 000032A0 (12 KiB): DRAM[0m
[0;32mI (220) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM[0m
[0;32mI (227) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (233) heap_init: At 4008FC7C len 00010384 (64 KiB): IRAM[0m
[0;32mI (239) cpu_start: Pro cpu start user code[0m
[0;32mI (33) cpu_start: Starting scheduler on PRO CPU.[0m
OSError: [Errno 2] ENOENT
MicroPython v1.9.2-443-g236297f4 on 2017-11-04; ESP32 module with ESP32
Type "help()" for more information.
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== #V1
=== from machine import UART
=== import time
===
=== def read_timeout(uart, cnt, retries=1000):
=== data = b""
=== for i in range(0, retries):
=== rec = uart.read(cnt - len(data))
=== if rec:
=== data += rec
=== if len(data) == cnt:
=== return data
=== time.sleep(0.01)
=== return None
===
=== def main():
=== uart = UART(0, 115200)
=== suc = False
=== with open("__upload.py", "wb") as f:
=== while True:
=== d = read_timeout(uart, 2)
=== if not d or d[0] != ord("#"):
=== x = uart.write(b"#2")
=== break
=== cnt = d[1] & 0x7F
=== if cnt == 0:
=== suc = True
=== break
=== d = read_timeout(uart, cnt)
=== if d:
=== esc = False
=== for c in d:
=== if c == 0:
=== esc = True
=== continue
=== x = f.write(bytes([c & 0x0F if esc else c]))
=== esc = False
=== x = uart.write(b"#1")
=== else:
=== x = uart.write(b"#3")
=== break
=== x = uart.write(b"#1#" if suc else b"#0#")
===
=== main()
===
Traceback (most recent call last):
File "<stdin>", line 44, in <module>
File "<stdin>", line 17, in main
ValueError: UART(0) is disabled (dedicated to REPL)
>>> V1from machine import UARTimport timedef read_timeout(uart,file_name="__download.py"
... with open("__upload.py") as f:
... exec(f.read(), globals())
... V1from machine import UARTimport timedef read_timeout(uart
>>>
>>>
>>>