Search found 1769 matches

by jimmo
Sun Apr 05, 2020 5:55 am
Forum: Programs, Libraries and Tools
Topic: socket state retrieval
Replies: 2
Views: 318

Re: socket state retrieval

sebi wrote:
Sat Mar 28, 2020 1:12 am
How can I retrieve state from s to test its value?
Short of parsing the output (via dupterm to stringio), there isn't a way.

What are you trying to do? Why do you need the state.
by jimmo
Sun Apr 05, 2020 3:21 am
Forum: General Discussion and Questions
Topic: how to new an array.array in C code?
Replies: 5
Views: 444

Re: how to new an array.array in C code?

but I want to return an array, how to do? memoryviews are arrays, is there any particular reason why you need it to specifically be an array? (they share the same underlying struct). But if you want to explicitly make it an array (this will add more code size), you can just follow the implementatio...
by jimmo
Sun Apr 05, 2020 3:12 am
Forum: Development of MicroPython
Topic: MP_BINARY_OP_EQUAL in .binary_op with user type
Replies: 2
Views: 615

Re: MP_BINARY_OP_EQUAL in .binary_op with user type

Hi, Have you read the implementation of mp_binary_op in runtime.c -- in this case the relevant detail is that it calls mp_obj_equal_not_equal. It goes through a bunch of the steps, to finally call the type's binary_op. Importantly though, the behavior is controlled by the flags set on the type. This...
by jimmo
Sun Apr 05, 2020 3:04 am
Forum: ESP8266 boards
Topic: maximum recursion depth exceeded
Replies: 11
Views: 3679

Re: maximum recursion depth exceeded

So I went in and increased the stack size from the default 16k to 32k. If I understand correctly, you're saying the thread is the one that hit the recursion limit. Changing the limit from 16 to 32 (which I assume you're doing in the linker script) will only affect the main threads. Threads created ...
by jimmo
Sat Apr 04, 2020 11:25 am
Forum: ESP8266 boards
Topic: import bme280.py fails
Replies: 2
Views: 306

Re: import bme280.py fails

The ESP8266 has very limited RAM, so the way that your IDE is doing the exec(open(file)) thing is particularly difficult. This requires it to have the entire text of the program in RAM, plus the parse tree, and then the compiled bytecode. You'd likely have better luck if you put the file on the file...
by jimmo
Sat Apr 04, 2020 11:22 am
Forum: General Discussion and Questions
Topic: STM32 machine.I2C.readfrom_into does not match documentation
Replies: 4
Views: 391

Re: STM32 machine.I2C.readfrom_into does not match documentation

RWLTOK wrote:
Fri Apr 03, 2020 3:57 pm
From https://docs.micropython.org/en/latest/ ... e.I2C.html

I2C.readfrom_into(addr, buf, stop=True, /)
That "/" on the end -- that means that this function doesn't take keyword arguments. See https://www.python.org/dev/peps/pep-0570/ and https://github.com/micropython/micropython/issues/5196
by jimmo
Sat Apr 04, 2020 11:16 am
Forum: MicroPython pyboard
Topic: [Solved] Pin.mode() throwing TypeError
Replies: 4
Views: 536

Re: Pin.mode() throwing TypeError

the corresponding documentation (https://docs.micropython.org/en/latest/ ... e.Pin.html). Unfortunately that's not the documentation for the class you're using. You're using "pyb.Pin", but that's the docs for "machine.Pin". Historically, when there was just the pyboard, the pyb module provided acce...
by jimmo
Sat Apr 04, 2020 11:09 am
Forum: General Discussion and Questions
Topic: Sending commands to MicroPhyton via serial connection
Replies: 7
Views: 523

Re: Sending commands to MicroPhyton via serial connection

Weird... maybe something about IPython? I have no idea. Can you do print(open('pyboard.py', 'r').read()) to confirm that it's actually loading the correct file. (Should be the same as https://github.com/micropython/micropython/blob/master/tools/pyboard.py Just a quick test, this works for me: jimmo@...
by jimmo
Sat Apr 04, 2020 11:06 am
Forum: WiPy and CC3200 boards
Topic: Wipy no float and math!
Replies: 20
Views: 8396

Re: Wipy no float and math!

sekil wrote:
Fri Apr 03, 2020 11:21 am
I'm think this cpu (cortexm4) support hard floats..
It doesn't. It's an M4, not M4F.

Relevant quote from the ref manual:
"The ARM Cortex-M4 application processor corein the CC3200 does not include the floating point unit and memory protection unit (FPUand MPU)."
by jimmo
Fri Apr 03, 2020 10:03 am
Forum: ESP32 boards
Topic: Script only works when input to the REPL
Replies: 7
Views: 537

Re: Script only works when input to the REPL

You have a mixture of tabs and spaces. You need to consistently use the same throughout the file.