Search found 10 matches
- Thu Jan 28, 2021 12:11 am
- Forum: General Discussion and Questions
- Topic: Keep getting MemoryError on ISR callback (asyncio)
- Replies: 7
- Views: 3319
Re: Keep getting MemoryError on ISR callback (asyncio)
The other thing that seems to be missing is a `.readinto()` method. Given that most of the memory used in my app is serial traffic I have a pre-declared buffer that I am reading the data into. Allocating bytes for each call to StreamReader.read() is probably not going to fare well given micropython'...
- Wed Jan 27, 2021 2:41 pm
- Forum: General Discussion and Questions
- Topic: Keep getting MemoryError on ISR callback (asyncio)
- Replies: 7
- Views: 3319
Re: Keep getting MemoryError on ISR callback (asyncio)
Having said that, my code has changed quite a bit since trying it. I'll give it another shot.
Thanks for asyncio and all the awesome documentation, BTW. It is all fantastic stuff!
Thanks for asyncio and all the awesome documentation, BTW. It is all fantastic stuff!
- Wed Jan 27, 2021 2:00 pm
- Forum: General Discussion and Questions
- Topic: Keep getting MemoryError on ISR callback (asyncio)
- Replies: 7
- Views: 3319
Re: Keep getting MemoryError on ISR callback (asyncio)
Thanks, but no matter what I did I could not make that work without losing data. Interrupts seem to work much smoother for me.
- Wed Jan 27, 2021 1:36 am
- Forum: General Discussion and Questions
- Topic: Keep getting MemoryError on ISR callback (asyncio)
- Replies: 7
- Views: 3319
Re: Keep getting MemoryError on ISR callback (asyncio)
Bah! Just figured it out. Apparently you can't use "*args, **kwargs" in your handler signature.
- Wed Jan 27, 2021 1:23 am
- Forum: General Discussion and Questions
- Topic: Keep getting MemoryError on ISR callback (asyncio)
- Replies: 7
- Views: 3319
Keep getting MemoryError on ISR callback (asyncio)
Hi There, I am trying to convert an app to asyncio and I am using this as a reference: https://github.com/peterhinch/micropython-async/blob/master/v3/docs/DRIVERS.md#6-irq_event However, no matter what I do I am getting the following error: Uncaught exception in IRQ callback handler MemoryError: I'm...
- Sun Jan 24, 2021 10:24 pm
- Forum: Development of MicroPython
- Topic: Creating/accessing Timer and UART from a C module
- Replies: 1
- Views: 1620
Re: Creating/accessing Timer and UART from a C module
Actually, I may have finally got my code balanced enough that the pure uPython implementation works. I was trying to use asyncio for everything, but converting my main serial receive to a UART.irq callback it seems to be running smoothly now. I'll continue down this path for the time-being. But bein...
- Sun Jan 24, 2021 6:39 pm
- Forum: Development of MicroPython
- Topic: Creating/accessing Timer and UART from a C module
- Replies: 1
- Views: 1620
Creating/accessing Timer and UART from a C module
Hi There, I have been using micropython for quite some time (from Python) and have written some simple C modules in the past but I am trying to use micropython in a new way and could use some advice. I am wrapping an existing bunch of embedded C code that communicates over a serial port and requires...
- Mon Dec 30, 2019 12:56 am
- Forum: Development of MicroPython
- Topic: undefined symbol: rand
- Replies: 3
- Views: 3133
Re: undefined symbol: rand
Basically, I am trying to leverage an existing C library that relies on a few external functions to be defined related to a fundamental delay in microseconds, configuring and starting a timer, and implementing callbacks. It would be nice to use the dynamic native module infrastructure but it looks l...
- Sun Dec 29, 2019 9:15 pm
- Forum: Development of MicroPython
- Topic: undefined symbol: rand
- Replies: 3
- Views: 3133
Re: undefined symbol: rand
Thanks for the reply. I have a similar question when trying to create a dynamic module using the native machine code approach. My native code expects a C function for timing to be externally defined (void delay_us(void)). This is hardware specific and I can't seem to figure out how to delegate this ...
- Sat Dec 28, 2019 11:38 pm
- Forum: Development of MicroPython
- Topic: undefined symbol: rand
- Replies: 3
- Views: 3133
undefined symbol: rand
Hey Guys, I am trying to build a native module following this page of documentation: https://docs.micropython.org/en/latest/develop/natmod.html#natmod And I get the following LinkerError: LinkError: build/../cc-slave/src/handshake.o: undefined symbol: rand ../../micropython/py/dynruntime.mk:138: rec...