tag:github.com,2008:https://github.com/TG9541/stm8ef/releases Release notes from stm8ef 2022-07-10T18:47:28Z tag:github.com,2008:Repository/62280367/2.2.29 2022-07-10T19:19:28Z The Long Overdue Release <h1>About the Release</h1> <p>This is the release after the "long past due pre-release". Since the last release Travis-CI.org services had been terminated, and other things in life of the maintainer insisted to be more important than learning about GitHub Actions. For a long time many improvements didn't make it into a binary release.</p> <p>Now the transition to GitHub Actions is complete. In addition to the old features the <a href="https://github.com/TG9541/stm8ef/releases/tag/volatile">volatile</a> release tag contains binaries from the latest successful <a href="https://github.com/TG9541/stm8ef/blob/master/.github/workflows/build-test.yml">build-test workflow</a>.</p> <h2>New Features</h2> <h3>Improved CREATE ... DOES&gt;</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="855580331" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/427" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/427/hovercard" href="https://github.com/TG9541/stm8ef/issues/427">#427</a> provides a much better implementation of <code>DOES&gt;</code> - and better means both <strong>faster</strong> and <strong>leaner</strong>.</p> <p>The execution speed of the new solution is on par with an ordinary CREATE, VARIABLE or CONSTANT as can be shown in the following example:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=": EMPTY CREATE DOES&gt; ; \ just return the address : CONS CREATE , DOES&gt; @ ; \ return data CREATE tcreate VARIABLE tvar EMPTY tempty 0 CONS tcons 0 CONSTANT tconstant"><pre>: EMPTY <span class="pl-k">CREATE</span> <span class="pl-k">DOES&gt;</span> ; <span class="pl-c">\ just return the address </span> : CONS <span class="pl-k">CREATE</span> , <span class="pl-k">DOES&gt;</span> @ ; <span class="pl-c">\ return data</span> <span class="pl-k">CREATE</span> tcreate <span class="pl-k">VARIABLE</span> tvar EMPTY tempty <span class="pl-c1">0</span> CONS tcons <span class="pl-c1">0</span> <span class="pl-k">CONSTANT</span> tconstant</pre></div> <p>The following measurements where done with PulseView on a STM8S001J3M3 with 16MHz HSI and code compiled to Flash ROM.</p> <table> <thead> <tr> <th>Test</th> <th>runtime</th> <th>cycles</th> </tr> </thead> <tbody> <tr> <td><code>tcreate</code></td> <td>1.3µs</td> <td>21</td> </tr> <tr> <td><code>tempty</code></td> <td>1.82µs</td> <td>29</td> </tr> <tr> <td><code>tvariable</code></td> <td>1.89µs</td> <td>30</td> </tr> <tr> <td><code>tconstant</code></td> <td>3.2µs</td> <td>51</td> </tr> <tr> <td><code>tcons</code></td> <td>3.3µs</td> <td>53</td> </tr> </tbody> </table> <p>This means that a runtime of an "empty" <code>DOES&gt;</code>, which returns the address of any data stored by a word definition, is 1.82µs. That's marginally faster than <code>VARIABLE</code> and just a bit slower than <code>CREATE</code>.</p> <p>The simple constant value implementation <code>: CONS CREATE , DOES&gt; @ ;</code> is also just a bit slower than the literal stored by <code>CONSTANT</code>. The latter uses the STM8 instruction <code>TRAP</code> and requires just 3 byte, just like the <code>CALL</code> to the word defined through <code>CONS</code>).</p> <p>The memory requirements compare as follows:</p> <table> <thead> <tr> <th>[bytes]</th> <th>old</th> <th>new</th> <th>diff</th> </tr> </thead> <tbody> <tr> <td><code>: empty CREATE DOES&gt; ;</code></td> <td>22</td> <td>18</td> <td>4</td> </tr> <tr> <td><code>empty a</code></td> <td>13</td> <td>7</td> <td>6</td> </tr> <tr> <td>STM8S001J3 binary</td> <td>4697</td> <td>4662</td> <td>35</td> </tr> </tbody> </table> <p>The old implementation needs 4 bytes more for a "defining word" and 6 bytes more for a "defined" (the new <code>DOES&gt;</code> has the same memory needs as a word defined by <code>CREATE</code>, <code>CONSTANT</code> or <code>VARIABLE</code>).</p> <p>Also the STM8 eForth binary is 35 bytes smaller than before.</p> <h3>Improved &gt;REL</h3> <p><code>&gt;REL</code> is an implementation of <code>IF ... ELSE ... THEN</code> using relative addressing modes. It's meant to be used as a compiler extension loaded into RAM as a scaffold for, e.g., compiling fast and extra compact ISRs (interrupt service routines) into Flash ROM.</p> <p><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Eelkhoorn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Eelkhoorn">@Eelkhoorn</a> noticed that RAM space for the scaffolding code can be reduced and provided an <a href="https://github.com/TG9541/stm8ef/pull/428/files">improved implementation</a>.</p> <h3>Words for Forth Standard compatibility</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="860179566" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/430" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/430/hovercard" href="https://github.com/TG9541/stm8ef/issues/430">#430</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="910626941" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/438" data-hovercard-type="pull_request" data-hovercard-url="/TG9541/stm8ef/pull/438/hovercard" href="https://github.com/TG9541/stm8ef/pull/438">#438</a> added library words for making STM8 eForth a bit more compatible with the <a href="https://forth-standard.org/" rel="nofollow">Forth Standard</a>. Some of the words are just "No Operation" dummy words (e.g. <code>ALIGN</code>), some aliases (e.g., <code>INVERT</code>), some simple definitions (e.g. <code>&gt;BODY</code> and some genuine extensions (e.g., <code>VALUE ... TO</code>).</p> <p>Please be aware that not all of these Forth Standard words will always do what you expect, e.g.:</p> <ul> <li><code>VALUE ... TO</code> (like <code>DEFER ... IS</code>) assumes a writable dictionary</li> <li>some words like <code>STATE</code> emulate some just of the standard semantics</li> </ul> <table> <thead> <tr> <th>Forth Standard</th> <th>STM8 eForth implementation</th> </tr> </thead> <tbody> <tr> <td><code>&gt;BODY</code></td> <td><code>: &gt;BODY ( xt -- a-addr ) 3 + ;</code></td> </tr> <tr> <td><code>ALIGN</code></td> <td><em>no op</em></td> </tr> <tr> <td><code>ALIGNED</code></td> <td><em>no op</em></td> </tr> <tr> <td><code>C"</code></td> <td><code>' $" ALIAS C"</code></td> </tr> <tr> <td><code>CHAR+</code></td> <td><code>' 1+ ALIAS CHAR+ ( c-addr1 -- c-addr2 )</code></td> </tr> <tr> <td><code>CHAR</code></td> <td><code>: CHAR ( "char" -- c ) BL WORD CHAR+ C@ ;</code></td> </tr> <tr> <td><code>CHARS</code></td> <td><em>no op</em></td> </tr> <tr> <td><code>[CHAR]</code></td> <td><code>: [CHAR] ( "name"&lt;spaces -- ) CHAR POSTPONE LITERAL ; IMMEDIATE</code></td> </tr> <tr> <td><code>COMPILE,</code></td> <td><code>' CALL, ALIAS COMPILE, ( xt -- )</code></td> </tr> <tr> <td><code>ENVIRONMENT?</code></td> <td><code>: ENVIRONMENT? ( c-addr u -- false ) 2DROP 0 ;</code></td> </tr> <tr> <td><code>INVERT</code></td> <td><code>' NOT ALIAS INVERT ( x1 -- x2 ) </code></td> </tr> <tr> <td><code>J</code></td> <td>like <code>I</code> (only for <code>DO ... LOOP</code>, not <code>FOR ... NEXT</code>)</td> </tr> <tr> <td><code>STATE</code></td> <td>"kludge" using <code>STATE?</code> and a variable <code>stateflag</code></td> </tr> <tr> <td><code>TO</code></td> <td>see <a href="https://github.com/TG9541/stm8ef/blob/master/lib/VALUE"><code>VALUE</code></a></td> </tr> <tr> <td><code>VALUE</code></td> <td>limited to writable dictionary (RAM or NVM when writable) see <a href="https://github.com/TG9541/stm8ef/blob/master/lib/VALUE"><code>lib/VALUE</code></a></td> </tr> </tbody> </table> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="860179566" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/430" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/430/hovercard" href="https://github.com/TG9541/stm8ef/issues/430">#430</a> refactored <code>CREATE</code> and <code>VARIABLE</code> in order to facilitate implementing the Forth Standard words <code>VALUE</code> and <code>TO</code>.</p> <p>The following additional words are already available in <a href="https://github.com/TG9541/stm8ef/releases/edit/volatile">volatile</a> and they will be available in the next release (2.2.29):</p> <table> <thead> <tr> <th>Forth Standard</th> <th>STM8 eForth implementation</th> </tr> </thead> <tbody> <tr> <td><code>CELL+</code></td> <td><code>' 2+ ALIAS CELL+ ( c-addr1 -- c-addr2 )</code></td> </tr> <tr> <td><code>CELLS</code></td> <td><code>' 2* ALIAS CELLS ( n1 -- n2 )</code></td> </tr> <tr> <td><code>FALSE</code></td> <td><code>' 0 ALIAS FALSE ( -- false )</code></td> </tr> <tr> <td><code>RSHIFT</code></td> <td>like <code>LSHIFT ( n1 u -- n2 )</code></td> </tr> <tr> <td><code>TRUE</code></td> <td><code>' -1 ALIAS TRUE ( -- true )</code></td> </tr> </tbody> </table> <h3>Improved "pictured number" words</h3> <p>While working on optional words for Forth Standard compatibility it became clear that while Forth Standard compliant "pictured number output" with <code># ( ud -- ud)</code> instead of <code># ( u -- u)</code> (double instead of single math) would increase the code size only marginally but the math would make printing numbers in a background process slower. This might break applications that print numbers in a background task as the limit of 1ms task run-time is exceeded (unless a fast 32bit/8bit division or buffered I/O is used).</p> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873728097" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/433" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/433/hovercard" href="https://github.com/TG9541/stm8ef/issues/433">#433</a> explored options for improving the code. It turned out that <code>#</code> can be made faster by using the instruction <code>DIV X,A</code> (with the <a href="https://github.com/TG9541/stm8ef/blob/de23e35ef57ff0f3b25359bf9badacfab42385e7/inc/bgtask.inc#L48"><code>DIV</code>/<code>DIVW</code> erratum work-around</a>). The code could also be made leaner by in-lining the code of <code>DIGIT</code> and <code>EXTRACT</code> (these are eForth words which are not available in other 16bit Forth implementations, e.g., the well known <a href="https://github.com/ForthHub/F83">F83</a> - they also don't appear in the Forth Standard).</p> <p>PulseView and the word <code>..</code> (which toggles a GPIO with <code>PLo</code> and <code>PHi</code>) were used for testing:</p> <p><code>: .. ( u -- u ) PLo &lt;# PHi #S PLo #&gt; PHi TYPE ;</code></p> <p>For example, here is the timing for <code>DECIMAL 65535 ..</code>:</p> <p><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5466977/116795265-0b0b2300-aad4-11eb-964d-5d051b4a5540.png"><img src="https://user-images.githubusercontent.com/5466977/116795265-0b0b2300-aad4-11eb-964d-5d051b4a5540.png" alt="image" style="max-width: 100%;"></a></p> <p>The following table shows that <code>#</code> and <code>#S</code> are much faster now:</p> <table> <thead> <tr> <th>..</th> <th>Base</th> <th><code>&lt;# #S #&gt;</code> old [µs]</th> <th><code>&lt;# #S #&gt;</code> improved [µs]</th> </tr> </thead> <tbody> <tr> <td>65535</td> <td>10</td> <td>155</td> <td>31</td> </tr> <tr> <td>6</td> <td>10</td> <td>53</td> <td>22</td> </tr> <tr> <td>65535</td> <td>16</td> <td>131</td> <td>29</td> </tr> <tr> <td>65535</td> <td>2</td> <td>446</td> <td>60</td> </tr> </tbody> </table> <p>The toggles around <code>&lt;#</code> and <code>#&gt;</code> revealed that about 4µs can be saved by coding the 16bit <code>&lt;literal&gt; +</code> in <code>PAD</code> in assembler (13µs to 9µs - the numbers in the table contain this optimization). In a <code>BG</code> task <code>PAD</code> is slightly faster as it returns a constant address. When using numeric output in a background task, e.g. for presenting measurements on a LED display with <code>CR .</code>, the more efficient "pictured number words" makes a real difference.</p> <p>Note: Forth Standard compatible "pictured number" words with double number output (e.g. <code>D.</code>) can be provided later through library words. in In a 16bit Forth it's important to keep in mind that a limitation of <code>UM/MOD ( ud un -- ur uq )</code> - the 16bit result - correct output for double numbers is limited to "65536 x BASE - 1" (e.g., 655359 for base 10). For larger numbers a 32bit division with 32bit result is required (with 8bit divisor).</p> <h2>Bug fixes and other improvements</h2> <h3>Improved .0 (3-digit signed number print)</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873722733" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/432" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/432/hovercard" href="https://github.com/TG9541/stm8ef/issues/432">#432</a> fixes a few edge cases of <code>.0</code>, the signed number output for 3 digit (LED) displays: numbers smaller than -994 or larger than 9994 had digit overruns - and thus potentially wrong display values.</p> <p>The updated version was shown to work for the following values:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="-999 .0 DEF. ok -995 .0 -99 ok -99 .0 -9.9 ok 0 .0 0.0 ok 999 .0 99.9 ok 1000 .0 100 ok 7876 .0 788 ok 9995 .0 DEF. ok"><pre><span class="pl-c1">-999</span> .0 DEF. ok <span class="pl-c1">-995</span> .0 <span class="pl-c1">-99</span> ok <span class="pl-c1">-99</span> .0 <span class="pl-c1">-9.9</span> ok <span class="pl-c1">0</span> .0 <span class="pl-c1">0.0</span> ok <span class="pl-c1">999</span> .0 <span class="pl-c1">99.9</span> ok <span class="pl-c1">1000</span> .0 <span class="pl-c1">100</span> ok <span class="pl-c1">7876</span> .0 <span class="pl-c1">788</span> ok <span class="pl-c1">9995</span> .0 DEF. ok</pre></div> <h3>Leaner console text input words</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873945591" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/435" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/435/hovercard" href="https://github.com/TG9541/stm8ef/issues/435">#435</a> saved some ROM space in the input words <code>ACCEPT</code>, <code>KTAP</code>, and <code>QUERY</code>.</p> <h3>CREATE and VARIABLE refactored</h3> <p>Common functionality from <code>CREATE</code> and <code>VARIABLE</code> was <a href="https://github.com/TG9541/stm8ef/commit/5e484b5f395873248edfbe8e26a89ab699265771">refactored into the new word <code>ENTRY</code></a> (used by <code>VALUE</code>).</p> <h3>Set INT_TLI to COLD</h3> <p><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Eelkhoorn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Eelkhoorn">@Eelkhoorn</a> ran into a problem when changing ISR code in a development cycle:</p> <blockquote> <p>Uploading the I2C interrupt service routine to STM8L (both 051F3 and 151K4) can lead to corrupted ITC_SPR registers, persistent even after power cycle. Writing xt of COLD to INT_TLI (reset vector) solved the issue.<br> The last four entries of the interrupt vector table (0x8070 to 0x8080) seem to be corrupted after boot for STM8L.</p> </blockquote> <p>Pull request <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="963530460" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/440" data-hovercard-type="pull_request" data-hovercard-url="/TG9541/stm8ef/pull/440/hovercard" href="https://github.com/TG9541/stm8ef/pull/440">#440</a> appears to solve the issue (but the problem needs further analysis and the code may change in the future).</p> <h3>codeload.py: broken #ifdef and #ifndef repaired</h3> <p>Tests with <code>#ifndef &lt;word&gt; \res MCU: ...</code> worked in e4thcom but made codeload.py crash. Issue <a href="https://github.com/TG9541/stm8ef/issues/448" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/448/hovercard">#448</a> solved the problem.</p> <h3>A 5x8 font for dot-matrix displays</h3> <p>A simple 5x8 font for dot-matrix displays <a href="https://github.com/TG9541/stm8ef/blob/master/lib/FONT5X8">`FONT5X8</a> has been added. It's intended to be used with an additional 6th column (6x8) - an example is provided.</p> github-actions[bot] tag:github.com,2008:Repository/62280367/2.2.29-pre1 2022-03-14T21:35:05Z The Long Overdue (Pre-) Release <h1>About the Release</h1> <p>This pre-release is long past due. In the meantime Travis-CI.org services were terminated, and other things in life of the maintainer insisted to be more important than learning about GitHub Actions. For a long time many improvements didn't make it into a binary release.</p> <p>Now the transition to GitHub Actions is complete. In addition to the old features the <a href="https://github.com/TG9541/stm8ef/releases/edit/volatile">volatile</a> release tag will contain the binaries from the latest successful <a href="https://github.com/TG9541/stm8ef/blob/master/.github/workflows/build-test.yml">build-test workflow</a>.</p> <h2>New Features</h2> <h3>Improved CREATE ... DOES&gt;</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="855580331" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/427" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/427/hovercard" href="https://github.com/TG9541/stm8ef/issues/427">#427</a> provides a much better implementation of <code>DOES&gt;</code> - and better means both <strong>faster</strong> and <strong>leaner</strong>.</p> <p>The execution speed of the new solution is on par with an ordinary CREATE, VARIABLE or CONSTANT as can be shown in the following example:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=": EMPTY CREATE DOES&gt; ; \ just return the address : CONS CREATE , DOES&gt; @ ; \ return data CREATE tcreate VARIABLE tvar EMPTY tempty 0 CONS tcons 0 CONSTANT tconstant"><pre>: EMPTY <span class="pl-k">CREATE</span> <span class="pl-k">DOES&gt;</span> ; <span class="pl-c">\ just return the address </span> : CONS <span class="pl-k">CREATE</span> , <span class="pl-k">DOES&gt;</span> @ ; <span class="pl-c">\ return data</span> <span class="pl-k">CREATE</span> tcreate <span class="pl-k">VARIABLE</span> tvar EMPTY tempty <span class="pl-c1">0</span> CONS tcons <span class="pl-c1">0</span> <span class="pl-k">CONSTANT</span> tconstant</pre></div> <p>The following measurements where done with PulseView on a STM8S001J3M3 with 16MHz HSI and code compiled to Flash ROM.</p> <table> <thead> <tr> <th>Test</th> <th>runtime</th> <th>cycles</th> </tr> </thead> <tbody> <tr> <td><code>tcreate</code></td> <td>1.3µs</td> <td>21</td> </tr> <tr> <td><code>tempty</code></td> <td>1.82µs</td> <td>29</td> </tr> <tr> <td><code>tvariable</code></td> <td>1.89µs</td> <td>30</td> </tr> <tr> <td><code>tconstant</code></td> <td>3.2µs</td> <td>51</td> </tr> <tr> <td><code>tcons</code></td> <td>3.3µs</td> <td>53</td> </tr> </tbody> </table> <p>This means that a runtime of an "empty" <code>DOES&gt;</code>, which returns the address of any data stored by a word definition, is 1.82µs. That's marginally faster than <code>VARIABLE</code> and just a bit slower than <code>CREATE</code>.</p> <p>The simple constant value implementation <code>: CONS CREATE , DOES&gt; @ ;</code> is also just a bit slower than the literal stored by <code>CONSTANT</code>. The latter uses the STM8 instruction <code>TRAP</code> and requires just 3 byte, just like the <code>CALL</code> to the word defined through <code>CONS</code>).</p> <p>The memory requirements compare as follows:</p> <table> <thead> <tr> <th>[bytes]</th> <th>old</th> <th>new</th> <th>diff</th> </tr> </thead> <tbody> <tr> <td><code>: empty CREATE DOES&gt; ;</code></td> <td>22</td> <td>18</td> <td>4</td> </tr> <tr> <td><code>empty a</code></td> <td>13</td> <td>7</td> <td>6</td> </tr> <tr> <td>STM8S001J3 binary</td> <td>4697</td> <td>4662</td> <td>35</td> </tr> </tbody> </table> <p>The old implementation needs 4 bytes more for a "defining word" and 6 bytes more for a "defined" (the new <code>DOES&gt;</code> has the same memory needs as a word defined by <code>CREATE</code>, <code>CONSTANT</code> or <code>VARIABLE</code>).</p> <p>Also the STM8 eForth binary is 35 bytes smaller than before.</p> <h3>Improved &gt;REL</h3> <p><code>&gt;REL</code> is an implementation of <code>IF ... ELSE ... THEN</code> using relative addressing modes. It's meant to be used as a compiler extension loaded into RAM as a scaffold for, e.g., compiling fast and extra compact ISRs (interrupt service routines) into Flash ROM.</p> <p><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Eelkhoorn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Eelkhoorn">@Eelkhoorn</a> noticed that RAM space for the scaffolding code can be reduced and provided an <a href="https://github.com/TG9541/stm8ef/pull/428/files">improved implementation</a>.</p> <h3>Words for Forth Standard compatibility</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="860179566" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/430" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/430/hovercard" href="https://github.com/TG9541/stm8ef/issues/430">#430</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="910626941" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/438" data-hovercard-type="pull_request" data-hovercard-url="/TG9541/stm8ef/pull/438/hovercard" href="https://github.com/TG9541/stm8ef/pull/438">#438</a> added library words for making STM8 eForth a bit more compatible with the <a href="https://forth-standard.org/" rel="nofollow">Forth Standard</a>. Some of the words are just "No Operation" dummy words (e.g. <code>ALIGN</code>), some aliases (e.g., <code>INVERT</code>), some simple definitions (e.g. <code>&gt;BODY</code> and some genuine extensions (e.g., <code>VALUE ... TO</code>).</p> <p>Please be aware that not all of these Forth Standard words will always do what you expect, e.g.:</p> <ul> <li><code>VALUE ... TO</code> (like <code>DEFER ... IS</code>) assumes a writable dictionary</li> <li>some words like <code>STATE</code> emulate some just of the standard semantics</li> </ul> <table> <thead> <tr> <th>Forth Standard</th> <th>STM8 eForth implementation</th> </tr> </thead> <tbody> <tr> <td><code>&gt;BODY</code></td> <td><code>: &gt;BODY ( xt -- a-addr ) 3 + ;</code></td> </tr> <tr> <td><code>ALIGN</code></td> <td><em>no op</em></td> </tr> <tr> <td><code>ALIGNED</code></td> <td><em>no op</em></td> </tr> <tr> <td><code>C"</code></td> <td><code>' $" ALIAS C"</code></td> </tr> <tr> <td><code>CHAR+</code></td> <td><code>' 1+ ALIAS CHAR+ ( c-addr1 -- c-addr2 )</code></td> </tr> <tr> <td><code>CHAR</code></td> <td><code>: CHAR ( "char" -- c ) BL WORD CHAR+ C@ ;</code></td> </tr> <tr> <td><code>CHARS</code></td> <td><em>no op</em></td> </tr> <tr> <td><code>[CHAR]</code></td> <td><code>: [CHAR] ( "name"&lt;spaces -- ) CHAR POSTPONE LITERAL ; IMMEDIATE</code></td> </tr> <tr> <td><code>COMPILE,</code></td> <td><code>' CALL, ALIAS COMPILE, ( xt -- )</code></td> </tr> <tr> <td><code>ENVIRONMENT?</code></td> <td><code>: ENVIRONMENT? ( c-addr u -- false ) 2DROP 0 ;</code></td> </tr> <tr> <td><code>INVERT</code></td> <td><code>' NOT ALIAS INVERT ( x1 -- x2 ) </code></td> </tr> <tr> <td><code>J</code></td> <td>like <code>I</code> (only for <code>DO ... LOOP</code>, not <code>FOR ... NEXT</code>)</td> </tr> <tr> <td><code>STATE</code></td> <td>"kludge" using <code>STATE?</code> and a variable <code>stateflag</code></td> </tr> <tr> <td><code>TO</code></td> <td>see <a href="https://github.com/TG9541/stm8ef/blob/master/lib/VALUE"><code>VALUE</code></a></td> </tr> <tr> <td><code>VALUE</code></td> <td>limited to writable dictionary (RAM or NVM when writable) see <a href="https://github.com/TG9541/stm8ef/blob/master/lib/VALUE"><code>lib/VALUE</code></a></td> </tr> </tbody> </table> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="860179566" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/430" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/430/hovercard" href="https://github.com/TG9541/stm8ef/issues/430">#430</a> refactored <code>CREATE</code> and <code>VARIABLE</code> in order to facilitate implementing the Forth Standard words <code>VALUE</code> and <code>TO</code>.</p> <p>The following additional words are already available in <a href="https://github.com/TG9541/stm8ef/releases/edit/volatile">volatile</a> and they will be available in the next release (2.2.29):</p> <table> <thead> <tr> <th>Forth Standard</th> <th>STM8 eForth implementation</th> </tr> </thead> <tbody> <tr> <td><code>CELL+</code></td> <td><code>' 2+ ALIAS CELL+ ( c-addr1 -- c-addr2 )</code></td> </tr> <tr> <td><code>CELLS</code></td> <td><code>' 2* ALIAS CELLS ( n1 -- n2 )</code></td> </tr> <tr> <td><code>FALSE</code></td> <td><code>' 0 ALIAS FALSE ( -- false )</code></td> </tr> <tr> <td><code>RSHIFT</code></td> <td>like <code>LSHIFT ( n1 u -- n2 )</code></td> </tr> <tr> <td><code>TRUE</code></td> <td><code>' -1 ALIAS TRUE ( -- true )</code></td> </tr> </tbody> </table> <h3>Improved "pictured number" words</h3> <p>While working on optional words for Forth Standard compatibility it became clear that while Forth Standard compliant "pictured number output" with <code># ( ud -- ud)</code> instead of <code># ( u -- u)</code> (double instead of single math) would increase the code size only marginally but the math would make printing numbers in a background process slower. This might break applications that print numbers in a background task as the limit of 1ms task run-time is exceeded (unless a fast 32bit/8bit division or buffered I/O is used).</p> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873728097" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/433" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/433/hovercard" href="https://github.com/TG9541/stm8ef/issues/433">#433</a> explored options for improving the code. It turned out that <code>#</code> can be made faster by using the instruction <code>DIV X,A</code> (with the <a href="https://github.com/TG9541/stm8ef/blob/de23e35ef57ff0f3b25359bf9badacfab42385e7/inc/bgtask.inc#L48"><code>DIV</code>/<code>DIVW</code> erratum work-around</a>). The code could also be made leaner by in-lining the code of <code>DIGIT</code> and <code>EXTRACT</code> (these are eForth words which are not available in other 16bit Forth implementations, e.g., the well known <a href="https://github.com/ForthHub/F83">F83</a> - they also don't appear in the Forth Standard).</p> <p>PulseView and the word <code>..</code> (which toggles a GPIO with <code>PLo</code> and <code>PHi</code>) were used for testing:</p> <p><code>: .. ( u -- u ) PLo &lt;# PHi #S PLo #&gt; PHi TYPE ;</code></p> <p>For example, here is the timing for <code>DECIMAL 65535 ..</code>:</p> <p><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5466977/116795265-0b0b2300-aad4-11eb-964d-5d051b4a5540.png"><img src="https://user-images.githubusercontent.com/5466977/116795265-0b0b2300-aad4-11eb-964d-5d051b4a5540.png" alt="image" style="max-width: 100%;"></a></p> <p>The following table shows that <code>#</code> and <code>#S</code> are much faster now:</p> <table> <thead> <tr> <th>..</th> <th>Base</th> <th><code>&lt;# #S #&gt;</code> old [µs]</th> <th><code>&lt;# #S #&gt;</code> improved [µs]</th> </tr> </thead> <tbody> <tr> <td>65535</td> <td>10</td> <td>155</td> <td>31</td> </tr> <tr> <td>6</td> <td>10</td> <td>53</td> <td>22</td> </tr> <tr> <td>65535</td> <td>16</td> <td>131</td> <td>29</td> </tr> <tr> <td>65535</td> <td>2</td> <td>446</td> <td>60</td> </tr> </tbody> </table> <p>The toggles around <code>&lt;#</code> and <code>#&gt;</code> revealed that about 4µs can be saved by coding the 16bit <code>&lt;literal&gt; +</code> in <code>PAD</code> in assembler (13µs to 9µs - the numbers in the table contain this optimization). In a <code>BG</code> task <code>PAD</code> is slightly faster as it returns a constant address. When using numeric output in a background task, e.g. for presenting measurements on a LED display with <code>CR .</code>, the more efficient "pictured number words" makes a real difference.</p> <p>Note: Forth Standard compatible "pictured number" words with double number output (e.g. <code>D.</code>) can be provided later through library words. in In a 16bit Forth it's important to keep in mind that a limitation of <code>UM/MOD ( ud un -- ur uq )</code> - the 16bit result - correct output for double numbers is limited to "65536 x BASE - 1" (e.g., 655359 for base 10). For larger numbers a 32bit division with 32bit result is required (with 8bit divisor).</p> <h2>Bug fixes and other improvements</h2> <h3>Improved .0 (3-digit signed number print)</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873722733" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/432" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/432/hovercard" href="https://github.com/TG9541/stm8ef/issues/432">#432</a> fixes a few edge cases of <code>.0</code>, the signed number output for 3 digit (LED) displays: numbers smaller than -994 or larger than 9994 had digit overruns - and thus potentially wrong display values.</p> <p>The updated version was shown to work for the following values:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="-999 .0 DEF. ok -995 .0 -99 ok -99 .0 -9.9 ok 0 .0 0.0 ok 999 .0 99.9 ok 1000 .0 100 ok 7876 .0 788 ok 9995 .0 DEF. ok"><pre><span class="pl-c1">-999</span> .0 DEF. ok <span class="pl-c1">-995</span> .0 <span class="pl-c1">-99</span> ok <span class="pl-c1">-99</span> .0 <span class="pl-c1">-9.9</span> ok <span class="pl-c1">0</span> .0 <span class="pl-c1">0.0</span> ok <span class="pl-c1">999</span> .0 <span class="pl-c1">99.9</span> ok <span class="pl-c1">1000</span> .0 <span class="pl-c1">100</span> ok <span class="pl-c1">7876</span> .0 <span class="pl-c1">788</span> ok <span class="pl-c1">9995</span> .0 DEF. ok</pre></div> <h3>Leaner console text input words</h3> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="873945591" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/435" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/435/hovercard" href="https://github.com/TG9541/stm8ef/issues/435">#435</a> saved some ROM space in the input words <code>ACCEPT</code>, <code>KTAP</code>, and <code>QUERY</code>.</p> <h3>CREATE and VARIABLE refactored</h3> <p>Common functionality from <code>CREATE</code> and <code>VARIABLE</code> was <a href="https://github.com/TG9541/stm8ef/commit/5e484b5f395873248edfbe8e26a89ab699265771">refactored into the new word <code>ENTRY</code></a> (used by <code>VALUE</code>).</p> <h3>Set INT_TLI to COLD</h3> <p><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Eelkhoorn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Eelkhoorn">@Eelkhoorn</a> ran into a problem when changing ISR code in a development cycle:</p> <blockquote> <p>Uploading the I2C interrupt service routine to STM8L (both 051F3 and 151K4) can lead to corrupted ITC_SPR registers, persistent even after power cycle. Writing xt of COLD to INT_TLI (reset vector) solved the issue.<br> The last four entries of the interrupt vector table (0x8070 to 0x8080) seem to be corrupted after boot for STM8L.</p> </blockquote> <p>Pull request <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="963530460" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/440" data-hovercard-type="pull_request" data-hovercard-url="/TG9541/stm8ef/pull/440/hovercard" href="https://github.com/TG9541/stm8ef/pull/440">#440</a> appears to solve the issue. The problem needs further analysis.</p> github-actions[bot] tag:github.com,2008:Repository/62280367/volatile 2023-08-05T10:46:58Z Latest unstable binaries (volatile) <h1>About this release</h1> <p>This isn't really a release but a container for the binary artifacts from the latest build (see <a href="https://github.com/softprops/action-gh-release/issues/47" data-hovercard-type="issue" data-hovercard-url="/softprops/action-gh-release/issues/47/hovercard">this GH Release issue</a>). It's not only unstable (if tested!) but also volatile.</p> <p>This means that the artifacts in the "volatile" release can be used for testing or prototyping but they won't last. In order to keep a trace to the Git version at the end of the file <code>forth.asm</code> packed in the attached binary archives there is an identification record like the following:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="; ########################################## ; # Release info added by GitHub action: ; # repository: TG9541/stm8ef ; # branch name: refs/heads/master ; # sha: 8ee3453ce577181ef5e9bddda94f56d448dbf962 ; ##########################################"><pre class="notranslate"><code>; ########################################## ; # Release info added by GitHub action: ; # repository: TG9541/stm8ef ; # branch name: refs/heads/master ; # sha: 8ee3453ce577181ef5e9bddda94f56d448dbf962 ; ########################################## </code></pre></div> <p>The Git version used for creating the binary archive in this example is <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/TG9541/stm8ef/commit/8ee3453ce577181ef5e9bddda94f56d448dbf962/hovercard" href="https://github.com/TG9541/stm8ef/commit/8ee3453ce577181ef5e9bddda94f56d448dbf962"><tt>8ee3453</tt></a>.</p> <p>Please take note that not all archives provided in the release are up-to-date:</p> <table> <thead> <tr> <th>File</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>stm8ef-bin.tgz</td> <td>full binary release, suitable for STM8 eForth Modular Build method</td> </tr> <tr> <td>stm8ef-bin.zip</td> <td>binary release</td> </tr> <tr> <td>stm8ef-rst.tgz</td> <td>list file for debugging</td> </tr> <tr> <td>Source code (zip)</td> <td>GitHub source snapshot from original tag (outdated)</td> </tr> <tr> <td>Source code (tar.gz)</td> <td>GitHub source snapshot from original tag (outdated)</td> </tr> </tbody> </table> TG9541 tag:github.com,2008:Repository/62280367/2.2.28 2022-03-13T12:52:08Z POSTPONE, DEFER and an ISR/BG bug fix <h1>About the Release</h1> <p>The 2.2.28 development cycle had just started - the plan was to start making STM8 eForth a little bit more standard compliant so that using code from other embedded Forth systems gets easier when <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Eelkhoorn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Eelkhoorn">@Eelkhoorn</a> found a configuration error of the BG task data stack size: since <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="733138146" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/377" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/377/hovercard" href="https://github.com/TG9541/stm8ef/issues/377">#377</a> the stack size as exactly "0" so that the ISR data stack was used (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="853619634" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/424" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/424/hovercard" href="https://github.com/TG9541/stm8ef/issues/424">#424</a> ).</p> <p>Other than that, this release contains a potentially braking change: <code>POSTPONE</code> was introduced and since it has some many advantages over <code>COMPILE</code> and <code>COMPILE</code> it's now the default. Please refer to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="847996612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/413" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/413/hovercard" href="https://github.com/TG9541/stm8ef/issues/413">#413</a> for a discussion of the differences.</p> <h1>New Features</h1> <h2><code>POSTPONE</code> instead of <code>COMPILE</code> or <code>[COMPILE]</code></h2> <p>Modern Forth systems use <a href="https://forth-standard.org/standard/core/POSTPONE" rel="nofollow"><code>POSTPONE</code></a> instead of <code>COMPILE</code> or <code>[COMPILE]</code>. The main objective is code simplification, both for the programmer but also for a Forth system that generate machine code: in STM8 eForth <code>COMPILE </code> has to analyze the call type (absolute or relative) - which makes the code more complicated.</p> <h4>Why this is important</h4> <p>Making "Forth macros", words that compile code (e.g., <code>IF ... ELSE ... THEN</code>), requires compiling "compilation instructions" into a word instead of executing them during compilation.</p> <p>For instance <code>IF</code> can be implemented as follows:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=": &gt;MARK ( --A ) HERE 0 , ; : IF ( --A ) COMPILE ?branch &gt;MARK ; IMMEDIATE"><pre>: &gt;MARK <span class="pl-c">( --A )</span> HERE <span class="pl-c1">0</span> , ; : <span class="pl-k">IF</span> <span class="pl-c">( --A )</span> COMPILE ?branch &gt;MARK ; <span class="pl-k">IMMEDIATE</span></pre></div> <p>Since the dictionary entry of <code>IF</code> is flagged <code>IMMEDIATE</code> it will be executed, not compiled, when using a condition structure (e.g., <code>0&lt; IF DROP 0 THEN</code>). When executed, the word <code>COMPILE</code> takes the call address (<code>xt</code>, the execution token) of the next word (<code>?branch</code>) and compiles it into the destination code (e.g. the conditional phrase above). Note that <code>?branch</code> isn't flagged <code>IMMEDIATE</code> - if it were different it would be executed, not compiled, and <code>COMPILE</code> would not receive the expected <code>xt</code>.</p> <p>Sometimes <code>IMMEDIATE</code> words need to be compiled into a new word, not executed. In order to get the desired effect <code>[COMPILE]</code> would be required to enforce compilation of the immediate word, e.g.:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=": WHILE ( a --A a ) [COMPILE] IF SWAP ; IMMEDIATE"><pre>: <span class="pl-k">WHILE</span> <span class="pl-c">( a --A a )</span> <span class="pl-k">[COMPILE]</span> <span class="pl-k">IF</span> SWAP ; <span class="pl-k">IMMEDIATE</span></pre></div> <p>Here <code>[COMPILE]</code> overrides the <code>IMMEDIATE</code> flag of <code>IF</code> and compiles a call to this immediate word into the code of <code>WHILE</code>. It would also be possible to write <code>COMPILE [COMPILE] IF</code>, which would create a macro that compiles <code>IF</code> into the target code (just like using <code>COMPILE</code> on a regular word). In practice such a use case is rare.</p> <p>From this release on it's sufficient to write <code>POSTPONE</code> instead of <code>COMPILE</code> or <code>[COMPILE]</code>. This also makes porting code from more modern Forth systems easier since it's no longer necessary to figure out if it's <code>COMPILE</code> or <code>[COMPILE]</code> that you'll have to use instead.</p> <p>Legacy code can use <code>#require COMPILE</code> or <code>#require [COMPILE]</code>, which will load an alias to <code>POSTPONE</code>, to cover all but the most exotic use cases. If that does't work the legacy words can be re-enabled in the board configuration (and please file an issue).</p> <p>More examples and technical details are in the following issues:</p> <p><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="847996612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/413" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/413/hovercard" href="https://github.com/TG9541/stm8ef/issues/413">#413</a> POSTPONE supersedes COMPILE and [COMPILE]<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849197399" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/414" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/414/hovercard" href="https://github.com/TG9541/stm8ef/issues/414">#414</a> make COMPILE and [COMPILE] replaceable with ALIAS to POSTPONE<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849197399" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/414" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/414/hovercard" href="https://github.com/TG9541/stm8ef/issues/414">#414</a> add test for POSTPONE<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850184678" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/417" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/417/hovercard" href="https://github.com/TG9541/stm8ef/issues/417">#417</a> use COMPILIT instead of COMPILE in core<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in lib<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in &gt;REL<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in [']<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in ALIAS<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in DEFER<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in :NVM<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in S"<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in EVALUATE<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in CONSTANT<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in MARKER<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in VOC<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in VOCABULARY</p> <h2>Add <code>[']</code> and <code>DEFER ... IS</code></h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="842729590" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/411" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/411/hovercard" href="https://github.com/TG9541/stm8ef/issues/411">#411</a> adds the words <code>[']</code> (compile literal with <code>xt</code> of the following word) and <code>DEFER ... IS</code>.</p> <p>Please refer to the Forth Standard entries of <a href="https://forth-standard.org/standard/core/BracketTick" rel="nofollow"><code>[']</code></a>, <a href="https://forth-standard.org/standard/core/DEFER" rel="nofollow"><code>DEFER</code></a> and <a href="https://forth-standard.org/standard/core/IS" rel="nofollow"><code>IS</code></a>.</p> <h1>Other changes</h1> <h2>Core optimizations</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849917788" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/416" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/416/hovercard" href="https://github.com/TG9541/stm8ef/issues/416">#416</a> introduces a more compact <code>CALL,</code> with <code>COMPILIT</code> and some other core optimizations, especially for the transition from <code>COMPILE</code> and <code>[COMPILE]</code> to <code>POSTPONE</code>.</p> <h2>Tool changes</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="852677298" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/421" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/421/hovercard" href="https://github.com/TG9541/stm8ef/issues/421">#421</a> makes the <code>codeload.py</code> line length check less restrictive (trailing comments don't count).</p> <h2>Docs changes</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="831015787" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/409" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/409/hovercard" href="https://github.com/TG9541/stm8ef/issues/409">#409</a> proposes a work around for an STM8L151 serial bootloader erratum</p> <h1>Bug fixes</h1> <h2>BG task data stack size configuration error</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="853619634" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/424" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/424/hovercard" href="https://github.com/TG9541/stm8ef/issues/424">#424</a> describes a critical problem of the BG task data stack size configuration:</p> <ol> <li>Applications that use the BG task <em>and</em> an ISR that uses Forth code may suffer from BG task data stack corruption</li> <li>The BG stack has been 8 cells deep since the bug was introduced - this can also lead to foreground task stack corruption!</li> </ol> <p>The regression was introduced when the BG code was factored out in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="733138146" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/377" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/377/hovercard" href="https://github.com/TG9541/stm8ef/issues/377">#377</a>. It was still OK until the 2.2.26 release. The first release that contained this bug was 2.2.27.pre1. 2.2.27 was released 9/Mar/2021.</p> <h2>Incorrect <code>TIB</code> constant export</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="852326060" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/420" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/420/hovercard" href="https://github.com/TG9541/stm8ef/issues/420">#420</a> fixes an incorrect <code>TIB</code> constant export that broke <code>EVALUATE</code>. The bug was introduced in release 2.2.24. An automated test of <code>EVALUATE</code> was added.</p> TG9541 tag:github.com,2008:Repository/62280367/2.2.28.pre1 2021-04-07T20:09:17Z Start 2.2.28 Development Cycle: POSTPONE and DEFER <h1>About the Pre-Release</h1> <p>This release is going to modernize eForth by introducing some Forth-Standard words.</p> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="831015787" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/409" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/409/hovercard" href="https://github.com/TG9541/stm8ef/issues/409">#409</a>: work around for STM8L151 serial bootloader erratum</p> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="842729590" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/411" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/411/hovercard" href="https://github.com/TG9541/stm8ef/issues/411">#411</a>: add ['] and DEFER ... IS<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="842729590" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/411" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/411/hovercard" href="https://github.com/TG9541/stm8ef/issues/411">#411</a> add test for DEFER ... IS and [']</p> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="847996612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/413" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/413/hovercard" href="https://github.com/TG9541/stm8ef/issues/413">#413</a> POSTPONE supersedes COMPILE and [COMPILE]<br> fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="847996612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/413" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/413/hovercard" href="https://github.com/TG9541/stm8ef/issues/413">#413</a> POSTPONE supersedes COMPILE and [COMPILE]</p> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849197399" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/414" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/414/hovercard" href="https://github.com/TG9541/stm8ef/issues/414">#414</a> implement POSTPONE<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849197399" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/414" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/414/hovercard" href="https://github.com/TG9541/stm8ef/issues/414">#414</a> add test for POSTPONE<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849197399" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/414" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/414/hovercard" href="https://github.com/TG9541/stm8ef/issues/414">#414</a> make COMPILE and [COMPILE] replaceable with ALIAS to POSTPONE</p> <p><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849917788" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/416" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/416/hovercard" href="https://github.com/TG9541/stm8ef/issues/416">#416</a> some minor core optimizations<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849917788" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/416" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/416/hovercard" href="https://github.com/TG9541/stm8ef/issues/416">#416</a> some minor core optimizations<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="849917788" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/416" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/416/hovercard" href="https://github.com/TG9541/stm8ef/issues/416">#416</a> more compact CALL,</p> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850184678" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/417" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/417/hovercard" href="https://github.com/TG9541/stm8ef/issues/417">#417</a> use COMPILIT instead of COMPILE in core</p> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in lib<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in &gt;REL<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in [']<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in ALIAS<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in DEFER<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in :NVM<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in S"<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in EVALUATE<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in CONSTANT<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in MARKER<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in VOC<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="850358612" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/419" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/419/hovercard" href="https://github.com/TG9541/stm8ef/issues/419">#419</a> use POSTPONE in VOCABULARY</p> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="852326060" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/420" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/420/hovercard" href="https://github.com/TG9541/stm8ef/issues/420">#420</a> incorrect TIB constant export<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="852326060" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/420" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/420/hovercard" href="https://github.com/TG9541/stm8ef/issues/420">#420</a> incorrect TIB constant export</p> <p><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="852677298" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/421" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/421/hovercard" href="https://github.com/TG9541/stm8ef/issues/421">#421</a> codeload.py: less restrictive line length check</p> TG9541 tag:github.com,2008:Repository/62280367/2.2.27 2021-03-15T18:49:47Z UM/MOD Bugfix and Improvements Release <h1>About the release</h1> <p>Whether or not you need any of the new features in this release there is a very good reason to use it: it fixes a very old bug in UM/MOD. It's possible that this bug can be traced to an early FIG-Forth release for the 6502:</p> <blockquote> <p>Bill Ragsdale: UM/MOD had this or a similar range error in my first published fig-FORTH Model. Fixed in the second edition but by then the damage was done. I suspect that error propagated much later.</p> </blockquote> <p>The good news: as long as the divisor is smaller than $8000 all is well. More about the bug below.</p> <h1>New Features</h1> <h2>A simple debug console</h2> <p>It's sometimes useful to inspect the system (e.g. the stack) while executing a word in an application. That can be done by calling <code>OUTER</code>, the Forth interpreter, from user code. The new word <code>BYE</code> leaves this interpreter (but not that of the normal console).</p> <p>Here is an example session:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#require BYE \ ... Closing: ./lib/BYE ok : test 1 2 3 OUTER . . . ; ok test&lt;ENTER&gt;.S&lt;ENTER&gt; 1 2 3 &lt;sp ok . 3 ok 4 ok bye 4 2 1 ok"><pre>#require<span class="pl-s"> BYE</span> <span class="pl-c">\ ...</span> Closing: ./lib/BYE ok : test <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">3</span> OUTER . . . ; ok test&lt;ENTER&gt;.S&lt;ENTER&gt; <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">3</span> &lt;sp ok . <span class="pl-c1">3</span> ok <span class="pl-c1">4</span> ok bye <span class="pl-c1">4</span> <span class="pl-c1">2</span> <span class="pl-c1">1</span> ok</pre></div> <p>Note that there is no prompt indication when the "debug interpreter" gets active after <code>test&lt;ENTER&gt;</code>. Also note that any <code>?</code>response from the interpreter means that the stack was emptied. Only a debug interpreter with a different type of error response would be able to prevent that.</p> <p>The issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="724098249" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/372" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/372/hovercard" href="https://github.com/TG9541/stm8ef/issues/372">#372</a> "better BYE for debug console" contains technical details.</p> <h2>Fully Modular Background Task code</h2> <p>The BG code is now "fully modular" which means that it can be replaced with user code by placing a modified copy of <a href="https://github.com/TG9541/stm8ef/blob/master/inc/bgtask.inc"><code>bgtask.inc</code></a> into a Board folder.</p> <p>Now the background task can also be run by the STM8L RM0031 device RTC (think "alarm") or by the Wakeup Timer.</p> <p>Details are in the issues <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="733091740" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/375" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/375/hovercard" href="https://github.com/TG9541/stm8ef/issues/375">#375</a> "improve BG task interrupt configuration options" and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="733138146" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/377" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/377/hovercard" href="https://github.com/TG9541/stm8ef/issues/377">#377</a> "factor out BG task code".</p> <h2>Better control of interrupt vectors in the C interface</h2> <p>In STM8 eForth the linker is called by SDCC (which is the main task of SDCC in this project). The C interface in <code>main.c</code> used to depend on a fixed a set of interrupt vectors which limited the configuration of core features, e.g. the Background Task. This definition is now done by an include file in the Board folder.</p> <p>Details are in the issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="736384297" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/379" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/379/hovercard" href="https://github.com/TG9541/stm8ef/issues/379">#379</a> "re-order C-Stub infrastructure".</p> <h2>Relative Addressing for <code>IF .. ELSE .. THEN</code></h2> <p>Some use cases require STM8 machine code branch instructions instead of <code>?branch</code> or <code>branch</code> that use absolute addressing (e.g. relocatable code in RAM, fast ISRs). Calculating the branch offset is better left to the compiler.</p> <p>This feature is implemented by exchanging control structures on the fly (i.e. by loading a bit of the compiler into RAM).</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#require &gt;REL NVM : test ( f -- ) IF .&quot; True&quot; ELSE .&quot; False&quot; THEN ; RAM"><pre>#require<span class="pl-s"> &gt;REL</span> NVM : test <span class="pl-c">( f -- )</span> <span class="pl-k">IF</span> ." <span class="pl-s"> True"</span> <span class="pl-k">ELSE</span> ." <span class="pl-s"> False"</span> <span class="pl-k">THEN</span> ; RAM</pre></div> <p>Here, <code>IF</code> will compile to <code>&gt;Y JREQ rel</code> and <code>ELSE</code> to <code>JRA rel</code>:</p> <p><code>' test 20 dump</code><br> <code>955B CD 8A C</code> <strong>27 B</strong> <code>CD 89 91 5 20 54 72 75 65</code> <strong>20 A</strong> <code> ___'_____ True _</code><br> <code>956B CD 89 91 6 20 46 61 6C 73 65 81 0 0 0 0 0 ____ False______ ok</code></p> <p>While this already solves the problem of relocatable code the most important use case of this solution is using fast bit test (<a href="https://github.com/TG9541/stm8ef/blob/master/lib/%5DB%40IF"><code>[ a #b ]B@IF</code></a>) or anything that can be done with Forth - Assembler interface (e.g. <a href="https://github.com/TG9541/stm8ef/blob/master/lib/%5DA%3CIF"><code>[ c ]A&lt;IF</code></a>).</p> <p>Details are in the issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="751049118" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/382" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/382/hovercard" href="https://github.com/TG9541/stm8ef/issues/382">#382</a> "IF .. ELSE .. THEN with relative addressing".</p> <h2>More machine code generating words</h2> <p>STM8 eForth doesn't have STM8 assembler words (yet). Instead "macros" are used to generate assembler instructions (e.g. conditional branch, bit and byte transfers). A number of new "macros" have been added to better support time critical ISRs (Interrupt Service Routine).</p> <table> <thead> <tr> <th>Word</th> <th>What it does</th> </tr> </thead> <tbody> <tr> <td><code>[ a ]@</code></td> <td>push contents of word at literal a to TOS</td> </tr> <tr> <td><code>[ a ]@IF</code></td> <td>test contents of word at literal a and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ ... c ]A&lt;IF</code></td> <td>test if A is &lt; literal c and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ f a #b ]B!</code></td> <td>set bit #b in byte at literal a to literal f</td> </tr> <tr> <td><code>[ a #b ]B?</code></td> <td>push flag with value of bit #b in byte at literal a to TOS</td> </tr> <tr> <td><code>[ a #b ]B@IF</code></td> <td>test bit #b at literal a and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ a #b ]BC</code></td> <td>copy bit #b in byte at literal a to carry flag</td> </tr> <tr> <td><code>[ a #b ]BCPL</code></td> <td>complement bit #b in byte at literal a</td> </tr> <tr> <td><code>[ c a ]C!</code></td> <td>set byte at literal a to literal c</td> </tr> <tr> <td><code>[ a ]C@IF</code></td> <td>test contents of byte at literal a and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ a #b ]CB</code></td> <td>copy carry flag to bit #b in byte at literal a</td> </tr> <tr> <td><code>[ f a #b ]SPIN</code></td> <td>spin until bit #b at literal a is equal to f</td> </tr> <tr> <td><code>[ ... n ]Y&lt;IF</code></td> <td>test if Y is &lt; literal n and perform <code>IF</code> w\ relative branch</td> </tr> </tbody> </table> <p>Also see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="754724994" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/383" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/383/hovercard" href="https://github.com/TG9541/stm8ef/issues/383">#383</a> "machine code generating words for ISR programming"</p> <p>Examples are in the I2C code below.</p> <h2>An I2C Master driver</h2> <p>On the face of it the STM8 I2C interface is a bit difficult to use. An easy to use driver has been added to the core. Example code is <a href="https://gist.github.com/TG9541/5c3405320794d91ef8129734a4bfc880#gistcomment-3565181">here</a>.</p> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="758000352" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/385" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/385/hovercard" href="https://github.com/TG9541/stm8ef/issues/385">#385</a> implements a generic STM8 I2C Master using the STM8 I2C peripheral. The code is event driven and can be used as a low-level driver for implementing higher-level device drivers.</p> <p>The file <a href="https://github.com/TG9541/stm8ef/blob/master/mcu/I2CMA"><code>I2CMA</code></a> contains an application example. More examples are in this <a href="https://gist.github.com/TG9541/5c3405320794d91ef8129734a4bfc880#gistcomment-3565181">GitHub Gist</a>.</p> <h1>Tools updates</h1> <h2>Upgrade to Python3</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="787561903" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/390" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/390/hovercard" href="https://github.com/TG9541/stm8ef/issues/390">#390</a>: upgrades build tools to Python3: tools like <code>codeload.py</code> for build and test still depended on Python2.7, which is now all but dead. Upgrading to Python3 is overdue.</p> <p>The docker image <code>TG9541/docker-sdcc</code> also received an upgrade: the new version 3.9.9 uses Python3 and SDCC 3.9.0 (issues with the COM port simulation in uCsim in SDCC 4.0.7 couldn't immediately be resolve).</p> <h2>Improved codeload.py</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="792860109" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/394" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/394/hovercard" href="https://github.com/TG9541/stm8ef/issues/394">#394</a> improved the <code>codeload.py</code> serial line target response tolerance (e.g. test output) and improved the usefulness of error messages.</p> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="787798396" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/392" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/392/hovercard" href="https://github.com/TG9541/stm8ef/issues/392">#392</a> introduced support for e4thcom "conditional transfer":</p> <p>From version 0.8.5 on e4thcom supports conditional transfer code after <code>#ifdef name</code>, e.g.</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="\ example: skip the rest of the file if test is defined #ifdef test \\ \ example define test unless it's defined #ifndef test : test ; \ example: load PD_DDR unless it's defined #ifndef PD_DDR \res MCU: STM8S103 #ifndef PD_DDR \res export PD_DDR"><pre><span class="pl-c">\ example: skip the rest of the file if test is defined</span> #ifdef test \\ <span class="pl-c">\ example define test unless it's defined</span> #ifndef test : test ; <span class="pl-c">\ example: load PD_DDR unless it's defined</span> #ifndef PD_DDR \res MCU: STM8S103 #ifndef PD_DDR \res export PD_DDR</pre></div> <p>The following rules apply:</p> <ul> <li>the conditionals <code>#ifdef &lt;name&gt;</code> or <code>#ifndef &lt;name&gt;</code> have to be the first word on a line</li> <li>ordinary STM8 eForth console input may follow a conditional</li> <li><code>#require</code>, <code>#include</code>, <code>\res</code> or <code>\\</code> may follow a conditional and have to be the first word on a line in all other cases</li> </ul> <p>The change will be added to <code>codeload3.py</code> (update to Python3 in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="787561903" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/390" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/390/hovercard" href="https://github.com/TG9541/stm8ef/issues/390">#390</a>) and the new version will be the new default. The Python2.7 version will be preserved as <code>codeload2.py</code>.</p> <h1>Bug fixes</h1> <h2>UM/MOD bug</h2> <p><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/MrMarkB/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/MrMarkB">@MrMarkB</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Picatout/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Picatout">@Picatout</a> identified and fixed a number of bugs in <code>UM/MOD</code> that mode quotient and/or remainder invalid in the following cases:</p> <ul> <li>divisor larger than $7FFF</li> <li>MSB of the 32 bit dividend larger than the divisor</li> <li>invalid remainder in some other cases</li> </ul> <p>The defect also has some impact on <code>M/MOD</code>, <code>*/MOD</code> (edge cases and remainder) and <code>*/</code> (remainder). There is no known effect on <code>/MOD</code>, <code>MOD</code> and <code>/</code>.</p> <p>Following a discussion in the <a href="https://www.facebook.com/groups/2225595150855239" rel="nofollow">Forth2020 User Group</a> (on FaceBook) it became clear that the bug has indeed a very long history: it's likely that its origin is in an early FIG Forth release for the 6502, and it has since been copied to different architectures and addressed in different ways.</p> <p>Following the discussion <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/JeeeK/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/JeeeK">@JeeeK</a> provided a variant of the algorithm with improved entry and exit, and more efficient loop code.</p> <p>The fixed (and impoved) code was tested with random arguments using a script provided by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/MrMarkB/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/MrMarkB">@MrMarkB</a>.</p> <p>Please refer to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="799348106" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/400" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/400/hovercard" href="https://github.com/TG9541/stm8ef/issues/400">#400</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="803125171" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/401" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/401/hovercard" href="https://github.com/TG9541/stm8ef/issues/401">#401</a> for details!</p> <h1>Improvements and Other Changes</h1> <ul> <li>issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="797498701" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/396" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/396/hovercard" href="https://github.com/TG9541/stm8ef/issues/396">#396</a> adds the <code>inc</code> folder to tgz binary archives</li> <li>issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="824977721" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/407" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/407/hovercard" href="https://github.com/TG9541/stm8ef/issues/407">#407</a> add the words <code>LSHIFT</code> and <code>CRC8</code> for implementations of the <a href="https://gist.github.com/TG9541/348abfae54c79f1c1c5a4f4ed0dcfdf5">1-Wire ROMSEARCH</a> algorithm</li> </ul> TG9541 tag:github.com,2008:Repository/62280367/2.2.27.pre3 2021-02-09T06:39:44Z Bug fix UM/MOD <h1>Bug Fix</h1> <p><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/MrMarkB/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/MrMarkB">@MrMarkB</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Picatout/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Picatout">@Picatout</a> identified and fixed a number of bugs in <code>UM/MOD</code> that mode quotient and/or remainder invalid in the following cases:</p> <ul> <li>divisor larger than $7FFF</li> <li>MSB of the 32 bit dividend larger than the divisor</li> <li>invalid remainder in some other cases</li> </ul> <p>The defect also has some impact on <code>M/MOD</code>, <code>*/MOD</code> (edge cases and remainder) and <code>*/</code> (remainder).</p> <p>There is no known effect on <code>/MOD</code>, <code>MOD</code> and <code>/</code>.</p> <p>Please refer to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="799348106" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/400" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/400/hovercard" href="https://github.com/TG9541/stm8ef/issues/400">#400</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="803125171" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/401" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/401/hovercard" href="https://github.com/TG9541/stm8ef/issues/401">#401</a> for details!</p> TG9541 tag:github.com,2008:Repository/62280367/2.2.27.pre2 2021-02-13T07:43:06Z Tools improvements <h1>Tools now use Python3</h1> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="787561903" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/390" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/390/hovercard" href="https://github.com/TG9541/stm8ef/issues/390">#390</a>: upgrade build tools to Python3</p> <h1>codeload.py: #ifdef for conditional transfer and other improvements</h1> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="787798396" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/392" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/392/hovercard" href="https://github.com/TG9541/stm8ef/issues/392">#392</a> support e4thcom conditional transfer<br> fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="792860109" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/394" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/394/hovercard" href="https://github.com/TG9541/stm8ef/issues/394">#394</a> codeload.py: improve serial line target response and error…</p> <h1>Minor fix</h1> <p>fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="797498701" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/396" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/396/hovercard" href="https://github.com/TG9541/stm8ef/issues/396">#396</a> add inc folder to tgz binary archive</p> <h1>Known Bugs</h1> <ul> <li>The <code>hi</code> message will state that the version umber is <code>2.2.27.pre1</code> not <code>2.2.27.pre2</code> as it should</li> </ul> TG9541 tag:github.com,2008:Repository/62280367/2.2.27.pre1 2020-12-23T09:32:22Z More features release <h1>STM8 eForth 2.2.27 development cycle</h1> <p>As most STM8 devices are now officially supported, this release is going to concentrate on features, e.g. drivers for STM8 peripherals or support of the Wakeup Timer for the Background Task (instead of using TIM2).</p> <h2>A simple debug console</h2> <p>It's sometimes useful to inspect the system (e.g. the stack) while executing a word in an application. That can be done by calling <code>OUTER</code>, the Forth interpreter, from user code. The new word <code>BYE</code> leaves this interpreter (but not that of the normal console).</p> <p>Here is an example session:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#require BYE \ ... Closing: ./lib/BYE ok : test 1 2 3 OUTER . . . ; ok test&lt;ENTER&gt;.S&lt;ENTER&gt; 1 2 3 &lt;sp ok . 3 ok 4 ok bye 4 2 1 ok"><pre>#require<span class="pl-s"> BYE</span> <span class="pl-c">\ ...</span> Closing: ./lib/BYE ok : test <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">3</span> OUTER . . . ; ok test&lt;ENTER&gt;.S&lt;ENTER&gt; <span class="pl-c1">1</span> <span class="pl-c1">2</span> <span class="pl-c1">3</span> &lt;sp ok . <span class="pl-c1">3</span> ok <span class="pl-c1">4</span> ok bye <span class="pl-c1">4</span> <span class="pl-c1">2</span> <span class="pl-c1">1</span> ok</pre></div> <p>Note that there is no prompt indication when the "debug interpreter" gets active after <code>test&lt;ENTER&gt;</code>. Also note that any <code>?</code>response from the interpreter means that the stack was emptied. Only a debug interpreter with a different type of error response would be able to prevent that.</p> <p>The issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="724098249" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/372" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/372/hovercard" href="https://github.com/TG9541/stm8ef/issues/372">#372</a> "better BYE for debug console" contains technical details.</p> <h2>Fully Modular Background Task code</h2> <p>The BG code is now "fully modular" which means that it can be replaced with user code by placing a modified copy of <a href="https://github.com/TG9541/stm8ef/blob/master/inc/bgtask.inc"><code>bgtask.inc</code></a> into a Board folder.</p> <p>Now the background task can also be run by the STM8L RM0031 device RTC (think "alarm") or by the Wakeup Timer.</p> <p>Details are in the issues <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="733091740" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/375" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/375/hovercard" href="https://github.com/TG9541/stm8ef/issues/375">#375</a> "improve BG task interrupt configuration options" and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="733138146" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/377" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/377/hovercard" href="https://github.com/TG9541/stm8ef/issues/377">#377</a> "factor out BG task code".</p> <h2>Better control of interrupt vectors in the C interface</h2> <p>In STM8 eForth the linker is called by SDCC (which is the main task of SDCC in this project). The C interface in <code>main.c</code> used to depend on a fixed a set of interrupt vectors which limited the configuration of core features, e.g. the Background Task. This definition is now done by an include file in the Board folder.</p> <p>Details are in the issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="736384297" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/379" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/379/hovercard" href="https://github.com/TG9541/stm8ef/issues/379">#379</a> "re-order C-Stub infrastructure".</p> <h2>Relative Addressing for <code>IF .. ELSE .. THEN</code></h2> <p>Some use cases require STM8 machine code branch instructions instead of <code>?branch</code> or <code>branch</code> that use absolute addressing (e.g. relocatable code in RAM, fast ISRs). Calculating the branch offset is better left to the compiler.</p> <p>This feature is implemented by exchanging control structures on the fly (i.e. by loading a bit of the compiler into RAM).</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#require &gt;REL NVM : test ( f -- ) IF .&quot; True&quot; ELSE .&quot; False&quot; THEN ; RAM"><pre>#require<span class="pl-s"> &gt;REL</span> NVM : test <span class="pl-c">( f -- )</span> <span class="pl-k">IF</span> ." <span class="pl-s"> True"</span> <span class="pl-k">ELSE</span> ." <span class="pl-s"> False"</span> <span class="pl-k">THEN</span> ; RAM</pre></div> <p>Here, <code>IF</code> will compile to <code>&gt;Y JREQ rel</code> and <code>ELSE</code> to <code>JRA rel</code>:</p> <p><code>' test 20 dump</code><br> <code>955B CD 8A C</code> <strong>27 B</strong> <code>CD 89 91 5 20 54 72 75 65</code> <strong>20 A</strong> <code> ___'_____ True _</code><br> <code>956B CD 89 91 6 20 46 61 6C 73 65 81 0 0 0 0 0 ____ False______ ok</code></p> <p>While this already solves the problem of relocatable code the most important use case of this solution is using fast bit test (<a href="https://github.com/TG9541/stm8ef/blob/master/lib/%5DB%40IF"><code>[ a #b ]B@IF</code></a>) or anything that can be done with Forth - Assembler interface (e.g. <a href="https://github.com/TG9541/stm8ef/blob/master/lib/%5DA%3CIF"><code>[ c ]A&lt;IF</code></a>).</p> <p>Details are in the issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="751049118" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/382" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/382/hovercard" href="https://github.com/TG9541/stm8ef/issues/382">#382</a> "IF .. ELSE .. THEN with relative addressing".</p> <h2>More machine code generating words</h2> <p>STM8 eForth doesn't have STM8 assembler words (yet). Instead "macros" are used to generate assembler instructions (e.g. conditional branch, bit and byte transfers). A number of new "macros" have been added to better support time critical ISRs (Interrupt Service Routine).</p> <table> <thead> <tr> <th>Word</th> <th>Explanation</th> </tr> </thead> <tbody> <tr> <td><code>[ a ]@</code></td> <td>push contents of word at literal a to TOS</td> </tr> <tr> <td><code>[ a ]@IF</code></td> <td>test contents of word at literal a and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ ... c ]A&lt;IF</code></td> <td>test if A is &lt; literal c and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ f a #b ]B!</code></td> <td>set bit #b in byte at literal a to literal f</td> </tr> <tr> <td><code>[ a #b ]B?</code></td> <td>push flag with value of bit #b in byte at literal a to TOS</td> </tr> <tr> <td><code>[ a #b ]B@IF</code></td> <td>test bit #b at literal a and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ a #b ]BC</code></td> <td>copy bit #b in byte at literal a to carry flag</td> </tr> <tr> <td><code>[ a #b ]BCPL</code></td> <td>complement bit #b in byte at literal a</td> </tr> <tr> <td><code>[ c a ]C!</code></td> <td>set byte at literal a to literal c</td> </tr> <tr> <td><code>[ a ]C@IF</code></td> <td>test contents of byte at literal a and perform <code>IF</code> w\ relative branch</td> </tr> <tr> <td><code>[ a #b ]CB</code></td> <td>copy carry flag to bit #b in byte at literal a</td> </tr> <tr> <td><code>[ f a #b ]SPIN</code></td> <td>spin until bit #b at literal a is equal to f</td> </tr> <tr> <td><code>[ ... n ]Y&lt;IF</code></td> <td>test if Y is &lt; literal n and perform <code>IF</code> w\ relative branch</td> </tr> </tbody> </table> <p>Also see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="754724994" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/383" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/383/hovercard" href="https://github.com/TG9541/stm8ef/issues/383">#383</a> "machine code generating words for ISR programming"</p> <h2>An I2C Master driver</h2> <p>On the face of it the STM8 I2C interface is a bit difficult to use. An easy to use driver has been added to the core. Example code is <a href="https://gist.github.com/TG9541/5c3405320794d91ef8129734a4bfc880#gistcomment-3565181">here</a>.</p> <p>Refr tp <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="758000352" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/385" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/385/hovercard" href="https://github.com/TG9541/stm8ef/issues/385">#385</a> "generic STM8 I2C Master" for details.</p> TG9541 tag:github.com,2008:Repository/62280367/2.2.26 2020-11-18T06:19:58Z The STM8L Release <h1>About the release</h1> <p>This is release is very much about fully supporting STM8L devices (i.e. the likes of <a href="https://www.st.com/resource/en/datasheet/stm8l051f3.pdf" rel="nofollow">STM8L051F3</a>, <a href="https://www.st.com/resource/en/datasheet/stm8l151K4.pdf" rel="nofollow">STM8L151C6</a> or <a href="https://www.st.com/resource/en/datasheet/stm8l152r8.pdf" rel="nofollow">STM8L152R8</a>).</p> <p>While STM8S peripherals are simple and the pin and clock configuration is trivial, the STM8L designers clearly had both "larger" and "many more" spec sheets. The "many more" one can be seen in the number of configuration dependencies the programmer has to infer when trying to use one of the many features of the peripherals. For STM8 eForth this means that things that were implicit or hard-coded needed to be restructured and tested. The device families STM8S and STM8L now are on equal footing and the generalizations gained when adding STM8L support now also makes supporting STM8S variants easier.</p> <p>This release (finally) adds support for the low-end RM0013 STM8L device STM8L101, and, at the other end of the spectrum, STM8L "High density" devices like <a href="https://www.st.com/resource/en/datasheet/stm8l152r8.pdf" rel="nofollow">STM8L152R8</a> (also STM8L162 devices can be expected to work).</p> <p>Configuration folders with docs for typical "Low", "Medium" and High density" devices in both families have been added (refer to <a href="https://github.com/TG9541/stm8ef#generic-targets">Generic Targets</a> for a list of supported devices). So far the hypothesis holds that memory and peripheral properties are the same across a range of package and memory specs variants the devices for which these "6+1 device types" and there is no evidence that the "small world of STM8 devices" is much more complicated than that. If you have reason to believe that a device doesn't fit in this simple schema please file an issue!</p> <p>Devices in the following device families have not been examined:</p> <ul> <li>STM8L <a href="https://www.st.com/resource/en/reference_manual/dm00040094-stm8tl5xxx-microcontroller-family-stmicroelectronics.pdf" rel="nofollow">RM0312</a> family touch sensing MCUs, e.g. STM8TL5xxx</li> <li>STM8S <a href="https://www.st.com/resource/en/datasheet/stlux383a.pdf" rel="nofollow">STLUX</a> lighting MCUs and <a href="https://www.st.com/resource/en/datasheet/stnrg288a.pdf" rel="nofollow">STNRGxxxA</a> power conversion MCUs (including wireless charging <a href="https://www.st.com/resource/en/datasheet/stwbc.pdf" rel="nofollow">STWBC</a>)</li> </ul> <p>It shouldn't be big problem to get a Forth console on any of these devices, but for using the specialized peripherals it's maybe a good idea to apply ST's proprietary C-code libraries and configuration tools.</p> <h1>New Features</h1> <h2>STM8L: Peripheral addresses</h2> <p>New or improved register address (efr-) files for e4thcom and codeload.py are now available. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Eelkhoorn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Eelkhoorn">@Eelkhoorn</a> first provided an improved <code>STM8L151.efr</code> file, and in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="683629437" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/342" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/342/hovercard" href="https://github.com/TG9541/stm8ef/issues/342">#342</a> efr files for specific STM8L variants were created.</p> <p>STM8L "Medium" and "High density" should work with the generic <code>STM8L151.efr</code>.</p> <p>Peripheral register addresses of RM0031 "Low density" devices differ from STM8L "Medium density" and "High density" devices. Constants should be imported with <code>\res MCU: STM8L051</code>.</p> <p>The final group is RM0013 "Low density" devices like STM8L101F3 or STM8L001J3: here <code>\res MCU: STM8L101</code> should be used.</p> <h2>STM8 Timers and interrupts</h2> <p>Some applications, like <a href="https://github.com/TG9541/XY-LPWM">XY-LPWM</a>, need to use a different timer than TIM2 for the background task.<br> Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="723854974" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/369" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/369/hovercard" href="https://github.com/TG9541/stm8ef/issues/369">#369</a> adds this option to the STM8L device families.</p> <p>By setting <code>BG_USE_TIM3 = 1</code> in <code>globconf.inc</code> the Background task (BG) timer will use TIM3 instead of TIM2 in STM8L "Low density" devices. STM8L "Medium" and "High density" devices can also set <code>BG_USE_TIM1 = 1</code> for using TIM1. There is currently no support for TIM5 in STM8L "High density" devices.</p> <p>A conflict between a simulated serial port and the background task in an STM8L051F3 device was discovered and fixed in issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="675700564" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/340" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/340/hovercard" href="https://github.com/TG9541/stm8ef/issues/340">#340</a> STM8L interrupt priority of BG task.</p> <h2>STM8S UART and STM8L USART configurations</h2> <p>STM8L devices in the RM0031 family support USART GPIO function remapping. This can easily lead to a mismatch between the USART GPIO mapping an the GPIO output initialization.</p> <p>The following issues provide a solution:</p> <ul> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709608309" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/358" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/358/hovercard" href="https://github.com/TG9541/stm8ef/issues/358">#358</a> USART options for STM8L High Density devices</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="718913586" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/364" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/364/hovercard" href="https://github.com/TG9541/stm8ef/issues/364">#364</a> STM8L: general options for USART configuration</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="716851390" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/360" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/360/hovercard" href="https://github.com/TG9541/stm8ef/issues/360">#360</a> half-duplex USART console option for STM8L devices</li> </ul> <p>Common elements in <code>boardcore.inc</code> of all STM8L devices, together with docs in the target folders, that also show the default mapping, make the configuration easy.</p> <p>STM8S "Low" and "High density" devices use matching configuration items. <a href="https://github.com/TG9541/stm8ef/tree/master/STM8L152R8#usart-console-settings">STM8L152R8</a> has the most options.</p> <h2>Configuration of STM8 memory variants</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="659528684" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/330" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/330/hovercard" href="https://github.com/TG9541/stm8ef/issues/330">#330</a> made <code>EEPROMBASE</code>, the EEPROM start address, a <code>target.inc</code> configuration item which can be used to write device independent code.</p> <p>The new feature was used in issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="670730405" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/339" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/339/hovercard" href="https://github.com/TG9541/stm8ef/issues/339">#339</a> which removed hard-coded addresses in <a href="https://github.com/TG9541/stm8ef/blob/master/lib/EEALIAS"><code>EEALIAS</code></a> so that offloading a part of the dictionary to the EEPROM now works for both STM8S and STM8L devices. STM8L "Low density" devices have a much smaller EEPROM than those in the STM8S family, of course.</p> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709285877" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/355" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/355/hovercard" href="https://github.com/TG9541/stm8ef/issues/355">#355</a> introduced a <code>PAGESIZE</code> constant so that device independent code for "Flash ROM page write" can load it with <code>#require PAGESIZE</code>.</p> <p>Note that memory variants should be defined in the configuration folder's <code>target.inc</code> based on the device type (STM8L or STM8S, "Low", "Medium" or "High density"). If you're engineering a product you should care for selecting the device with the right specs. For casual use memory specs are most likely not that important (if there is evidence of the opposite please share it and file an issue).</p> <h2>Make target for OpenOCD / stm8-gdb</h2> <p>OpenOCD and stm8-gdb can be of great help, especially when dealing with new devices. Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="705168498" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/350" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/350/hovercard" href="https://github.com/TG9541/stm8ef/issues/350">#350</a> added support for an ELF target so that binaries that can be loaded into stm8-gdb can be built with <code>make BOARD=&lt;boardname&gt; debug</code>.</p> <p>There are notes about using OpenOCD and stm8-gdb is in <a href="https://gist.github.com/TG9541/79aa3bb1a56a8220eac8f57ab21302e1">this Gist</a> which also contain OpenOCD target configuration files for STM8L101 and STM8L051 "Low density" devices.</p> <h2>Experimental debug console</h2> <p>At times it's interesting to examine the state of a Forth program in the middle of the execution. Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="724098249" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/372" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/372/hovercard" href="https://github.com/TG9541/stm8ef/issues/372">#372</a> introduces a very simple debug console with the words <code>OUTER</code> and <code>BYE</code>.</p> <p>Here is a simple example:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#require BYE : test ( n -- ) FOR I DUP . 2 MOD 0= IF CR .&quot; Break - mind the stack - continue with BYE&quot; CR OUTER THEN NEXT .&quot; done&quot; ;"><pre>#require<span class="pl-s"> BYE</span> : test <span class="pl-c">( n -- )</span> <span class="pl-k">FOR</span> <span class="pl-c1">I</span> DUP . <span class="pl-c1">2</span> MOD 0= <span class="pl-k">IF</span> CR ." <span class="pl-s"> Break - mind the stack - continue with BYE"</span> CR OUTER <span class="pl-k">THEN</span> <span class="pl-k">NEXT</span> ." <span class="pl-s"> done"</span> ;</pre></div> <p>A debug session on a STM8S003F3, where a <code>FOR ... NEXT</code> loop is terminated manually by changing the loop counter on the return stack ($3FF growing down), looks like this:</p> <div class="highlight highlight-source-forth notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="66 7 test 7 6 Break - mind the stack - continue with BYE $03F0 10 dump 3F0 23 0 0 A 8D 1E 8D 12 1 1D 0 6 8D 1E 8D 12 1_______________ ok bye 5 4 Break - mind the stack - continue with BYE $03F0 10 dump 3F0 23 0 0 A 8D 1E 8D 12 1 1D 0 4 8D 1E 8D 12 1_______________ ok $3FA ? 4 ok 0 $3FA ! ok bye done ok . 66 ok"><pre><span class="pl-c1">66</span> <span class="pl-c1">7</span> test <span class="pl-c1">7</span> <span class="pl-c1">6</span> Break - mind the stack - continue with BYE <span class="pl-c1">$03F0</span> <span class="pl-c1">10</span> dump <span class="pl-c1">3F0</span> <span class="pl-c1">23</span> <span class="pl-c1">0</span> <span class="pl-c1">0</span> A <span class="pl-c1">8D</span> <span class="pl-c1">1E</span> <span class="pl-c1">8D</span> <span class="pl-c1">12</span> <span class="pl-c1">1</span> <span class="pl-c1">1D</span> <span class="pl-c1">0</span> <span class="pl-c1">6</span> <span class="pl-c1">8D</span> <span class="pl-c1">1E</span> <span class="pl-c1">8D</span> <span class="pl-c1">12</span> 1_______________ ok bye <span class="pl-c1">5</span> <span class="pl-c1">4</span> Break - mind the stack - continue with BYE <span class="pl-c1">$03F0</span> <span class="pl-c1">10</span> dump <span class="pl-c1">3F0</span> <span class="pl-c1">23</span> <span class="pl-c1">0</span> <span class="pl-c1">0</span> A <span class="pl-c1">8D</span> <span class="pl-c1">1E</span> <span class="pl-c1">8D</span> <span class="pl-c1">12</span> <span class="pl-c1">1</span> <span class="pl-c1">1D</span> <span class="pl-c1">0</span> <span class="pl-c1">4</span> <span class="pl-c1">8D</span> <span class="pl-c1">1E</span> <span class="pl-c1">8D</span> <span class="pl-c1">12</span> 1_______________ ok <span class="pl-c1">$3FA</span> ? <span class="pl-c1">4</span> ok <span class="pl-c1">0</span> <span class="pl-c1">$3FA</span> ! ok bye done ok . <span class="pl-c1">66</span> ok</pre></div> <p>Note that a single misspelled word will clear both the data and the return stacks. This will not only reset the console but it will terminate the program and typing <code>BYE</code> in this situation will crash the system! There is clearly room for improvement.</p> <h1>Boards and target support</h1> <h2>STM8L101F3 Low density support</h2> <p>Several differences between the STM8L101 and other STM8L devices (e.g. option bytes) delayed STM8 eForth support for a long time. STM8 eForth now supports RM0013 devices with <code>NVM</code>, the TIM2 based <code>BG</code> task and also the simulated serial interface. A binary release is available and the ordinary STM8 eForth workflows can be used.</p> <p>Please refer to the docs in the configuration folder <a href="https://github.com/TG9541/stm8ef/tree/master/STM8L101F3">STM8L101F3</a> and the following issues:</p> <ul> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="704897536" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/349" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/349/hovercard" href="https://github.com/TG9541/stm8ef/issues/349">#349</a> Add support for STM8L101 and STM8L001</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709585164" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/356" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/356/hovercard" href="https://github.com/TG9541/stm8ef/issues/356">#356</a> improve STM8L101 docs and efr file</li> <li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709585164" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/356" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/356/hovercard" href="https://github.com/TG9541/stm8ef/issues/356">#356</a> STM8L101F3: improve target.inc and docs Documentation</li> </ul> <p>Note that statements in the Wiki and other docs that the STM8L101 would not be supported have been changed. Using OpenOCD and gdb-stm8 were instrumental for adding support of this MCU.</p> <h2>STM8L051F3 Low density support</h2> <p>Support for RM0031 STM8L "Low density" devices has long been available. Test results with STM8L devices from applications in the community were used to revise support. Configuration options (e.g. USART, BG timer, simulated serial interface) and docs are now consistent with other STM8L devices.</p> <p>Please refer to the docs in the <a href="https://github.com/TG9541/stm8ef/tree/master/STM8L051F3">STM8L051F3</a> configuration folder.</p> <h2>STM8L Medium density support</h2> <p>Although there has long been the STM8L-Discovery configuration by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/plumbum/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/plumbum">@plumbum</a> requests for a more active support of STM8L "Medium density" devices like STM8L151K4 was a recurrent issue (e.g. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="328472501" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/218" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/218/hovercard" href="https://github.com/TG9541/stm8ef/issues/218">#218</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="482671160" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/267" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/267/hovercard" href="https://github.com/TG9541/stm8ef/issues/267">#267</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="486953122" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/268" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/268/hovercard" href="https://github.com/TG9541/stm8ef/issues/268">#268</a> or <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="553241129" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/287" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/287/hovercard" href="https://github.com/TG9541/stm8ef/issues/287">#287</a>).</p> <p><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Eelkhoorn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Eelkhoorn">@Eelkhoorn</a> finally sent an STM8L151K4 breakout board to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/TG9541/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/TG9541">@TG9541</a> and contributed to configuration files and to testing. Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709282513" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/354" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/354/hovercard" href="https://github.com/TG9541/stm8ef/issues/354">#354</a> implemented support for RM0031 STM8L "Medium density" devices, independent of "Medium+" and "High density" devices.</p> <p>Please refer to the docs in the <a href="https://github.com/TG9541/stm8ef/tree/master/STM8L151K4">STM8L151K4</a> configuration folder where console configuration options are listed.</p> <h2>STM8L High density support</h2> <p>STM8L "High density" devices have a rather rich feature set and more memory than other STM8L devices. Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709608309" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/358" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/358/hovercard" href="https://github.com/TG9541/stm8ef/issues/358">#358</a> added support for these devices and also describes the various console options. It's possible that this configuration also works for "Medium+ density" devices like the STM8L152R6 but no samples have been tested and feedback would be appreciated.</p> <p>Please refer to the docs in the <a href="https://github.com/TG9541/stm8ef/tree/master/STM8L152R8">STM8L152R8</a> configuration folder.</p> <h2>STM8S configuration folders</h2> <p>The configuration folders <a href="https://github.com/TG9541/stm8ef/tree/master/STM8S001J3">STM8S001J3</a>, <a href="https://github.com/TG9541/stm8ef/tree/master/STM8S105K4">STM8S105K4</a> and <a href="https://github.com/TG9541/stm8ef/tree/master/STM8S207RB">STM8S207RB</a> now contain docs with a common range of information.</p> <h2>STM8S103F3 Low density support</h2> <p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="723965797" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/371" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/371/hovercard" href="https://github.com/TG9541/stm8ef/issues/371">#371</a> added an STM8 eForth configuration with standard features and plain UART console settings and for STM8S "Low density" devices. <a href="https://github.com/TG9541/stm8ef/tree/master/STM8S103F3">STM8S103F3</a> includes docs in a similar form as for all the other base configurations and a binary release is provided.</p> <p>Alternative configurations are MINDEV, SWIMCOM, DOUBLECOM and CORE.</p> <h2>STM8S207RB default serial interface</h2> <p>In order to support the STM8S207K8 issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="665548974" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/334" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/334/hovercard" href="https://github.com/TG9541/stm8ef/issues/334">#334</a> changed the UART used by the console by default from the first UART (UART1) to the 2nd UART (UART3).</p> <p>This can be changed by setting <code>USE_UART2 = 0</code> in <code>globconf.inc</code>.</p> <h1>Improvements and Other Changes</h1> <p><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="582570577" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/295" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/295/hovercard" href="https://github.com/TG9541/stm8ef/issues/295">#295</a> extended memory access with FC@ and FC!<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="670601247" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/336" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/336/hovercard" href="https://github.com/TG9541/stm8ef/issues/336">#336</a>: factored solution for BF! abd LEBF! using B!<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="709282069" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/353" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/353/hovercard" href="https://github.com/TG9541/stm8ef/issues/353">#353</a> Add BTJT/ BTJF spin loop enhancement<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="670603469" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/337" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/337/hovercard" href="https://github.com/TG9541/stm8ef/issues/337">#337</a>: FC! and FC@ added<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="684174148" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/346" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/346/hovercard" href="https://github.com/TG9541/stm8ef/issues/346">#346</a> Add COMPONLY to the library<br> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="683820973" data-permission-text="Title is private" data-url="https://github.com/TG9541/stm8ef/issues/344" data-hovercard-type="issue" data-hovercard-url="/TG9541/stm8ef/issues/344/hovercard" href="https://github.com/TG9541/stm8ef/issues/344">#344</a> STM8L: fix interrupt number naming error</p> TG9541