Search found 140 matches

by kwiley
Tue Jun 19, 2018 4:19 pm
Forum: General Discussion and Questions
Topic: Memory allocation errors with plenty of space
Replies: 16
Views: 27250

Re: Memory allocation errors with plenty of space

Thanks everyone. I'll take a closer look at that. One place that it is hard to avoid reallocating memory is in the rolling buffer coming in from a serial line. I can preallocate the receive buffer so as to use usb.readinto() instead of usb.read(), but I still have to chomp my way through the accumul...
by kwiley
Mon Jun 18, 2018 10:09 pm
Forum: General Discussion and Questions
Topic: Memory allocation errors with plenty of space
Replies: 16
Views: 27250

Memory allocation errors with plenty of space

I often get memory allocation exceptions when there is quite a bit of free memory and the requested amount is substantially smaller than the current supply. For example, I might see something like this: Free memory: 49616 MemoryError: memory allocation failed, allocating 4084 bytes I know I can fidd...
by kwiley
Mon Jun 18, 2018 3:52 pm
Forum: General Discussion and Questions
Topic: uzlib error
Replies: 3
Views: 2542

Re: uzlib error

Well, I'm working on a Mac, using PySerial from Jupyter. I'll look into the possibility of character transformation some.
by kwiley
Fri Jun 15, 2018 4:26 pm
Forum: General Discussion and Questions
Topic: uzlib error
Replies: 3
Views: 2542

uzlib error

I'm compressing data on a desktop with zlib before sending it over serial comms to a PyBoard via USB_VCP. The PyBoard then decompresses packets of data before processing them. I have confirmed that any overhead of compression or decompression is, in fact, compensated by the reduced transmission size...
by kwiley
Mon Jun 11, 2018 8:50 pm
Forum: MicroPython pyboard
Topic: USB virtual com RTS/CTS?
Replies: 10
Views: 7653

Re: USB virtual com RTS/CTS?

Thank you. I had noticed the other discussions in the forums that explained that the baud rate was ignored, so I'm aware of that. I'm just trying to figure out what to do about the lack of flow control. It looks like I'll have to implement flow control at the application layer. I have to have the Py...
by kwiley
Mon Jun 11, 2018 4:58 pm
Forum: MicroPython pyboard
Topic: USB virtual com RTS/CTS?
Replies: 10
Views: 7653

Re: USB virtual com RTS/CTS?

I see the following, which explains that UARTs 2 and 3 offer flow control: http://docs.micropython.org/en/latest/pyboard/library/pyb.UART.html So, does USB_VCP rely on (utilize) one of the UARTs for its communications? I would generally assume it does, but perhaps that makes no sense, perhaps it doe...
by kwiley
Mon Jun 11, 2018 4:49 pm
Forum: MicroPython pyboard
Topic: USB virtual com RTS/CTS?
Replies: 10
Views: 7653

Re: USB virtual com RTS/CTS?

Okay. Thanks. So are you saying that flow control is enabled by some of the UARTs, but there is no simple way to take advantage of them over a USB-to-desktop serial connection? So even though PyBoard can engage in flow control communication, it can't do with with a desktop for the purpose of shoveli...
by kwiley
Fri Jun 08, 2018 9:35 pm
Forum: MicroPython pyboard
Topic: USB virtual com RTS/CTS?
Replies: 10
Views: 7653

USB virtual com RTS/CTS?

I am communicating with a PyBoard over USB from a desktop (Jupyter on a Mac if you're curious). The PyBoard is using pyb.USB_VCP to read and write byte streams and the desktop has opened serial communication to the PyBoard. This works fine so long as I close my terminal REPL so the data isn't redire...
by kwiley
Fri Jun 01, 2018 9:06 pm
Forum: General Discussion and Questions
Topic: Why does pyb.SPI.init() take a nondefaulted prescaler?
Replies: 3
Views: 2608

Re: Why does pyb.SPI.init() take a nondefaulted prescaler?

Yep. Thanks for considering the question.
by kwiley
Wed May 30, 2018 4:52 pm
Forum: General Discussion and Questions
Topic: Why does pyb.SPI.init() take a nondefaulted prescaler?
Replies: 3
Views: 2608

Why does pyb.SPI.init() take a nondefaulted prescaler?

According to https://docs.micropython.org/en/latest/pyboard/library/pyb.SPI.html the pyb.SPI init() function takes a prescaler parameter with no default value. It appears to work if none is provided (which I find a little confusing; shouldn't Python require a parameter for which no default value is ...