Commit Graph

1385 Commits

Author SHA1 Message Date
Josh Lloyd
ed2314f35a esp32/machine_rtc: Make RTC.memory size and availability configurable.
The compile-time configuration value MICROPY_HW_RTC_USER_MEM_MAX can now be
used to define the amount of memory set aside for RTC.memory().  If this
value is configured to zero then the RTC.memory functionality is not
included in the build.
2019-11-21 16:55:12 +11:00
Laurens Valk
2679c9e116 unix/modtermios: Fix output speed setter in tcsetattr.
The input speed was being set twice and the output speed was not set.
2019-11-21 12:10:32 +11:00
Yonatan Goldschmidt
973f68780d qemu-arm: Add ldscript dependency in the final firmware.elf target.
So that the target is rebuilt if the linker script changes.
2019-11-15 10:25:48 +11:00
Josh Lloyd
82d358510b esp32/rtc: Set system microseconds when setting time via RTC.datetime(). 2019-11-13 13:46:33 +11:00
Mike Causer
258b147830 stm32/boards/stm32f405_af.csv: Fix typo in ETH_RMII_REF_CLK on PA1. 2019-11-11 12:02:14 +11:00
Jim Mussared
71299d3224 esp32/boards/sdkconfig.base: Resize SSL output buffer from 16 to 4kiB.
The IDF heap is more fragmented with IDF 4 and mbedtls cannot allocate
enough RAM with 16+16kiB for both in and out buffers, so reduce output
buffer size.

Fixes issue #5303.
2019-11-11 11:55:58 +11:00
Damien George
799b6d1e0c extmod: Consolidate FAT FS config to MICROPY_VFS_FAT across all ports.
This commit removes the Makefile-level MICROPY_FATFS config and moves the
MICROPY_VFS_FAT config to the Makefile level to replace it.  It also moves
the include of the oofatfs source files in the build from each port to a
central place in extmod/extmod.mk.

For a port to enabled VFS FAT support it should now set MICROPY_VFS_FAT=1
at the level of the Makefile.  This will include the relevant oofatfs files
in the build and set MICROPY_VFS_FAT=1 at the C (preprocessor) level.
2019-11-11 11:37:38 +11:00
Damien George
cea9209e0f esp8266/moduos: Add optional support for VfsLfs1 and VfsLfs2.
With this commit an esp8266-based board can now be built with littlefs
support via, eg "make MICROPY_VFS_LFS2=1".
2019-11-07 18:44:16 +11:00
Damien George
6eee5413ff esp8266/modules/flashbdev.py: Support extended block protocol. 2019-11-07 18:43:37 +11:00
Damien George
4be316fb07 esp32/moduos: Enable uos.VfsLfs2 for littlefs filesystems.
This commit adds support for littlefs (v2) on all esp32 boards.

The original FAT filesystem still works and any board with a preexisting
FAT filesystem will still work as normal.  It's possible to switch to
littlefs by reformatting the block device using:

    import uos, flashbdev
    uos.VfsLfs2.mkfs(flashbdev.bdev)

Then when the board reboots (soft or hard) the new littlefs filesystem will
be mounted.  It's possible to switch back to a FAT filesystem by formatting
with uos.VfsFat.mkfs(flashbdev.bdev).
2019-11-06 12:16:00 +11:00
Damien George
d01ca7888b esp32/esp32_partition: Support extended block protocol. 2019-11-06 12:15:34 +11:00
Andreas Motl
d209f9ebe7 esp32: Remove unused "esponewire.c" in favour of extmod/modonewire. 2019-11-05 14:57:05 +11:00
Damien George
cddb2dd0c3 stm32/mpthreadport: Include runtime.h to get defn of mp_raise_msg. 2019-11-05 13:20:25 +11:00
Damien George
c13f9f209d all: Convert nlr_raise(mp_obj_new_exception_msg(x)) to mp_raise_msg(x).
This helper function was added a while ago and these are the remaining
cases to convert, to save a bit of code size.
2019-11-05 11:35:45 +11:00
Damien George
742030945c esp32/Makefile: Add correct arch to MPY_CROSS_FLAGS for native code. 2019-11-04 15:32:20 +11:00
Damien George
32eae53fbc stm32/boards: Enable support for bluetooth on WB55 boards. 2019-11-01 14:58:24 +11:00
Damien George
6a64b280d0 stm32: Add support for RF coprocessor on WB55 MCUs.
This requires a BLE wireless stack firmware to be already programmed in the
secure flash area of the device.
2019-11-01 14:52:17 +11:00
Damien George
40ea1915fc extmod/nimble: Factor out stm32-specific HCI UART RX/TX code. 2019-11-01 12:41:37 +11:00
Damien George
48b25a841b stm32: Add machine.Timer with soft timer implementation.
This commit adds an implementation of machine.Timer backed by the soft
timer mechanism.  It allows an arbitrary number of timers with 1ms
resolution, with an associated Python callback.  The Python-level API
matches existing ports that have a soft timer, and is used as:

    from machine import Timer
    t = Timer(freq=10, callback=lambda t:print(t))
    ...
    t = Timer(mode=Timer.ONE_SHOT, period=2000, callback=lambda t:print(t))
    ...
    t.deinit()
2019-10-31 22:12:55 +11:00
Damien George
a5d97f1db9 stm32: Add soft timer implementation, using SysTick at 1ms resolution.
This commit adds an implementation of a "software timer" with a 1ms
resolution, using SysTick.  It allows unlimited number of concurrent
timers (limited only by memory needed for each timer entry).  They can be
one-shot or periodic, and associated with a Python callback.

There is a very small overhead added to the SysTick IRQ, which could be
further optimised in the future, eg by patching SysTick_Handler code
dynamically.
2019-10-31 22:12:55 +11:00
Damien George
9ec73aedb4 stm32/timer: Fix Timer.freq() calc so mult doesn't overflow uint32_t.
Fixes issue #5280.
2019-10-31 12:49:18 +11:00
Damien George
660a61a388 extmod/vfs_lfs: Allow compiling in VfsLfs1 and VfsLfs2 separately.
These classes are enabled via the config options MICROPY_VFS_LFS1 and
MICROPY_VFS_LFS2, which are disabled by default.
2019-10-30 12:08:58 +11:00
Kamil Klimek
53f3cbc2c4 zephyr/main: Use mp_stack API instead of local pointer for stack top.
The MP_STATE_THREAD(stack_top) is always available so use it instead of
creating a separate variable.  This also allows gc_collect() to be used as
an independent function, without real_main() being called.
2019-10-29 23:05:07 +11:00
Damien George
4847460232 unix/mphalport.h: Define mp_hal_stdio_poll to dummy because it's unused.
And requires uintptr_t to declare the default version in py/mphal.h.
2019-10-29 22:22:37 +11:00
Damien George
cfe1c5abf8 extmod/vfs: Rename BP_IOCTL_xxx constants to MP_BLOCKDEV_IOCTL_xxx.
Also rename SEC_COUNT to BLOCK_COUNT and SEC_SIZE to BLOCK_SIZE.
2019-10-29 14:17:29 +11:00
Damien George
62d5659cdd unix: Enable uos.VfsLfs1, uos.VfsLfs2 on coverage build. 2019-10-29 14:17:29 +11:00
Damien George
9aabb6c01b extmod: Factor out block-device struct to make independent of fatfs. 2019-10-29 12:12:37 +11:00
Jim Mussared
ece4e21a55 stm32/Makefile: Only enable hardware sqrt on parts that support it.
Not enough to detect f7/h7, need to use the specific parts.

Follow-up to 580a2656d1.
2019-10-28 15:08:28 +11:00
Mike Teachman
f301170c7c esp32/machine_hw_spi: Fix exception msg when host is already in use.
When a SPI bus is initialized with a SPI host that is currently in use the
exception msg incorrectly indicates "SPI device already in use".  The
mention of "device" in the exception msg is confusing because the error is
about trying to use a SPI host that is already claimed.  A better exception
msg is "SPI host already in use".
2019-10-23 13:31:13 +11:00
Michael Neuling
079cc940a6 powerpc: Add initial port to bare metal PowerPC arch.
Runs in microwatt (GHDL and FPGA) and qemu.

Port done initially by Michael Neuling, with help from Anton Blanchard and
Jordan Niethe.
2019-10-22 22:45:33 +11:00
Andrew Leech
19ca025b45 stm32/sdram: Fix to use new mpu_config_start/mpu_config_end signature. 2019-10-22 22:02:06 +11:00
Jim Mussared
b02d7e612d extmod/modbluetooth: Rename module to "ubluetooth".
For consistency with "umachine". Now that weak links are enabled
by default for built-in modules, this should be a no-op, but allows
extension of the bluetooth module by user code.

Also move registration of ubluetooth to objmodule rather than
port-specific.
2019-10-22 21:58:05 +11:00
Damien George
1582c7eeb0 unix,windows: Enable module weak links. 2019-10-22 16:23:43 +11:00
Damien George
d2384efa80 py: Automatically provide weak links from "foo" to "ufoo" module name.
This commit implements automatic module weak links for all built-in
modules, by searching for "ufoo" in the built-in module list if "foo"
cannot be found.  This means that all modules named "ufoo" are always
available as "foo".  Also, a port can no longer add any other weak links,
which makes strict the definition of a weak link.

It saves some code size (about 100-200 bytes) on ports that previously had
lots of weak links.

Some changes from the previous behaviour:
- It doesn't intern the non-u module names (eg "foo" is not interned),
  which saves code size, but will mean that "import foo" creates a new qstr
  (namely "foo") in RAM (unless the importing module is frozen).
- help('modules') no longer lists non-u module names, only the u-variants;
  this reduces duplication in the help listing.

Weak links are effectively the same as having a set of symbolic links on
the filesystem that is searched last.  So an "import foo" will search
built-in modules first, then all paths in sys.path, then weak links last,
importing "ufoo" if it exists.  Thus a file called "foo.py" somewhere in
sys.path will still have precedence over the weak link of "foo" to "ufoo".

See issues: #1740, #4449, #5229, #5241.
2019-10-22 15:30:52 +11:00
Damien George
f1d91908fa esp8266/boards: Add manifest_release.py with files for a release.
A release also sets: UART_OS = -1
2019-10-22 00:23:22 +11:00
Jim Mussared
912892b209 esp32: Add missing and necessary newline at EOF for sdkconfig.240mhz.
When these files get concatenated the newline-at-EOF is necessary so that
the start of the next file doesn't join with the end of the previous.
2019-10-21 23:54:59 +11:00
Jim Mussared
93bd61ca91 unix: Allow building without a manifest. 2019-10-21 23:21:18 +11:00
Jim Mussared
df7f632fd7 esp8266: Allow building without a manifest. 2019-10-21 23:21:14 +11:00
Jim Mussared
8ba963cfa3 tools/makemanifest.py: Eval relative paths w.r.t. current manifest file.
When loading a manifest file, e.g. by include(), it will chdir first to the
directory of that manifest.  This means that all file operations within a
manifest are relative to that manifest's location.

As a consequence of this, additional environment variables are needed to
find absolute paths, so the following are added: $(MPY_LIB_DIR),
$(PORT_DIR), $(BOARD_DIR).  And rename $(MPY) to $(MPY_DIR) to be
consistent.

Existing manifests are updated to match.
2019-10-21 23:01:41 +11:00
Damien George
12413e92a3 stm32/powerctrlboot: Fix config of systick IRQ priority on F0/L0/WB MCU.
Prior to this commit the systick IRQ priority was set at lowest priority on
F0/L0/WB MCUs, because it was left at the default and never configured.
This commit ensures the priority is configured and sets it to the highest
priority.
2019-10-21 12:23:41 +11:00
Josh Lloyd
59c1b7d4b8 esp32/boards: Split out CPU frequency config, make 160MHz the default.
Remove the 240MHz CPU config option from sdkconfig.base and create a new
sdkconfig.240mhz file for those boards that want to use 240MHz on boot.

The default CPU frequency is now 160MHz (was 240MHz), to align with the ESP
IDF and support more boards (eg those with D2WD chips).

Fixes issue #5169.
2019-10-18 13:42:24 +11:00
Jeremy Herbert
7a7ee16ccf esp32/machine_uart: Add ability to invert UART pins. 2019-10-18 12:05:16 +11:00
Damien George
69b238ec63 stm32/accel: Fix Accel.read() method so it does read a byte.
This bug was introduced in a0f7b4c678
2019-10-18 11:53:34 +11:00
Frederic.Pierson
925f244ab3 stm32/boards: Add NADHAT_PYB405 board. 2019-10-18 11:41:22 +11:00
Frederic.Pierson
28062b5108 stm32/accel: Add support for KXTJ3. 2019-10-18 11:41:22 +11:00
Damien George
3105207aff stm32/accel: Rename MMA I2C macro constants to make it generic. 2019-10-18 11:35:32 +11:00
Damien George
4f2c737b0c stm32/mpu: Save and restore the IRQ state when configuring MPU.
In case IRQs are already disabled during the MPU configuration.

Fixes issue #5152.
2019-10-16 23:12:06 +11:00
iabdalkader
6e4468a2ab stm32/adc: Fix sampling for internal channels on H7 MCUs.
Set to 810 cycles following HAL examples.
2019-10-15 22:08:45 +11:00
iabdalkader
4cee42d864 stm32/adc: Use IS_CHANNEL_INTERNAL macro to check for internal channels. 2019-10-15 22:08:36 +11:00
iabdalkader
d523a377d1 stm32/adc: Remove unused macro and channel check, and fix spacing.
The call to is_adcx_channel is redundant because the channel is already
checked just before calling adc_init_single in adc_make_new.
2019-10-15 22:04:19 +11:00
iabdalkader
cb2b210d45 stm32/adc: Update ADC driver to work with the new H7 HAL.
Use NB_TO_CHANNEL to map decimal numbers to channel numbers.  And use the
correct rank to initialize channels (ADC_REGULAR_RANK_1).
2019-10-15 22:03:54 +11:00
Damien George
ce1de1faf0 esp32: Convert to use FROZEN_MANIFEST to specify frozen code.
All symlinks are removed.  boards/manifest.py is used as a default, and can
optionally use boards/manifest_release.py for more scripts.
2019-10-15 21:37:02 +11:00
Damien George
2e90ff7fa8 qemu-arm: Convert to use FROZEN_MANIFEST to specify frozen code. 2019-10-15 21:36:55 +11:00
Damien George
287800d6e1 stm32: Convert to use FROZEN_MANIFEST to specify frozen code.
All symlinks are removed, frozen files are now referenced via
boards/manifest.py.
2019-10-15 21:36:24 +11:00
Damien George
2fd3f2520d esp8266: Convert to use FROZEN_MANIFEST to specify frozen code.
Removes symlinks in modules directory, all frozen code is now specified by
manifest.py.
2019-10-15 21:36:02 +11:00
Damien George
b1c0355b93 unix: Convert to use FROZEN_MANIFEST to specify frozen code.
Removes symlinks in modules directory, all frozen code is now specified by
manifest.py.
2019-10-15 21:35:27 +11:00
Jim Mussared
4b2b05718a esp32: Run NimBLE on the app core.
This prevents issues with concurrent access to the ringbuf.
MICROPY_BEGIN_ATOMIC_SECTION is only atomic to the same core.  We could
address this with a mutex, but it's also not safe to call mp_sched_schedule
across cores.
2019-10-15 17:22:15 +11:00
Jim Mussared
418f12c5f5 extmod/modbluetooth: Increase maximum connections from 1 to 4.
This avoids a confusing ENOMEM raised from gap_advertise if there is
currently an active connection.  This refers to the static connection
buffer pre-allocated by Nimble (nothing to do with MicroPython heap
memory).
2019-10-15 17:20:25 +11:00
Damien George
d7a9388fe0 ports: Add new make target "submodules" which inits required modules. 2019-10-15 17:14:41 +11:00
Damien George
3ee71ff314 minimal/frozentest.mpy: Recompile now that mpy format changed. 2019-10-15 16:58:58 +11:00
Jim Mussared
d5cbee3cfb esp32: Add 4.x version of IDLE WDT config. 2019-10-11 14:30:47 +11:00
ladyada
06ae818f93 stm32/boards: Add new board ADAFRUIT_F405_EXPRESS. 2019-10-11 11:50:36 +11:00
Glenn Ruben Bakke
98c2eabaff nrf/boards: Add nrf9160 pca10090 board. 2019-10-10 21:36:20 +02:00
Glenn Ruben Bakke
82fe6b0526 nrf: Add nrf9160 base support.
This patch add basic building blocks for nrf9P60.

It also includes a secure bootloader which forwards all
possible peripherals that are user selectable to become
non-secure. After configuring Flash, RAM and peripherals
the secure bootloader will jump to the non-secure domain
where MicroPython is placed.

The minimum size of a secure boot has to be a flash
block of 32Kb, hence why the linker scripts are
offsetting the main application this much.

The RAM offset is set to 128K, to allow for later
integration of Nordic Semiconductor's BSD socket
library which reserves the range 0x20010000 - 0x2001FFFF.
2019-10-10 21:35:27 +02:00
Glenn Ruben Bakke
01a3110e36 nrf/boards: Add support for pca10059.
Add support for pca10059 with REPL over tinyusb USB CDC.

The board also includes a board specific module that will
recover UICR->REGOUT0 in case this has been erased.

This initial support does not preserve any existing bootloader
on the pca10090 in case this was present, and expects to use all
available flash on the device.
2019-10-10 20:21:07 +02:00
Glenn Ruben Bakke
60b0b69f20 nrf: Add tinyusb support for nrf52840.
Add nrf-port finyusb driver files. USB CDC can be activated
by board configuration files using the MICROPY_HW_USB_CDC.

Updating BLE driver, Makefile, nrfx-glue and main.c to plug
in the tinyusb stack.
2019-10-10 20:21:07 +02:00
Glenn Ruben Bakke
1571120dc2 nrf/device: Correct SPIM3 IRQ handler entry for nrf52840. 2019-10-10 20:21:07 +02:00
Damien George
79ab82ea77 esp8266/modules/ntptime.py: Always close socket, and set day-of-week.
Fixes issue #5189.
2019-10-10 18:05:56 +11:00
Jim Mussared
580a2656d1 stm32: Use hardware double sqrt on F7/H7 MCUs.
Identical to cd527bb324 but for doubles.
This gives a -2.754% improvement on bm_float.py, and -35% improvement on
calling sqrt in a loop.
2019-10-10 17:39:32 +11:00
Andrey Belykh
305f537bf9 stm32/sdcard: Support boards with no SD card detect pin.
If MICROPY_HW_SDCARD_DETECT_PIN is not defined then the SD card will always
be detected as present.
2019-10-10 17:29:44 +11:00
Mike Causer
53a9b45da1 esp8266: Add per-board configs, following other ports.
The specific board can be selected with the BOARD makefile variable.  This
defaults (if not specified) to BOARD=GENERIC, which is the original default
firmware build.  For the 512k target use BOARD=GENERIC_512K.
2019-10-10 16:32:25 +11:00
Damien George
2863dcdf4f nrf: Add support to activate MICROPY_PY_SYS_STDFILES.
Fixes issue #5162.
2019-10-08 16:38:04 +11:00
Andrew Leech
04fe62d06f stm32/mboot: Add option to automatically reset when USB is disconnected.
Enable in board config with: #define MBOOT_USB_RESET_ON_DISCONNECT (1)
2019-10-08 16:07:32 +11:00
Jim Mussared
cd8bbf4cfc esp32/boards: Enable BLE by default when building with IDF 4.x. 2019-10-08 14:50:01 +11:00
Jim Mussared
6a9bd1c1ab esp32: Implement BLE using Nimble from IDF 4.x. 2019-10-08 14:50:01 +11:00
Jim Mussared
902bb4ceae stm32: Extract port-specific Nimble implementation.
On other ports (e.g. ESP32) they provide a complete Nimble implementation
(i.e. we don't need to use the code in extmod/nimble). This change
extracts out the bits that we don't need to use in other ports:
 - malloc/free/realloc for Nimble memory.
 - pendsv poll handler
 - depowering the cywbt

Also cleans up the root pointer management.
2019-10-08 14:40:35 +11:00
Damien George
4a6974bea5 stm32/boards/PYBD_SF2: Put nimble library in external QSPI XIP flash.
The BLE stack is not performance critical, so put it in external
memory-mapped flash to save internal flash for other things (like frozen
bytecode).
2019-10-05 23:51:33 +10:00
Martin Fischer
a0ce01f62e stm32/usbdev: Fix compile error if MICROPY_HW_USB_CDC_NUM is set to 2.
Fixes regression introduced by 6705767da1
2019-10-05 23:33:38 +10:00
Damien George
917f027c0b esp32: Enable native emitter. 2019-10-05 13:45:25 +10:00
Chris Mason
0096041c99 stm32/{adc,machine_adc}: Change ADC clock and sampling time for F0 MCUs.
STM32F0 has PCLK=48MHz and maximum ADC clock is 14MHz so use PCLK/4=12MHz
to stay within spec of the ADC peripheral.  In pyb.ADC set common sampling
time to approx 4uS for internal and external sources.  In machine.ADC
reduce sample time to approx 1uS for external source, leave internal at
maximum sampling time.
2019-10-04 21:39:17 +10:00
Damien George
26e90a0514 stm32/boards: Enable MICROPY_HW_RTC_USE_LSE on L4 boards.
The previous commit changed the default configuration on L4 MCUs to use
LSI, so configure these boards to use LSE again.
2019-10-04 16:10:13 +10:00
hahmadi
266146ad64 stm32/system_stm32: Support selection of HSE and LSI on L4 MCUs.
This commit adds the option to use HSE or MSI system clock, and LSE or LSI
RTC clock, on L4 MCUs.

Note that prior to this commit the default clocks on an L4 part were MSI
and LSE.  The defaults are now MSI and LSI.

In mpconfigboard.h select the clock source via:

    #define MICROPY_HW_RTC_USE_LSE (0) or (1)
    #define MICROPY_HW_CLK_USE_HSE (0) or (1)

and the PLLSAI1 N,P,Q,R settings:

    #define MICROPY_HW_CLK_PLLSAIN (12)
    #define MICROPY_HW_CLK_PLLSAIP (RCC_PLLP_DIV7)
    #define MICROPY_HW_CLK_PLLSAIQ (RCC_PLLQ_DIV2)
    #define MICROPY_HW_CLK_PLLSAIR (RCC_PLLR_DIV2)
2019-10-04 16:09:06 +10:00
roland van straten
a069340c1e nrf/main: Update the way the LED is used on startup.
In case of LED1 being present, do a short blink during startup
instead of turning it on and leave it on.
2019-10-02 22:17:54 +02:00
roland van straten
226399bcef nrf/led: Expose public API for LED manipulation.
Aligned implementation with the STM32 port.
Added empty functions to be used when no LED is available.
2019-10-02 22:09:43 +02:00
Glenn Ruben Bakke
cf383412ef nrf/flash: Update flash driver to use nrfx_nvmc driver.
The the nrfx driver is aware of chip specific registers, while
the raw HAL abstraction is not. This driver enables use of NVMC
in non-secure domain for nrf9160.
2019-10-02 21:28:34 +02:00
Glenn Ruben Bakke
c561ae61a1 nrf/uart: Add support for UARTE (EasyDMA). 2019-10-02 21:20:56 +02:00
Glenn Ruben Bakke
02a8c31eef nrf/temp: Move module configuration guard.
This patch moves the check for MICROPY_PY_MACHINE_TEMP to come
before the inclusion of nrf_temp.h. The nrf_temp.h depends on
the NRF_TEMP_Type which might not be defined for all nRF devices.
2019-10-02 21:15:48 +02:00
Glenn Ruben Bakke
d2e730b727 nrf/i2c: Add support for TWIM (EasyDMA). 2019-10-02 20:42:06 +02:00
Damien George
fd9b7efe39 minimal/frozentest.mpy: Update due to change in bytecode. 2019-10-01 12:26:22 +10:00
Damien George
4c5e1a0368 py/bc: Change mp_code_state_t.exc_sp to exc_sp_idx.
Change from a pointer to an index, to make space in mp_code_state_t.
2019-10-01 12:26:22 +10:00
Jim Mussared
fafa9d35dd stm32/boards/PYBD: Enable BLE for Pyboard D. 2019-10-01 09:51:02 +10:00
Jim Mussared
6f35f214d3 stm32/mpconfigport.h: Add modbluetooth module to stm32. 2019-10-01 09:51:02 +10:00
Jim Mussared
f67fd95f8d unix/coverage: Add coverage tests for ringbuf. 2019-10-01 09:51:02 +10:00
Jim Mussared
d72dbb822c stm32: Provide port-specific implementation for Nimble on STM32. 2019-10-01 09:51:02 +10:00
Andrew Leech
4ba0aff472 stm32/uart: Add RTS/CTS pin configuration support to UART4. 2019-09-27 13:24:01 +10:00
Chris Mason
eb12fa3862 stm32/powerctrlboot: Add support for HSI at 8MHz on F0 MCUs.
For use with F0 MCUs that don't have HSI48.  Select the clock source
explicitly in mpconfigboard.h.

On the NUCLEO_F091RC board use HSE bypass when HSE is chosen because the
NUCLEO clock source is STLINK not a crystal.
2019-09-26 17:34:04 +10:00
Chris Mason
f16e4be3fa stm32/powerctrlboot: Fix clock and PLL selection for HSI48 on F0 MCUs.
Before this patch the UART baudrate on F0 MCUs was wrong because the
stm32lib SystemCoreClockUpdate sets SystemCoreClock to 8MHz instead of
48MHz if HSI48 is routed directly to SYSCLK.

The workaround is to use HSI48 -> PREDIV (/2) -> PLL (*2) -> SYSCLK.

Fixes issue #5049.
2019-09-26 17:32:22 +10:00
Damien George
3328b7d71f stm32: Support disabling the compiler.
Disable via "#define MICROPY_ENABLE_COMPILER (0)" in the board's
mpconfigboard.h file.
2019-09-26 17:05:40 +10:00
Damien George
9abfe85ace minimal/frozentest: Recompile now that mpy version has changed. 2019-09-26 16:40:54 +10:00
Josh Lloyd
7d58a197cf py: Rename MP_QSTR_NULL to MP_QSTRnull to avoid intern collisions.
Fixes #5140.
2019-09-26 16:04:56 +10:00