<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openmano-mpy/lib/utils, branch master</title>
<subtitle>MicroPython source and hardware configuration for OpenMano</subtitle>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/'/>
<entry>
<title>lib/utils: Remove unused PYEXEC_SWITCH_MODE from pyexec.h.</title>
<updated>2021-04-23T14:10:59+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2021-04-23T14:10:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=530c76f6caee9445f468380f58b98f4e3ceda759'/>
<id>530c76f6caee9445f468380f58b98f4e3ceda759</id>
<content type='text'>
It was made obsolete by commit c98c128fe885e539ecd73843756340f8950115c8.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was made obsolete by commit c98c128fe885e539ecd73843756340f8950115c8.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/utils/gchelper_generic: Implement AArch64 support.</title>
<updated>2021-03-11T01:54:05+00:00</updated>
<author>
<name>Yonatan Goldschmidt</name>
</author>
<published>2021-02-21T00:05:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=098ac11bb0cb912909af801015ac07bd2bf01ce7'/>
<id>098ac11bb0cb912909af801015ac07bd2bf01ce7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/utils/pyexec: Remove obsolete LCD initialization.</title>
<updated>2021-01-30T02:41:36+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2021-01-16T08:24:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=fca2730ea01bc8457804884f4a0472ae0d938a19'/>
<id>fca2730ea01bc8457804884f4a0472ae0d938a19</id>
<content type='text'>
This was added a long time ago in 75abee206d1a575aa98a486d043c94d64df432c1
when USB host support was added to the stm (now stm32) port, and when this
pyexec code was actually part of the stm port.  It's unlikely to work as
intended anymore.  If it is needed in the future then generic hook macros
can be added in pyexec.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was added a long time ago in 75abee206d1a575aa98a486d043c94d64df432c1
when USB host support was added to the stm (now stm32) port, and when this
pyexec code was actually part of the stm port.  It's unlikely to work as
intended anymore.  If it is needed in the future then generic hook macros
can be added in pyexec.
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/utils/pyexec: Add stdin-reader on raw REPL with flow control.</title>
<updated>2020-11-30T00:37:44+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-10-06T01:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=bb24c69b909e82cc1b6e82a28f14fa732f596b9f'/>
<id>bb24c69b909e82cc1b6e82a28f14fa732f596b9f</id>
<content type='text'>
Background: the friendly/normal REPL is intended for human use whereas the
raw REPL is for computer use/automation.  Raw REPL is used for things like
pyboard.py script_to_run.py.  The normal REPL has built-in flow control
because it echos back the characters.  That's not so with raw REPL and flow
control is just implemented by rate limiting the amount of data that goes
in.  Currently it's fixed at 256 byte chunks every 10ms.  This is sometimes
too fast for slow MCUs or systems with small stdin buffers.  It's also too
slow for a lot of higher-end MCUs, ie it could be a lot faster.

This commit adds a new raw REPL mode which includes flow control: the
device will echo back a character after a certain number of bytes are sent
to the host, and the host can use this to regulate the data going out to
the device.  The amount of characters is controlled by the device and sent
to the host before communication starts.  This flow control allows getting
the maximum speed out of a serial link, regardless of the link or the
device at the other end.

Also, this new raw REPL mode parses and compiles the incoming data as it
comes in.  It does this by creating a "stdin reader" object which is then
passed to the lexer.  The lexer requests bytes from this "stdin reader"
which retrieves bytes from the host, and does flow control.  What this
means is that no memory is used to store the script (in the existing raw
REPL mode the device needs a big buffer to read in the script before it can
pass it on to the lexer/parser/compiler).  The only memory needed on the
device is enough to parse and compile.

Finally, it would be possible to extend this new raw REPL to allow bytecode
(.mpy files) to be sent as well as text mode scripts (but that's not done
in this commit).

Some results follow. The test was to send a large 33k script that contains
mostly comments and then prints out the heap, run via pyboard.py large.py.

On PYBD-SF6, prior to this PR:

$ ./pyboard.py large.py
stack: 524 out of 23552
GC: total: 392192, used: 34464, free: 357728
 No. of 1-blocks: 12, 2-blocks: 2, max blk sz: 2075, max free sz: 22345
GC memory layout; from 2001a3f0:
00000: h=hhhh=======================================hhBShShh==h=======h
00400: =====hh=B........h==h===========================================
00800: ================================================================
00c00: ================================================================
01000: ================================================================
01400: ================================================================
01800: ================================================================
01c00: ================================================================
02000: ================================================================
02400: ================================================================
02800: ================================================================
02c00: ================================================================
03000: ================================================================
03400: ================================================================
03800: ================================================================
03c00: ================================================================
04000: ================================================================
04400: ================================================================
04800: ================================================================
04c00: ================================================================
05000: ================================================================
05400: ================================================================
05800: ================================================================
05c00: ================================================================
06000: ================================================================
06400: ================================================================
06800: ================================================================
06c00: ================================================================
07000: ================================================================
07400: ================================================================
07800: ================================================================
07c00: ================================================================
08000: ================================================================
08400: ===============================================.....h==.........
       (349 lines all free)

(the big blob of used memory is the large script).

Same but with this PR:

$ ./pyboard.py large.py
stack: 524 out of 23552
GC: total: 392192, used: 1296, free: 390896
 No. of 1-blocks: 12, 2-blocks: 3, max blk sz: 40, max free sz: 24420
GC memory layout; from 2001a3f0:
00000: h=hhhh=======================================hhBShShh==h=======h
00400: =====hh=h=B......h==.....h==....................................
       (381 lines all free)

The only thing in RAM is the compiled script (and some other unrelated
items).

Time to download before this PR: 1438ms, data rate: 230,799 bits/sec.

Time to download with this PR: 119ms, data rate: 2,788,991 bits/sec.

So it's more than 10 times faster, and uses significantly less RAM.

Results are similar on other boards. On an stm32 board that connects via
UART only at 115200 baud, the data rate goes from 80kbit/sec to
113kbit/sec, so gets close to saturating the UART link without loss of
data.

The new raw REPL mode also supports a single ctrl-C to break out of this
flow-control mode, so that a ctrl-C can always get back to a known state.
It's also backwards compatible with the original raw REPL mode, which is
still supported with the same sequence of commands.  The new raw REPL
mode is activated by ctrl-E, which gives an error on devices that do not
support the new mode.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Background: the friendly/normal REPL is intended for human use whereas the
raw REPL is for computer use/automation.  Raw REPL is used for things like
pyboard.py script_to_run.py.  The normal REPL has built-in flow control
because it echos back the characters.  That's not so with raw REPL and flow
control is just implemented by rate limiting the amount of data that goes
in.  Currently it's fixed at 256 byte chunks every 10ms.  This is sometimes
too fast for slow MCUs or systems with small stdin buffers.  It's also too
slow for a lot of higher-end MCUs, ie it could be a lot faster.

This commit adds a new raw REPL mode which includes flow control: the
device will echo back a character after a certain number of bytes are sent
to the host, and the host can use this to regulate the data going out to
the device.  The amount of characters is controlled by the device and sent
to the host before communication starts.  This flow control allows getting
the maximum speed out of a serial link, regardless of the link or the
device at the other end.

Also, this new raw REPL mode parses and compiles the incoming data as it
comes in.  It does this by creating a "stdin reader" object which is then
passed to the lexer.  The lexer requests bytes from this "stdin reader"
which retrieves bytes from the host, and does flow control.  What this
means is that no memory is used to store the script (in the existing raw
REPL mode the device needs a big buffer to read in the script before it can
pass it on to the lexer/parser/compiler).  The only memory needed on the
device is enough to parse and compile.

Finally, it would be possible to extend this new raw REPL to allow bytecode
(.mpy files) to be sent as well as text mode scripts (but that's not done
in this commit).

Some results follow. The test was to send a large 33k script that contains
mostly comments and then prints out the heap, run via pyboard.py large.py.

On PYBD-SF6, prior to this PR:

$ ./pyboard.py large.py
stack: 524 out of 23552
GC: total: 392192, used: 34464, free: 357728
 No. of 1-blocks: 12, 2-blocks: 2, max blk sz: 2075, max free sz: 22345
GC memory layout; from 2001a3f0:
00000: h=hhhh=======================================hhBShShh==h=======h
00400: =====hh=B........h==h===========================================
00800: ================================================================
00c00: ================================================================
01000: ================================================================
01400: ================================================================
01800: ================================================================
01c00: ================================================================
02000: ================================================================
02400: ================================================================
02800: ================================================================
02c00: ================================================================
03000: ================================================================
03400: ================================================================
03800: ================================================================
03c00: ================================================================
04000: ================================================================
04400: ================================================================
04800: ================================================================
04c00: ================================================================
05000: ================================================================
05400: ================================================================
05800: ================================================================
05c00: ================================================================
06000: ================================================================
06400: ================================================================
06800: ================================================================
06c00: ================================================================
07000: ================================================================
07400: ================================================================
07800: ================================================================
07c00: ================================================================
08000: ================================================================
08400: ===============================================.....h==.........
       (349 lines all free)

(the big blob of used memory is the large script).

Same but with this PR:

$ ./pyboard.py large.py
stack: 524 out of 23552
GC: total: 392192, used: 1296, free: 390896
 No. of 1-blocks: 12, 2-blocks: 3, max blk sz: 40, max free sz: 24420
GC memory layout; from 2001a3f0:
00000: h=hhhh=======================================hhBShShh==h=======h
00400: =====hh=h=B......h==.....h==....................................
       (381 lines all free)

The only thing in RAM is the compiled script (and some other unrelated
items).

Time to download before this PR: 1438ms, data rate: 230,799 bits/sec.

Time to download with this PR: 119ms, data rate: 2,788,991 bits/sec.

So it's more than 10 times faster, and uses significantly less RAM.

Results are similar on other boards. On an stm32 board that connects via
UART only at 115200 baud, the data rate goes from 80kbit/sec to
113kbit/sec, so gets close to saturating the UART link without loss of
data.

The new raw REPL mode also supports a single ctrl-C to break out of this
flow-control mode, so that a ctrl-C can always get back to a known state.
It's also backwards compatible with the original raw REPL mode, which is
still supported with the same sequence of commands.  The new raw REPL
mode is activated by ctrl-E, which gives an error on devices that do not
support the new mode.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/utils/pyexec: Add MICROPY_BOARD hooks before/after executing code.</title>
<updated>2020-11-11T10:47:13+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-10-30T13:22:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=7789cd5f16b068f032e58be8e5e60bf17cb03d40'/>
<id>7789cd5f16b068f032e58be8e5e60bf17cb03d40</id>
<content type='text'>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>stm32/uart: Allow static IRQ handler registration.</title>
<updated>2020-09-08T00:46:30+00:00</updated>
<author>
<name>Jim Mussared</name>
</author>
<published>2020-08-14T05:21:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=23109988c29447067b15f1943f72c0b486819c6c'/>
<id>23109988c29447067b15f1943f72c0b486819c6c</id>
<content type='text'>
This will allow the HCI UART to use a non-heap mp_irq_obj_t, which avoids
needing to make a root pointer for it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will allow the HCI UART to use a non-heap mp_irq_obj_t, which avoids
needing to make a root pointer for it.
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/utils/mpirq: Add mp_irq_init func, and clean up unused init method.</title>
<updated>2020-09-04T02:40:38+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-09-04T02:40:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=3ff70792770e4591fec22fa6a1b50f492236fcde'/>
<id>3ff70792770e4591fec22fa6a1b50f492236fcde</id>
<content type='text'>
mp_irq_init() is useful when the IRQ object is allocated by the caller.

The mp_irq_methods_t.init method is not used anywhere so has been removed.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mp_irq_init() is useful when the IRQ object is allocated by the caller.

The mp_irq_methods_t.init method is not used anywhere so has been removed.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/utils: Protect all of mpirq.c with MICROPY_ENABLE_SCHEDULER.</title>
<updated>2020-06-30T12:31:41+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-06-14T06:22:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=9d5edb35596b0ff5943bf1cb756dc3c42e8566d9'/>
<id>9d5edb35596b0ff5943bf1cb756dc3c42e8566d9</id>
<content type='text'>
So it can be unconditionally included in a port's build even if certain
configurations in that port do not use its features, to simplify the
Makefile.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So it can be unconditionally included in a port's build even if certain
configurations in that port do not use its features, to simplify the
Makefile.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tools/uncrustify: Enable more opts to remove space between func and '('.</title>
<updated>2020-06-19T12:07:32+00:00</updated>
<author>
<name>David Lechner</name>
</author>
<published>2020-06-16T14:34:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=77ed6f69ac35c1663a5633a8ee1d8a2446542204'/>
<id>77ed6f69ac35c1663a5633a8ee1d8a2446542204</id>
<content type='text'>
With only `sp_func_proto_paren = remove` set there are some cases where
uncrustify misses removing a space between the function name and the
opening '('.  This sets all of the related options to `force` as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With only `sp_func_proto_paren = remove` set there are some cases where
uncrustify misses removing a space between the function name and the
opening '('.  This sets all of the related options to `force` as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/utils/pyexec: Add missing MP_ERROR_TEXT when compiler disabled.</title>
<updated>2020-06-02T05:43:44+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-05-29T21:34:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=b2030e1661ccf58cb0f62cba0c2009f97ebbf455'/>
<id>b2030e1661ccf58cb0f62cba0c2009f97ebbf455</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
