Search found 99 matches

by ttmetro
Tue Mar 23, 2021 1:44 am
Forum: General Discussion and Questions
Topic: packing a uarray
Replies: 1
Views: 95

Re: packing a uarray

Answered the question myself:

Directly write the array to the UART (no pack). If both ends of the connection use the same binary encoding (endian), this works.
by ttmetro
Tue Mar 23, 2021 12:05 am
Forum: General Discussion and Questions
Topic: packing a uarray
Replies: 1
Views: 95

packing a uarray

I'd like to efficiently (without memory allocation) send binary data over a uart. This is what I came up with: from array import array from struct import pack a = array('i', range(4)) # this works - is there a way to get rid of the loop? # i.e. have C do the looping ... for i in a: print(pack('i', i...
by ttmetro
Tue Mar 16, 2021 5:33 pm
Forum: ESP32 boards
Topic: Trying to use the toolchain via docker
Replies: 5
Views: 496

Re: A new problem

I think I've fixed the interface between my brain and docker: I can now compile ... [/code] Here's another take on using docker to compile for the esp32: Make sure you have docker installed. Then create a file with the text below somewhere on your path. Call it "idf.py" and make it executable. Go t...
by ttmetro
Tue Mar 09, 2021 7:46 pm
Forum: MicroPython pyboard
Topic: reassign i2c pins
Replies: 2
Views: 694

Re: reassign i2c pins

On the 405 the pin assignments are hard-wired, so rather than selecting them when you create the I2C object, you reconfigure the approriate pins instead. ... Thanks a lot! Unlike #define MICROPY_HW_I2C1_NAME "I2C1" #define MICROPY_HW_I2C1_SCL (pin_B6) // SCL #define MICROPY_HW_I2C1_SDA (pin_B7) // ...
by ttmetro
Mon Mar 08, 2021 8:00 pm
Forum: MicroPython pyboard
Topic: reassign i2c pins
Replies: 2
Views: 694

reassign i2c pins

The default F405 I2C pins are PB6, PB7. How can I use PB8, PB9 instead (they I2C1 alt functions)?

The driver gives an error that pin reassignment is not supported. Presumably it's possible with a custom firmware build?
by ttmetro
Wed Feb 17, 2021 10:42 pm
Forum: Other Boards
Topic: nrf52: external file system
Replies: 12
Views: 735

Re: nrf52: external file system

jimmo wrote:
Wed Feb 17, 2021 3:08 am
... different ISR handlers (pin, timer, network, socket, etc) can signal a given uevent slot.
Great! I'm looking forward to this, especially together with low power BT (nrf?) this will be fantastic.
by ttmetro
Wed Feb 17, 2021 1:14 am
Forum: Other Boards
Topic: nrf52: external file system
Replies: 12
Views: 735

Re: nrf52: external file system

But it's crazy inefficient because you have a task that has to burn a lot of time just polling that queue. Thanks for the note on ThreadSafeFlag; I'll use that for now. BTW: no need to poll for interrupt driven events. The latter wake up the CPU, after handling the ISR it proceeds right from where ...
by ttmetro
Tue Feb 16, 2021 5:30 pm
Forum: Other Boards
Topic: nrf52: external file system
Replies: 12
Views: 735

Re: nrf52: external file system

def irq(): asyncio.get_event_loop().call_soon_threadsafe(my_handler_task()) I'm looking forward to this functionality because I'd like a way to safely set a asyncio.Event from ISR context. I was not aware of call_soon_threadsafe ; would be great to have in MicroPython! Is this what uevent is about?...
by ttmetro
Fri Feb 12, 2021 7:16 pm
Forum: Other Boards
Topic: nrf52: external file system
Replies: 12
Views: 735

Re: nrf52: external file system

Yes, absolutely. I hope asyncio will eventually become a really convenient way of integrating sleep modes (especially light sleep). One of the main blockers to progress on this is coming up with a good way to integrate peripheral i/o with asyncio, and in general having a common path for ways for ta...
by ttmetro
Thu Feb 11, 2021 5:46 pm
Forum: Other Boards
Topic: nrf52: external file system
Replies: 12
Views: 735

Re: nrf52: external file system

We are keen to add more to the nRF port. In particular making it use the same modbluetooth API as the other ports is high on my radar. Definitely would welcome contributions to improve it. That's great to hear! I've submitted a small "trial" PR (https://github.com/micropython/micropython/pull/6753)...