Time keeping with utime
Time keeping with utime
Some days ago I bought an esp32 and a pysense board. After several hours of struggling I can now read all the sensors of the pysense board.
However, for the time keeping I would like to measure time in seconds with at least one decimal.
I tried
start=time.ticks_ms()
followed by
print( time.ticks_diff(start, time.ticks_ms()))
only resulting in the following error message (and a lot more garbage):
Guru Meditation Error of type LoadProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0x400ed168 PS : 0x00060f30 A0 : 0x800fd348 A1 : 0x3ffc6120
A2 : 0x00000000 A3 : 0x00060f23 A4 : 0x00060f20 A5 : 0x00000002
A6 : 0x0000002a A7 : 0x3ffc62f0 A8 : 0x00000000 A9 : 0x3ffc6110
A10 : 0x00000000 A11 : 0x00060f23 A12 : 0x00060f20 A13 : 0x00000000
A14 : 0x0000000a A15 : 0x3ffc62d0 SAR : 0x0000000c EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
Backtrace: 0x400ed168:0x3ffc6120 0x400fd348:0x3ffc6140 0x400ef3d9:0x3ffc6160 0x400eb9d8:0x3ffc6180 0x400eba40:0x3ffc61a0 0x400f75b8:0x3ffc61c0 0x400ef48b:0x3ffc6260 0x400eb9d8:0x3ffc62f0 0x400eba05:0x3ffc6310 0x400d948e:0x3ffc6330 0x400d972f:0x3ffc63d0 0x400d885f:0x3ffc6410
================= CORE DUMP START =================
9CEAAAoAAABsAQAA
QET8P2Bg/D+oZfw/
AGL8P0Bl/D+mswIAUEH8P1BB/D9ARPw/SEH8PxQAAAAAAAAAAAAAAEBE/D8AAAAA
BQAAAKxF/D9NaWNyb1B5AAAAAAAAAAAAAAAAAKhl/D8AAAAAIQAGAAUAAAABAAAA
AAAAAAxt/D8AAAAAAAAAAAAAAACYZPk/eGT5P1hk+T8AAAAAAAAAAAEAAAAAAAAA
pM5CPwAAAABIHQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAA==
I also tried utime with no better results.
How can I get an accurate time keeping with micropython?
However, for the time keeping I would like to measure time in seconds with at least one decimal.
I tried
start=time.ticks_ms()
followed by
print( time.ticks_diff(start, time.ticks_ms()))
only resulting in the following error message (and a lot more garbage):
Guru Meditation Error of type LoadProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0x400ed168 PS : 0x00060f30 A0 : 0x800fd348 A1 : 0x3ffc6120
A2 : 0x00000000 A3 : 0x00060f23 A4 : 0x00060f20 A5 : 0x00000002
A6 : 0x0000002a A7 : 0x3ffc62f0 A8 : 0x00000000 A9 : 0x3ffc6110
A10 : 0x00000000 A11 : 0x00060f23 A12 : 0x00060f20 A13 : 0x00000000
A14 : 0x0000000a A15 : 0x3ffc62d0 SAR : 0x0000000c EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000
Backtrace: 0x400ed168:0x3ffc6120 0x400fd348:0x3ffc6140 0x400ef3d9:0x3ffc6160 0x400eb9d8:0x3ffc6180 0x400eba40:0x3ffc61a0 0x400f75b8:0x3ffc61c0 0x400ef48b:0x3ffc6260 0x400eb9d8:0x3ffc62f0 0x400eba05:0x3ffc6310 0x400d948e:0x3ffc6330 0x400d972f:0x3ffc63d0 0x400d885f:0x3ffc6410
================= CORE DUMP START =================
9CEAAAoAAABsAQAA
QET8P2Bg/D+oZfw/
AGL8P0Bl/D+mswIAUEH8P1BB/D9ARPw/SEH8PxQAAAAAAAAAAAAAAEBE/D8AAAAA
BQAAAKxF/D9NaWNyb1B5AAAAAAAAAAAAAAAAAKhl/D8AAAAAIQAGAAUAAAABAAAA
AAAAAAxt/D8AAAAAAAAAAAAAAACYZPk/eGT5P1hk+T8AAAAAAAAAAAEAAAAAAAAA
pM5CPwAAAABIHQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAA==
I also tried utime with no better results.
How can I get an accurate time keeping with micropython?
Re: Time keeping with utime
That seems to be the wrong forum for your questions, since pysense is a Pycom product. You may better ask at forum.pycom.io.
Besides that, it is not clear why ticks_ms and ticks_diff should cause a core dump. Please post also you firmware version and the ESP32 board model.
Besides that, it is not clear why ticks_ms and ticks_diff should cause a core dump. Please post also you firmware version and the ESP32 board model.
Re: Time keeping with utime
I use esp32-20180920-v.1.9.4-560-g185716514.
I thought that micropython is micropython but I have seen so many strange errors (some times my programs run perfectly, other times the very same programs crash with mysterious error messages). So now I have the suspicion that I use the wrong firmware for my esp32 pycom wipy3.0 wifi Bluetooth module. But what is then the correct firmware? And where can I find it?
I thought that micropython is micropython but I have seen so many strange errors (some times my programs run perfectly, other times the very same programs crash with mysterious error messages). So now I have the suspicion that I use the wrong firmware for my esp32 pycom wipy3.0 wifi Bluetooth module. But what is then the correct firmware? And where can I find it?
Re: Time keeping with utime
http://micropython.org/download#esp32priis wrote: ↑Wed Sep 26, 2018 6:49 pmI use esp32-20180920-v.1.9.4-560-g185716514.
I thought that micropython is micropython but I have seen so many strange errors (some times my programs run perfectly, other times the very same programs crash with mysterious error messages). So now I have the suspicion that I use the wrong firmware for my esp32 pycom wipy3.0 wifi Bluetooth module. But what is then the correct firmware? And where can I find it?
Re: Time keeping with utime
... Sorry, my firmware is
MicroPython v1.8.6-621-g17ee404e on 2017-05-25; WiPy with ESP32
MicroPython v1.8.6-621-g17ee404e on 2017-05-25; WiPy with ESP32
Re: Time keeping with utime
But what’s your hardware?priis wrote:... Sorry, my firmware is
MicroPython v1.8.6-621-g17ee404e on 2017-05-25; WiPy with ESP32
Sent from my iPhone using Tapatalk Pro
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Time keeping with utime
If you're running PyCom hardware you should run their firmware: MicroPython is customised to specific hardware platforms. You'll get more knowledgeable answers to questions on PyCom kit if you raise them in the PyCom forum.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Time keeping with utime
And how to flash it?
I tried ESP8266 flasher but that didn't work.
Next, I tried the following from a DOS terminal window:
esptool.py --chip esp32 --port COM7 write_flash -z 0x1000 esp32-20180511-v1.9.4.bin
but I get an error message:
epstool: error: argument operation: invalid choice: 'esp32' (choose from 'load_ram' ...).
What is the exact syntax?
I tried ESP8266 flasher but that didn't work.
Next, I tried the following from a DOS terminal window:
esptool.py --chip esp32 --port COM7 write_flash -z 0x1000 esp32-20180511-v1.9.4.bin
but I get an error message:
epstool: error: argument operation: invalid choice: 'esp32' (choose from 'load_ram' ...).
What is the exact syntax?
Re: Time keeping with utime
You should get a recent copy of esptool.py, e.g. from this place: https://github.com/espressif/esptool
Re: Time keeping with utime
Thanks, I have done that. But again, what is the exact syntax of the esptool command?
I have tried several variations of
esptool.py --chip esp32 --port COM7 write_flash -z 0x1000 esp32-20180927-v1.9.4-584-g57a7d5be9.bin
- none of them works.
I have tried several variations of
esptool.py --chip esp32 --port COM7 write_flash -z 0x1000 esp32-20180927-v1.9.4-584-g57a7d5be9.bin
- none of them works.