Search found 818 matches

by Roberthh
Tue Jan 23, 2018 6:36 am
Forum: General Discussion and Questions
Topic: What's the meaning of this error: MemoryError: memory allocation failed, allocating 964 bytes?
Replies: 8
Views: 106

Re: What's the meaning of this error: MemoryError: memory allocation failed, allocating 964 bytes?

The difference is the time of compilation and the location of the bytecode for execution: Python Source: -> compiled at runtime on the board -> placed in RAM .mpy files: -> pre-compiled on the PC -> placed in RAM Frozen bytecode: -> pre-compiled on the PC -> placed in Flash memory Frozen bytecode st...
by Roberthh
Mon Jan 22, 2018 9:45 pm
Forum: General Discussion and Questions
Topic: What's the meaning of this error: MemoryError: memory allocation failed, allocating 964 bytes?
Replies: 8
Views: 106

Re: What's the meaning of this error: MemoryError: memory allocation failed, allocating 964 bytes?

The ESP8266 is good for about 300 lines Python code. If you have more, the only option is frozen bytecode.
by Roberthh
Mon Jan 22, 2018 8:02 pm
Forum: General Discussion and Questions
Topic: heap allocation in interrupts
Replies: 5
Views: 83

Re: heap allocation in interrupts

I was not sure this morning, so I made a test. At both ESP8266 and ESP32 least the following simple test passes: from machine import Pin, idle def isr(x): a = bytearray(10) x = len(a)/3 print("irq:", len(a), x) pin = Pin(14, mode=Pin.IN) pin.irq(handler=isr, trigger=Pin.IRQ_FALLING) while True: idle...
by Roberthh
Mon Jan 22, 2018 6:47 am
Forum: The MicroPython pyboard
Topic: utime/pyb delay error
Replies: 4
Views: 84

Re: utime/pyb delay error

So you see that you have a constant offset in timing, with viper about 3 µs. There are many reasons why you notice a lower voltage at the output. Of the many, a few: a) wrong setting of the instrument you use for measurement, or mis-interpretation of the displayed value. b) mismatch between output i...
by Roberthh
Sun Jan 21, 2018 8:11 am
Forum: ESP8266 boards
Topic: Reached the memory limits of the ESP8266 board. Now what?
Replies: 21
Views: 683

Re: Reached the memory limits of the ESP8266 board. Now what?

Look for the Wemos LOLIN32 pro, e.g. here: https://wiki.wemos.cc/products:lolin32: ... []=lolin32
There are three variants from wemos. You have to look for the one with the WROVER module.
by Roberthh
Sat Jan 20, 2018 11:10 am
Forum: The MicroPython pyboard
Topic: utime/pyb delay error
Replies: 4
Views: 84

Re: utime/pyb delay error

Executing the python statements takers the time. And I'm surprised that it takes that long. I recall something like <0.5 µs per simple statement and 2-4 µs net for a function call (just doing the call). You can speed up the example using direct calls and native/viper: from pyb import Pin, udelay fro...
by Roberthh
Wed Jan 17, 2018 11:18 am
Forum: ESP8266 boards
Topic: Uart communication
Replies: 1
Views: 75

Re: Uart communication

Since UART0 ist used for REPL, you can on the ESP8266 simple print() what you want to send. No need to use the UART API.
by Roberthh
Tue Jan 16, 2018 11:36 am
Forum: General Discussion and Questions
Topic: Long numbers in frozen modules
Replies: 7
Views: 143

Re: Long numbers in frozen modules

Your approach looks too complicated for me. If you want to freeze a Python module, just put that into the "modules" subdirectory of the respective port (stm32, esp8266, esp32) and create a new image by just issueing the command "make". The Makefile will do all the magic you need. And, as Peter said,...
by Roberthh
Tue Jan 16, 2018 8:22 am
Forum: ESP32 boards
Topic: boot failure when connected to powered relay board [Solved]
Replies: 5
Views: 119

Re: boot failure when connected to powered relay board

According to the ES32 data sheet (http://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf), Page 10, Pin 12 (or MTDI) is one of the strapping pins, next to 0, 2, 5 and 15. Their status at cold boot time is critical. Try to avoid these, unless you exactly know it is not crit...
by Roberthh
Mon Jan 15, 2018 9:13 pm
Forum: ESP32 boards
Topic: native and viper decorators on ESP32
Replies: 10
Views: 225

Re: native and viper decorators on ESP32

The commit with thes assembler was this one: https://github.com/micropython/micropython/commit/f76b1bfa9f59fcfa03837c6934ad51d2db3ff4a3 The code for the toggle loop is here: def loop(): import machine machine.Pin(4, machine.Pin.OUT, value=0) do_loop() print("loop done") @micropython.asm_xtensa def d...