summaryrefslogtreecommitdiff
path: root/ports/stm/supervisor
AgeCommit message (Collapse)Author
2021-03-15run code formatting scriptmicroDev
2020-12-08Add `board_deinit` for use with sleepScott Shawcroft
This changes lots of files to unify `board.h` across ports. It adds `board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to deinit the board before deep sleeping (even when pretending.) Deep sleep is now a two step process for the port. First, the port should prepare to deep sleep based on the given alarms. It should set alarms for both deep and pretend sleep. In particular, the pretend versions should be set immediately so that we don't miss an alarm as we shutdown. These alarms should also wake from `port_idle_until_interrupt` which is used when pretending to deep sleep. Second, when real deep sleeping, `alarm_enter_deep_sleep` is called. The port should set any alarms it didn't during prepare based on data it saved internally during prepare. ESP32-S2 sleep is a bit reorganized to locate more logic with TimeAlarm. This will help it scale to more alarm types. Fixes #3786
2020-11-28Add movable allocation system.Christian Walther
This allows calls to `allocate_memory()` while the VM is running, it will then allocate from the GC heap (unless there is a suitable hole among the supervisor allocations), and when the VM exits and the GC heap is freed, the allocation will be moved to the bottom of the former GC heap and transformed into a proper supervisor allocation. Existing movable allocations will also be moved to defragment the supervisor heap and ensure that the next VM run gets as much memory as possible for the GC heap. By itself this breaks terminalio because it violates the assumption that supervisor_display_move_memory() still has access to an undisturbed heap to copy the tilegrid from. It will work in many cases, but if you're unlucky you will get garbled terminal contents after exiting from the vm run that created the display. This will be fixed in the following commit, which is separate to simplify review.
2020-11-23Fix NVM by clearing FLASH_FLAG_PGPERRjgillick
2020-11-22Create a new linker script with more space for the firmware.jgillick
2020-10-13Fix stm sleep too longScott Shawcroft
2020-10-12Fix STM RTC read so it's atomic.Scott Shawcroft
Fixes #3376
2020-09-28Add some NORETURN attributesJeff Epler
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<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.
2020-08-24Merge remote-tracking branch 'adafruit/main' into add_pwmioScott Shawcroft
2020-08-21Add more "extern" declarations for gcc10 compatScott Shawcroft
gcc has tightened the restrictions on forward declarations that lack "extern". Fix them up.
2020-08-18Split pulseio.PWMOut into pwmioScott Shawcroft
This gives us better granularity when implementing new ports because PWMOut is commonly implemented before PulseIn and PulseOut. Fixes #3211
2020-07-30stm: fix if-guard of conditional codeJeff Epler
2020-07-30stm: Add sdioio support for feather_stm32f405_expressJeff Epler
Currently, only the bus specs of the stm32f405xx have been coded. Other stm-family chips need (at a minimum) the specs added in their periph.[ch] files.
2020-07-22Claim USB pins at startup to prevent overwritesLucian Copeland
2020-07-22Merge branch 'main' into stm32-timer-allocatorhierophect
2020-07-15supervisor: factor out, Handle USB via background callbackJeff Epler
2020-07-06Add license to some obvious files.Diego Elio Pettenò
2020-07-03Merge remote-tracking branch 'upstream/main' into stm32-timer-allocatorLucian Copeland
2020-07-01Add timer allocator, adjust pulsio to use general purpose timersLucian Copeland
2020-06-25Move NVM block to increase program size.jgillick
2020-06-10Minor comment fixLucian Copeland
2020-06-09Add DTCM and ITCM support to F7 seriesLucian Copeland
2020-06-05Override HAL_Delay and HAL_GetTickLucian Copeland
2020-06-04Merge remote-tracking branch 'upstream/master' into stm32-LSE-startup-fixLucian Copeland
2020-06-04Rework LSE clock init, allow clock overridesLucian Copeland
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-05-15Add port_fixed_stack for more buildsScott Shawcroft
2020-05-11Add recovery domain write access, adjust stackLucian Copeland
2020-05-08Add timeout and adjustment to LSILucian Copeland
2020-05-05Merge pull request #2842 from hierophect/stm32-h7-displayiohierophect
STM32: Add displayio to F7/H7
2020-04-30Increase H7 filesystem sizeLucian Copeland
2020-04-27Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-04-26Merge pull request #2805 from tannewt/update_tinyusbScott Shawcroft
Update tinyusb
2020-04-24Remove empty #if and add missing includes.Scott Shawcroft
2020-04-23STM32: adds support for stm32f746xx MCU and the nucleo_f746zg boardMark Olsson
2020-04-22Fix STM so it matches the correct RTC fields.Scott Shawcroft
2020-04-21Use our own flag for board crystal config.Scott Shawcroft
2020-04-20Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
This isn't perfect and needs a bit more testing.
2020-04-17Update TinyUSB and add interrupt hooks.Scott Shawcroft
2020-04-16startup file crash fix, H7 bin fixLucian Copeland
2020-04-15Implement requested changesLucian Copeland
2020-04-13Implement cache-based readsLucian Copeland
2020-04-13Various requested fixesLucian Copeland
2020-04-09Add busio support, cleanupLucian Copeland
2020-04-08Fix up STMScott Shawcroft
Enable the Alarm IRQ earlier and correct bit clearing.
2020-04-08Tweaks based on dhalberts feedbackScott Shawcroft
2020-04-03Linker file restructure, TCM and MPU additionsLucian Copeland
2020-04-02Implement F7 NucleoLucian Copeland
2020-04-01Implement requested changesLucian Copeland
2020-03-31Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft