esp32: viper tests fail after a while
If I execute a micropython/viper test on an esp32 in a loop it starts failing after a while (I started with a HW reset before this):
> while true; ./run-tests --device /dev/ttyUSB0 --target esp32 micropython/
viper_ptr32_load.py; end
pass micropython/viper_ptr32_load.py
1 tests performed (4 individual testcases)
1 tests passed
[...]
pass micropython/viper_ptr32_load.py
1 tests performed (4 individual testcases)
1 tests passed
FAIL micropython/viper_ptr32_load.py
1 tests performed (4 individual testcases)
0 tests passed
1 tests failed: viper_ptr32_load
skip micropython/viper_ptr32_load.py
0 tests performed (0 individual testcases)
0 tests passed
1 tests skipped: viper_ptr32_load
It takes less than a minute to get there. I noticed because running the full test suite shows this, e.g.:
> ./run-tests --device /dev/ttyUSB0 --target esp32 -d micropython
[...]
pass micropython/viper_misc_intbig.py
pass micropython/viper_ptr16_load.py
pass micropython/viper_ptr16_store.py
pass micropython/viper_ptr32_load.py
pass micropython/viper_ptr32_store.py
FAIL micropython/viper_ptr8_load.py
FAIL micropython/viper_ptr8_store.py
FAIL micropython/viper_subscr.py
FAIL micropython/viper_try.py
FAIL micropython/viper_types.py
FAIL micropython/viper_with.py
65 tests performed (411 individual testcases)
59 tests passed
4 tests skipped: heap_locked heapalloc_bytesio2 meminfo memstats
6 tests failed: viper_ptr8_load viper_ptr8_store viper_subscr viper_try viper_types viper_with
The tests that fail at the end are because they're at the end, not because they fail per-se.
esp8266 viper: simple test program is instable
Hello Damien. Thanks a lot for fixing the assembler version. Now, the equivalent viper version runs into reset, which used to work before:
def loop():
import machine
machine.Pin(4, machine.Pin.OUT, value=0)
do_loop()
print("Done")
@micropython.viper
def do_loop():
GPIO_OUT_SET = ptr32(0x60000304) # GPIO Output set
GPIO_OUT_CLR = ptr32(0x60000308) # GPIO Output clear
for i in range(10):
GPIO_OUT_SET[0] = 0x10 # set bit 4
GPIO_OUT_CLR[0] = 0x10 # clear bit 4
Sometimes, it can be called a few times before it breaks.
MicroPython v1.8.6-205-g91359c8-dirty on 2016-12-19; ESP module with ESP8266
Error Report:
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x40100000, len 32012, room 16
tail 12
chksum 0xc4
ho 0 tail 12 room 4
load 0x3ffe8000, len 1080, room 12
tail 12
chksum 0x33
ho 0 tail 12 room 4
load 0x3ffe8440, len 3000, room 12
tail 12
chksum 0xf9
csum 0xf9
A simpler viper code which just adds up a number in a loop and returns the value is stable.
P.S.: I have written that as a comment in the closed previous issue, but I do not know whether this is noticed.