<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/supervisor/port.h, branch 6.0.x</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.x</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.x'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-09-28T23:55:56+00:00</updated>
<entry>
<title>Add some NORETURN attributes</title>
<updated>2020-09-28T23:55:56+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-09-24T16:20:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=726dcdb60aa84b5070e5484a19e896abdaffeb93'/>
<id>urn:sha1:726dcdb60aa84b5070e5484a19e896abdaffeb93</id>
<content type='text'>
I have a function where it should be impossible to reach the end, so I put in a safe-mode reset at the bottom:
```
int find_unused_slot(void) {
    // precondition: you already verified that a slot was available
    for (int i=0; i&lt;NUM_SLOTS; i++) {
        if( slot_free(i)) {
            return i;
        }
    }
    safe_mode_reset(MICROPY_FATAL_ERROR);
}
```
However, the compiler still gave a diagnostic, because safe_mode_reset was not declared NORETURN.

So I started by teaching the compiler that reset_into_safe_mode never returned.  This leads at least one level deeper due to reset_cpu needing to be a NORETURN function.  Each port is a little different in this area.  I also marked reset_to_bootloader as NORETURN.
Additional notes:

 * stm32's reset_to_bootloader was not implemented, but now does a bare reset.  Most stm32s are not fitted with uf2 bootloaders anyway.
 * ditto cxd56
 * esp32s2 did not implement reset_cpu at all.  I used esp_restart().  (not tested)
 * litex did not implement reset_cpu at all.  I used reboot_ctrl_write.  But notably this is what reset_to_bootloader already did, so one or the other must be incorrect (not tested).  reboot_ctrl_write cannot be declared NORETURN, as it returns unless the special value 0xac is written), so a new unreachable forever-loop is added.
 * cxd56's reset is via a boardctl() call which can't generically be declared NORETURN, so a new unreacahble "for(;;)" forever-loop is added.
 * In several places, NVIC_SystemReset is redeclared with NORETURN applied.  This is accepted just fine by gcc.  I chose this as preferable to editing the multiple copies of CMSIS headers where it is normally declared.
 * the stub safe_mode reset simply aborts.  This is used in mpy-cross.
</content>
</entry>
<entry>
<title>Scanning WIP. Need to sort out supervisor memory</title>
<updated>2020-08-19T21:22:12+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-07-31T00:58:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1a6f4e0fe0f8417ea99a3cdb55d8764f47258bea'/>
<id>urn:sha1:1a6f4e0fe0f8417ea99a3cdb55d8764f47258bea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>supervisor: factor supervisor_background_tasks from sundry ports</title>
<updated>2020-07-15T16:49:44+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-07-13T15:33:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1df48176ce2e4111c4629269cb86d2a6e365a3d2'/>
<id>urn:sha1:1df48176ce2e4111c4629269cb86d2a6e365a3d2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Initial ESP32S2 port.</title>
<updated>2020-05-15T22:36:16+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-04-17T23:23:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6aaab005c5f3a781fec229640c74bf44a601fc97'/>
<id>urn:sha1:6aaab005c5f3a781fec229640c74bf44a601fc97</id>
<content type='text'>
Basic blinky works but doesn't check pins.
</content>
</entry>
<entry>
<title>Fix autoreload, neopixel, monotonic_ns and sleep w/o SD</title>
<updated>2020-03-13T18:12:31+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-03-07T02:15:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=418333979ae007b28855079c64ee3c65f76ecbc7'/>
<id>urn:sha1:418333979ae007b28855079c64ee3c65f76ecbc7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>First try at lowering the power consumption</title>
<updated>2020-03-13T18:12:30+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-03-06T01:14:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6f60afe8c521011d1a2d34a2632295b483a8cee3'/>
<id>urn:sha1:6f60afe8c521011d1a2d34a2632295b483a8cee3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refine iMX RT memory layout and add three boards</title>
<updated>2020-01-18T01:36:08+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-01-09T04:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7d8dac9211dab92d750a0351335b4ad3fffc05e2'/>
<id>urn:sha1:7d8dac9211dab92d750a0351335b4ad3fffc05e2</id>
<content type='text'>
Introduces a way to place CircuitPython code and data into
tightly coupled memory (TCM) which is accessible by the CPU in a
single cycle. It also frees up room in the corresponding cache for
intermittent data. Loading from external flash is slow!

The data cache is also now enabled.

Adds support for the iMX RT 1021 chip. Adds three new boards:
* iMX RT 1020 EVK
* iMX RT 1060 EVK
* Teensy 4.0

Related to #2492, #2472 and #2477. Fixes #2475.
</content>
</entry>
<entry>
<title>Add functions to get top and limit stack</title>
<updated>2019-10-18T09:04:45+00:00</updated>
<author>
<name>Kamil Tomaszewski</name>
<email>kamil.tomaszewski@sony.com</email>
</author>
<published>2019-10-18T09:00:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96756b3945ec3388986c7ebda8b924aeb42cd7fb'/>
<id>urn:sha1:96756b3945ec3388986c7ebda8b924aeb42cd7fb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>address @tannewt changes: move and rename common files; remove PORT_HEAP_SIZE</title>
<updated>2019-02-16T01:32:32+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-02-16T01:32:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7b3f7605b8b36f5d0dbfbee60604ad266cac2645'/>
<id>urn:sha1:7b3f7605b8b36f5d0dbfbee60604ad266cac2645</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rework safe mode and have heap overwrite trigger it.</title>
<updated>2018-12-06T22:24:20+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-12-06T22:24:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6ef863997186e1893cdf19c0e04d0a8a3f33ad9d'/>
<id>urn:sha1:6ef863997186e1893cdf19c0e04d0a8a3f33ad9d</id>
<content type='text'>
This creates a common safe mode mechanic that ports can share.
As a result, the nRF52 now has safe mode support as well.

The common safe mode adds a 700ms delay at startup where a reset
during that window will cause a reset into safe mode. This window
is designated by a yellow status pixel and flashing the single led
three times.

A couple NeoPixel fixes are included for the nRF52 as well.

Fixes #1034. Fixes #990. Fixes #615.
</content>
</entry>
</feed>
