Commit Graph

63 Commits

Author SHA1 Message Date
Scott Shawcroft 56427d9abe
Fix stm sleep too long 2020-10-13 14:02:29 -07:00
Scott Shawcroft a0e5e961c5
Fix STM RTC read so it's atomic.
Fixes #3376
2020-10-12 17:43:25 -07:00
Jeff Epler 726dcdb60a Add some NORETURN attributes
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-09-28 18:55:56 -05:00
Scott Shawcroft 1527a3ce92
Merge remote-tracking branch 'adafruit/main' into add_pwmio 2020-08-24 18:25:18 -07:00
Scott Shawcroft 644d2ba7a2 Add more "extern" declarations for gcc10 compat
gcc has tightened the restrictions on forward declarations that lack
"extern".  Fix them up.
2020-08-21 14:39:37 -05:00
Scott Shawcroft 6857f98426
Split pulseio.PWMOut into pwmio
This gives us better granularity when implementing new ports because
PWMOut is commonly implemented before PulseIn and PulseOut.

Fixes #3211
2020-08-18 13:08:33 -07:00
Jeff Epler d73505a027 stm: fix if-guard of conditional code 2020-07-30 07:18:12 -05:00
Jeff Epler 4adbd23b75 stm: Add sdioio support for feather_stm32f405_express
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-30 07:18:02 -05:00
Lucian Copeland c1f731d62e Claim USB pins at startup to prevent overwrites 2020-07-22 14:22:05 -04:00
hierophect e232ec10ce
Merge branch 'main' into stm32-timer-allocator 2020-07-22 13:59:39 -04:00
Jeff Epler 6160d11c5a supervisor: factor out, Handle USB via background callback 2020-07-15 11:49:44 -05:00
Diego Elio Pettenò 34b4993d63 Add license to some obvious files. 2020-07-06 19:16:25 +01:00
Lucian Copeland c72e3536f1 Merge remote-tracking branch 'upstream/main' into stm32-timer-allocator 2020-07-03 09:50:05 -04:00
Lucian Copeland ab9a64eafa Add timer allocator, adjust pulsio to use general purpose timers 2020-07-01 10:35:49 -04:00
jgillick 017c188ab5 Move NVM block to increase program size. 2020-06-25 21:46:15 -07:00
Lucian Copeland c88a8e66c6 Minor comment fix 2020-06-10 13:22:21 -04:00
Lucian Copeland b414f82669 Add DTCM and ITCM support to F7 series 2020-06-09 18:01:52 -04:00
Lucian Copeland ad0971fb25 Override HAL_Delay and HAL_GetTick 2020-06-05 13:56:32 -04:00
Lucian Copeland a0977cac7b Merge remote-tracking branch 'upstream/master' into stm32-LSE-startup-fix 2020-06-04 16:15:38 -04:00
Lucian Copeland d14e34449b Rework LSE clock init, allow clock overrides 2020-06-04 13:21:29 -04:00
Diego Elio Pettenò dd5d7c86d2 Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-03 10:56:35 +01:00
Scott Shawcroft 3c1469b0a5
Add port_fixed_stack for more builds 2020-05-15 16:22:33 -07:00
Lucian Copeland 94949fb46f Add recovery domain write access, adjust stack 2020-05-11 18:02:40 -04:00
Lucian Copeland 5249a7b02c Add timeout and adjustment to LSI 2020-05-08 12:36:39 -04:00
hierophect c311b5c002
Merge pull request #2842 from hierophect/stm32-h7-displayio
STM32: Add displayio to F7/H7
2020-05-05 12:37:08 -04:00
Lucian Copeland 06b62721b3 Increase H7 filesystem size 2020-04-30 15:49:17 -04:00
Scott Shawcroft 755d404edf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-27 16:45:10 -07:00
Scott Shawcroft 9e4b94f466
Merge pull request #2805 from tannewt/update_tinyusb
Update tinyusb
2020-04-26 20:55:36 -07:00
Scott Shawcroft 5c7f6e6211
Remove empty #if and add missing includes. 2020-04-24 11:48:55 -07:00
Mark Olsson 83cc9783cc STM32: adds support for stm32f746xx MCU and the nucleo_f746zg board 2020-04-23 10:48:27 +02:00
Scott Shawcroft b277944cf0
Fix STM so it matches the correct RTC fields. 2020-04-22 11:10:51 -07:00
Scott Shawcroft 17d038830d
Use our own flag for board crystal config. 2020-04-21 14:14:30 -07:00
Scott Shawcroft bebf27e733
Merge remote-tracking branch 'adafruit/master' into lower_power
This isn't perfect and needs a bit more testing.
2020-04-20 18:25:13 -07:00
Scott Shawcroft 7e3d4c61b5
Update TinyUSB and add interrupt hooks. 2020-04-17 14:16:49 -07:00
Lucian Copeland 9e49fc13f4 startup file crash fix, H7 bin fix 2020-04-16 17:33:48 -04:00
Lucian Copeland 6427994b14 Implement requested changes 2020-04-15 10:22:51 -04:00
Lucian Copeland 83a55f65a4 Implement cache-based reads 2020-04-13 15:14:38 -04:00
Lucian Copeland 5ac38c95cc Various requested fixes 2020-04-13 12:03:05 -04:00
Lucian Copeland 92a0621e59 Add busio support, cleanup 2020-04-09 13:43:19 -04:00
Scott Shawcroft 01941c027b
Fix up STM
Enable the Alarm IRQ earlier and correct bit clearing.
2020-04-08 14:41:57 -07:00
Scott Shawcroft d0a25ca9ac
Tweaks based on dhalberts feedback 2020-04-08 10:49:46 -07:00
Lucian Copeland 9761672d42 Linker file restructure, TCM and MPU additions 2020-04-03 16:33:18 -04:00
Lucian Copeland 47a5d83267 Implement F7 Nucleo 2020-04-02 11:47:16 -04:00
Lucian Copeland a89928c13c Implement requested changes 2020-04-01 13:02:05 -04:00
Scott Shawcroft 8fe512c7e9
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-03-31 15:13:58 -07:00
Lucian Copeland e2be069686 Support cached internal flash on the H743 2020-03-28 18:30:46 -04:00
Lucian Copeland 7995bcac40 Flash additions 2020-03-27 14:15:33 -04:00
Lucian Copeland 348df4be2b Merge remote-tracking branch 'upstream/master' into stm32x7-setup 2020-03-26 18:16:11 -04:00
Lucian Copeland c4db8b87e2 Add F7 and H7 Support to the STM32 port
Restructures the STM port of Circuitpython to be more generic about the STM32 chip lines to support
the F7 and H7 series of chips. Adds the new Packages directory to organize different chip layouts
between lines. Makes general changes to the Makefile to condense board-level flags to the minimum
and support the new chip series. Adds the new chip line to the Peripherals directory, along with
new python tools used to generate peripheral text automatically in the tools/ directory.
2020-03-26 18:01:17 -04:00
Scott Shawcroft ea0ce39962
Simplify STM a bit. 2020-03-24 15:49:24 -07:00