Commit Graph

410 Commits

Author SHA1 Message Date
Damien George cdc01408c7 stm32/uart: Add support for USART3-8 on F0 MCUs. 2018-09-21 14:02:54 +10:00
Andrew Leech 84f4d58479 stm32/dcmi: Add F4/F7/H7 hal files and dma definitions for DCMI periph. 2018-09-21 12:12:49 +10:00
Damien George cb3c66e793 stm32/adc: Increase sample time for internal sensors on L4 MCUs.
They need time (around 4us for VREFINT) to obtain accurate results.

Fixes issue #4022.
2018-09-20 23:51:33 +10:00
Damien George 3220cedc31 stm32/adc: Fix ADC calibration scale for L4 MCUs, they use 3.0V. 2018-09-20 23:50:54 +10:00
Damien George 56f275c0a2 stm32/Makefile: Include copysign.c in double precision float builds.
This is required for DEBUG=1 builds when MICROPY_FLOAT_IMPL=double.

Thanks to Andrew Leech.
2018-09-20 16:51:20 +10:00
Andrew Leech 17f7c683d2 stm32: Add support for STM32F765xx MCUs.
This part is functionally similar to STM32F767xx (they share a datasheet)
so support is generally comparable.  When adding board support the
stm32f767_af.csv and stm32f767.ld should be used.
2018-09-20 15:16:03 +10:00
Damien George a5b583adfd stm32/boards/STM32F769DISC: Add optional support for external SDRAM. 2018-09-20 11:42:03 +10:00
Damien George 9639e0d26f stm32/sdram: Add support for 32-bit wide data bus and 256MB in MPU cfg. 2018-09-20 11:29:37 +10:00
Damien George 7c4f98db85 stm32/dma: Get DMA working on F0 MCUs.
Changes made:
- fix DMA_SUB_INSTANCE_AS_UINT8
- fix dma_id numbers in dma_descr_t
- add F0 DMA IRQ handlers
- set DmaBaseAddress and ChannelIndex when reinit'ing
2018-09-16 23:16:10 +10:00
Damien George 9fb1f18cf4 stm32/sdcard: Fully reset SDMMC periph before calling HAL DMA functions.
The HAL DMA functions enable SDMMC interrupts before fully resetting the
peripheral, and this can lead to a DTIMEOUT IRQ during the initialisation
of the DMA transfer, which then clears out the DMA state and leads to the
read/write not working at all.  The DTIMEOUT is there from previous SDMMC
DMA transfers, even those that succeeded, and is of duration ~180 seconds,
which is 0xffffffff / 24MHz (default DTIMER value, and clock of
peripheral).

To work around this issue, fully reset the SDMMC peripheral before calling
the HAL SD DMA functions.

Fixes issue #4110.
2018-09-12 17:02:17 +10:00
Damien George 6b3d6da74b stm32/flashbdev: Protect flash writes from cache flushing and USB MSC. 2018-09-12 15:58:42 +10:00
Damien George 0941a467e7 stm32: Change flash IRQ priority from 2 to 6 to prevent preemption.
The flash-IRQ handler is used to flush the storage cache, ie write
outstanding block data from RAM to flash.  This is triggered by a timeout,
or by a direct call to flush all storage caches.

Prior to this commit, a timeout could trigger the cache flushing to occur
during the execution of a read/write to external SPI flash storage.  In
such a case the storage subsystem would break down.

SPI storage transfers are already protected against USB IRQs, so by
changing the priority of the flash IRQ to that of the USB IRQ (what is
done in this commit) the SPI transfers can be protected against any
timeouts triggering a cache flush (the cache flush would be postponed until
after the transfer finished, but note that in the case of SPI writes the
timeout is rescheduled after the transfer finishes).

The handling of internal flash sync'ing needs to be changed to directly
call flash_bdev_irq_handler() sync may be called with the IRQ priority
already raised (eg when called from a USB MSC IRQ handler).
2018-09-12 15:46:04 +10:00
Damien George 6f015d337d stm32/spi: Be sure to set all SPI config values in SPI proto init. 2018-09-11 17:36:11 +10:00
Damien George c26516d40f stm32/sdcard: Move temporary DMA state from BSS to stack. 2018-09-11 17:23:27 +10:00
Damien George e4f7001d9c stm32/sdcard: Use only a single DMA stream for both SDIO TX/RX.
No need to be wasteful on DMA resources.
2018-09-11 17:21:22 +10:00
Damien George d7e2ac4a6a stm32/dma: Reinitialise the DMA if the direction changed on the channel. 2018-09-11 17:19:55 +10:00
Damien George b0c8a94b41 stm32/dma: Pass DMA direction as parameter to dma_init not in cfg struct
Some DMA channels (eg for SDIO) can be used in both directions and this
patch allows such peripherals to dynamically select the DMA direction.
2018-09-11 17:18:06 +10:00
Damien George 47550ef2cd stm32: For MCUs that have PLLSAI allow to set SYSCLK at 2MHz increments.
MCUs that have a PLLSAI can use it to generate a 48MHz clock for USB, SDIO
and RNG peripherals.  In such cases the SYSCLK is not restricted to values
that allow the system PLL to generate 48MHz, but can be any frequency.
This patch allows such configurability for F7 MCUs, allowing the SYSCLK to
be set in 2MHz increments via machine.freq().  PLLSAI will only be enabled
if needed, and consumes about 1mA extra.  This fine grained control of
frequency is useful to get accurate SPI baudrates, for example.
2018-09-11 16:42:57 +10:00
roland 67ee4e2401 stm32/boards/STM32L476DISC: Enable external RTC xtal to get RTC working. 2018-09-11 15:23:19 +10:00
Andrew Leech 670a2a3396 stm32/Makefile: Allow external BOARD_DIR directory to be specified.
This makes it easy to add a custom board definition outside of the
micropython tree, keeping the micropython submodule clean and official.
2018-09-11 15:15:21 +10:00
Damien George a23719e0ad stm32/mboot/main: Use correct formula for DFU download address.
As per ST's DfuSe specification, and following their example code.
2018-09-05 15:22:05 +10:00
Damien George 5f3016c663 stm32/mboot/Makefile: Use -Wno-attributes for ll_usb.c HAL source file.
A recent version of arm-none-eabi-gcc (8.2.0) will warn about unused packed
attributes in USB_WritePacket and USB_ReadPacket.  This patch suppresses
such warnings for this file only.
2018-09-05 15:21:43 +10:00
Damien George 056e0b6293 stm32/spi: Add implementation of low-level SPI protocol.
Can be used, for example, to configure external SPI flash using a hardware
SPI interface (code to be put in a board's bdev.c file):

    STATIC const spi_proto_cfg_t hard_spi_bus = {
        .spi = &spi_obj[5],
        .baudrate = 10000000,
        .polarity = 0,
        .phase = 0,
        .bits = 8,
        .firstbit = SPI_FIRSTBIT_MSB,
    };

    STATIC mp_spiflash_cache_t spi_bdev_cache;

    const mp_spiflash_config_t spiflash_config = {
        .bus_kind = MP_SPIFLASH_BUS_SPI,
        .bus.u_spi.cs = pin_A0,
        .bus.u_spi.data = (void*)&hard_spi_bus,
        .bus.u_spi.proto = &spi_proto,
        .cache = &spi_bdev_cache,
    };

    spi_bdev_t spi_bdev;
2018-08-14 22:10:43 +10:00
Damien George 8300be6d0f stm32/spi: Split out pyb.SPI and machine.SPI bindings to their own files
The aim here is to have spi.c contain the low-level SPI driver which is
independent (not fully but close) of MicroPython objects and methods, and
the higher-level bindings are separated out to pyb_spi.c and machine_spi.c.
2018-08-14 17:11:07 +10:00
forester3 02fbb0a455 stm32/boards/STM32F7DISC: Enable onboard SDRAM.
The default SYSCLK frequency is reduced to 192MHz because SDRAM requires it
to be 200MHz or less.
2018-08-14 16:04:10 +10:00
forester3 502c410214 stm32/boards/STM32F429DISC: Add burst len and autorefresh to SDRAM cfg.
To align with recent changes to sdram.c.
2018-08-14 16:03:13 +10:00
forester3 e562f99263 stm32/sdram: Allow additional config by a board, and tune MPU settings.
- Allow configuration by a board of autorefresh number and burst length.
- Increase MPU region size to 8MiB.
- Make SDRAM region cacheable and executable.
2018-08-14 16:00:14 +10:00
Damien George 86e0b25532 stm32/spi: Round up prescaler calc to never exceed requested baudrate.
Requesting a baudrate of X should never configure the peripheral to have a
baudrate greater than X because connected hardware may not be able to
handle higher speeds.  This patch makes sure to round the prescaler up so
that the actual baudrate is rounded down.
2018-08-10 16:39:47 +10:00
David Lechner 3fccd78aca stm32/dma: Fix spelling of "corresponding" in two locations. 2018-08-10 16:26:25 +10:00
Damien George 7be5bb3672 stm32/adc: Fix ADC reading on F0 MCUs to only sample a single channel.
And increase sampling time to get better results for internal channels.
2018-08-04 13:33:02 +10:00
Damien George c62b23094f stm32/adc: Disable VBAT in read channel helper function.
Prior to this patch, if VBAT was read via ADC.read() or
ADCAll.read_channel(), then it would remain enabled and subsequent reads
of TEMPSENSOR or VREFINT would not work.  This patch makes sure that VBAT
is disabled for all cases that it could be read.
2018-08-04 13:25:43 +10:00
Damien George 5482d84673 stm32/modmachine: Get machine.sleep working on L4 MCUs.
When waking from stop mode most of the system is still in the same state as
before entering stop, so only minimal configuration is needed to bring the
system clock back online.
2018-08-01 17:14:19 +10:00
Damien George c12348700f stm32/extint.h: Use correct EXTI lines for RTC interrupts. 2018-08-01 17:13:49 +10:00
Damien George 21dae87710 stm32/modmachine: Get machine.sleep working on F0 MCUs. 2018-07-31 17:25:53 +10:00
Damien George 9dfbb6cc16 stm32/rtc: Get rtc.wakeup working on F0 MCUs.
The problem was that the EXTI line for the RTC wakeup event is line 20 on
the F0, so the interrupt was not firing.
2018-07-31 17:24:10 +10:00
Damien George f6f6452b6f stm32/Makefile: Use -Wno-attributes for ll_usb.c HAL source file.
A recent version of arm-none-eabi-gcc (8.2.0) will warn about unused packed
attributes in USB_WritePacket and USB_ReadPacket.  This patch suppresses
such warnings for this file only.
2018-07-30 15:35:05 +10:00
Damien George 90fc7c5cfa stm32/sdcard: Get SDMMC alt func macro names working with F4,F7,H7 MCUs. 2018-07-30 15:33:33 +10:00
Andrew Leech 434975defa stm32/boards/STM32F429DISC: Enable onboard SDRAM. 2018-07-23 23:16:32 +10:00
Andrew Leech 968fa47392 stm32/sdram: On F7 MCUs enable MPU on external SDRAM.
This prevents hard-faults on non-aligned accesses.

Reference: http://www.keil.com/support/docs/3777.htm
2018-07-23 23:15:18 +10:00
Andrew Leech a1db1506a2 stm32/sdram: Integrate SDRAM driver into rest of code.
If SDRAM is configured and enabled for a board then it is used for the
MicroPython GC heap.
2018-07-23 23:14:23 +10:00
Andrew Leech 7ae053abfd stm32/sdram: Add SDRAM driver from OpenMV project.
Taken from 7fbe54ad4e/src/omv/sdram.c

Code is is MIT licensed.
2018-07-23 23:13:24 +10:00
Damien George 4201f36a46 stm32/sdcard: Use mp_hal_pin_config_alt_static to configure SD card pins 2018-07-20 14:03:21 +10:00
Andrew Leech 4343c9330e stm32: Add method for statically configuring pin alternate function.
Works with pins declared normally in mpconfigboard.h, eg. (pin_XX), as well
as (pyb_pin_XX).

Provides new mp_hal_pin_config_alt_static(pin_obj, mode, pull, fn_type)
function declared in pin_static_af.h to allow configuring pin alternate
functions by name at compile time.
2018-07-20 14:03:21 +10:00
Peter D. Gray a8736e5c36 stm32/flashbdev: Fix bug with L4 block cache, dereferencing block size.
The code was dereferencing 0x800 and loading a value from there, trying to
use a literal value (not address) defined in the linker script
(_ram_fs_cache_block_size) which was 0x800.
2018-07-19 12:15:34 +10:00
Peter D. Gray 0d58f6ba5e stm32/mphalport: Make mp_hal_stdin_rx_chr/stdout_tx_strn weakly linked.
To allow for customizations.
2018-07-18 10:41:55 +10:00
Damien George 46091b8a95 stm32/timer: Add tick_hz arg to Timer constructor and init method.
The period of the timer can now be specified using the "period" and
"tick_hz" args.  The period in seconds will be: period/tick_hz.  tick_hz
defaults to 1000, so if period is specified on its own then it will be in
units of milliseconds.
2018-07-17 13:36:36 +10:00
Damien George 821b59d439 stm32/timer: Use enum for indexing keyword arg in pyb_timer_init_helper. 2018-07-17 13:22:42 +10:00
Peter D. Gray 2a3979bcb3 stm32/fatfs_port: Fix bug when MICROPY_HW_ENABLE_RTC not enabled.
Prior to this patch, get_fattime() was calling a HAL RTC function with the
HW instance pointer as null because rtc_init_start() was never called.

Also marked it as a weak function, to allow a board to override it.
2018-07-14 17:17:46 +10:00
Damien George e1ae9939ac stm32: Support compiling with object representation D.
With this and previous patches the stm32 port can now be compiled using
object representation D (nan boxing).  Note that native code and frozen mpy
files with float constants are currently not supported with this object
representation.
2018-07-08 23:25:11 +10:00
Damien George 3503f9626a stm32: Access dict map directly instead of using helper function. 2018-07-08 22:11:28 +10:00
Damien George 8f86fbfd6c ports: Enable ure.sub() on stm32, esp8266 (not 512k) and esp32. 2018-07-02 15:13:18 +10:00
Damien George 9b158d60e1 stm32/mboot: Always use a flash latency of 1WS to match 48MHz HCLK. 2018-06-26 00:06:04 +10:00
Damien George 967123d42e stm32/mboot: Only compile in code for the USB periph that is being used.
Prior to this patch, if both USB FS and HS were enabled via the
configuration file then code was included to handle both of their IRQs.
But mboot only supports listening on a single USB peripheral, so this patch
excludes the code for the USB that is not used.
2018-06-26 00:02:36 +10:00
Damien George 37c4fd3b50 stm32/mboot: Fix bug with invalid memory access of USB state.
Only one of pcd_fs_handle/pcd_hs_handle is ever initialised, so if both of
these USB peripherals are enabled then one of these if-statements will
access invalid memory pointed to by an uninitialised Instance.  This patch
fixes this bug by explicitly referencing the peripheral struct.
2018-06-25 23:39:46 +10:00
Damien George 6fc84a7454 stm32/modnetwork: Fix query of DNS IP address in ifconfig().
Thanks to @boochow for the fix.
2018-06-23 23:41:59 +10:00
Damien George a2ac7e4fc9 stm32/boards: Add .ld and af.csv files for STM32F722.
These files can also be used for F723, F732 and F733 MCUs.
2018-06-22 15:39:10 +10:00
Damien George ec7982ec6d stm32/mboot: Add support for erase/read/write of external SPI flash.
This patch adds support to mboot for programming external SPI flash.  It
allows SPI flash to be programmed via a USB DFU utility in the same way
that internal MCU flash is programmed.
2018-06-22 15:30:34 +10:00
Damien George 7f41f73f0f stm32/qspi: Don't require data reads and writes to be a multiple of 4.
Prior to this patch the QSPI driver assumed that the length of all data
reads and writes was a multiple of 4.  This patch allows any length.  Reads
are optimised for speed by using 32-bit transfers when possible, but writes
always use a byte transfer because they only use a single data IO line and
are relatively slow.
2018-06-22 15:07:01 +10:00
Damien George 561ae9a91b stm32/boards/NUCLEO_F091RC: Fix TICK_INT_PRIORITY so it is highest prio.
Fixes issue #3880.
2018-06-20 12:24:18 +10:00
Damien George 5962c210c5 stm32/mboot: Define constants for reset mode cycling and timeout.
And fix timeout value so that it does actually finish with reset_mode=1.
2018-06-19 23:23:17 +10:00
Damien George e49cd106b4 stm32/spi: Fix SPI driver so it can send/recv more than 65535 bytes.
The DMA peripheral is limited to transferring 65535 elements at a time so
in order to send more than that the SPI driver must split the transfers up.

The user must be aware of this limit if they are relying on precise timing
of the entire SPI transfer, because there might be a small delay between
the split transfers.

Fixes issue #3851, and thanks to @kwagyeman for the original fix.
2018-06-18 17:41:14 +10:00
Damien George 338af99a7f stm32/can: Use MP_OBJ_ARRAY_TYPECODE_FLAG_RW where appropriate. 2018-06-18 13:42:05 +10:00
rolandvs ca2b1d6b36 stm32/boards/NUCLEO_F091RC: Add Arduino-named pins and rename CPU pins.
To match pin labels on other NUCLEO 64 boards.
2018-06-18 13:06:27 +10:00
rolandvs 0d3de68669 stm32/boards/stm32f091_af.csv: Split labels that are multiple funcs. 2018-06-18 13:05:24 +10:00
Damien George ceff433fcc stm32/mboot: Adjust user-reset-mode timeout so it ends with mode=1.
If the user button is held down indefinitely (eg unintenionally, or because
the GPIO signal of the user button is connected to some external device)
then it makes sense to end the reset mode cycle with the default mode of
1, which executes code as normal.
2018-06-18 12:23:27 +10:00
Damien George 7be4a23c0c stm32/i2cslave: Fix ordering of event callbacks in slave IRQ handler.
It's possible (at least on F4 MCU's) to have RXNE and STOPF set at the same
time during a call to the slave IRQ handler.  In such cases RXNE should be
handled before STOPF so that all bytes are processed before
i2c_slave_process_rx_end() is called.
2018-06-15 14:15:31 +10:00
Damien George bc5e8a2cb6 stm32/i2c: Fix num_acks calculation in i2c_write for F0 and F7 MCU's.
Due to buffering of outgoing bytes on the I2C bus, detection of a NACK
using the ISR_NACKF flag needs to account for the case where ISR_NACKF
corresponds to the previous-to-previous byte.
2018-06-15 14:10:53 +10:00
Damien George 37a7257aff stm32/timer: Support TIM1 on F0 MCUs. 2018-06-15 10:50:08 +10:00
Damien George cc5a94044a drivers/memory/spiflash: Rename functions to indicate they use cache.
This patch renames the existing SPI flash API functions to reflect the fact
that the go through the cache:

    mp_spiflash_flush -> mp_spiflash_cache_flush
    mp_spiflash_read  -> mp_spiflash_cached_read
    mp_spiflash_write -> mp_spiflash_cached_write
2018-06-14 16:52:56 +10:00
Damien George 335d26b27d stm32/boards/STM32L476DISC: Update SPI flash config for cache change. 2018-06-14 16:52:56 +10:00
Damien George 5042d98514 stm32/Makefile: Rebuild all qstrs when any board configuration changes. 2018-06-12 13:53:43 +10:00
Damien George 565f590586 ports: Enable IOBase on unix, stm32, esp8266 and esp32.
It's a core feature, in particular required for user-streams with uasyncio.
2018-06-12 12:29:26 +10:00
Damien George b2fa1b50ed ports: Call gc_sweep_all() when doing a soft reset.
This calls finalisers of things like files and sockets to cleanly close
them.
2018-06-12 11:56:25 +10:00
Damien George 24c416cc66 stm32/mboot: Increase USB rx_buf and DFU buf sizes to full 2048 bytes.
The DFU USB config descriptor returns 0x0800=2048 for the supported
transfer size, and this applies to both TX (IN) and RX (OUT).  So increase
the rx_buf to support this size without having a buffer overflow on
received data.

With this patch mboot in USB DFU mode now works with dfu-util.
2018-06-08 15:29:52 +10:00
Damien George 190c7dba89 stm32/mpconfigport.h: Enable DELATTR_SETATTR and BUILTINS_NOTIMPLEMENTED
MICROPY_PY_DELATTR_SETATTR can now be enabled without a performance hit for
classes that don't use this feature.

MICROPY_PY_BUILTINS_NOTIMPLEMENTED is a minor addition that improves
compatibility with CPython.
2018-06-08 12:55:18 +10:00
Damien George 93150a0d40 ports: Enable descriptors on stm32, esp8266, esp32 ports.
They are now efficient (in runtime performance) and provide a useful
feature that's hard to obtain without them enabled.

See issue #3644 and PR #3826 for background.
2018-06-08 12:23:08 +10:00
Damien George f35aae366c extmod/vfs_fat: Rename FileIO/TextIO types to mp_type_vfs_fat_XXX.
So they don't clash with other VFS implementations.
2018-06-06 14:28:23 +10:00
Damien George 309fe39dbb stm32/modnetwork: Fix arg indexing in generic ifconfig method. 2018-06-03 21:50:49 +10:00
Damien George 7d86ac6c01 stm32: Add network driver for Wiznet5k using MACRAW mode and lwIP.
The Wiznet5k series of chips support a MACRAW mode which allows the host to
send and receive Ethernet frames directly.  This can be hooked into the
lwIP stack to provide a full "socket" implementation using this Wiznet
Ethernet device.  This patch adds support for this feature.

To enable the feature one must add the following to mpconfigboard.mk, or
mpconfigport.mk:

    MICROPY_PY_WIZNET5K = 5500

and the following to mpconfigboard.h, or mpconfigport.h:

    #define MICROPY_PY_LWIP (1)

After wiring up the module (X5=CS, X4=RST), usage on a pyboard is:

    import time, network
    nic = network.WIZNET5K(pyb.SPI(1), pyb.Pin.board.X5, pyb.Pin.board.X4)
    nic.active(1)
    while not nic.isconnected():
        time.sleep_ms(50) # needed to poll the NIC
    print(nic.ifconfig())

Then use the socket module as usual.

Compared to using the built-in TCP/IP stack on the Wiznet module, some
performance is lost in MACRAW mode: with a lot of memory allocated to lwIP
buffers, lwIP gives Around 750,000 bytes/sec max TCP download, compared
with 1M/sec when using the TCP/IP stack on the Wiznet module.
2018-06-01 14:21:38 +10:00
Damien George d9f1ecece2 stm32/modnetwork: Provide generic implementation of ifconfig method.
All it needs is a lwIP netif to function.
2018-06-01 13:33:14 +10:00
Damien George 7437215ad7 stm32/modnetwork: Change base entry of NIC object from type to base.
mod_network_nic_type_t doesn't need to be an actual uPy type, it just needs
to be an object.
2018-06-01 13:31:28 +10:00
Damien George 6d87aa54d6 stm32/modnetwork: Don't take netif's down when network is deinited.
It should be up to the NIC itself to decide if the network interface is
removed upon soft reset.  Some NICs can keep the interface up over a soft
reset, which improves usability of the network.
2018-06-01 13:27:06 +10:00
Damien George a1acbad27a stm32/flash: Increase H7 flash size to full 2MiB. 2018-05-30 09:54:51 +10:00
rolandvs 958fa74521 stm32/boards: Ensure USB OTG power is off for NUCLEO_F767ZI.
And update the GPIO init for NUCLEO_H743ZI to consistently use the mphal
functions.
2018-05-30 09:51:19 +10:00
rolandvs 50bc34d4a4 stm32/boards: Split combined alt-func labels and fix some other errors.
Pins with multiple alt-funcs for the same peripheral (eg USART_CTS_NSS)
need to be split into individual alt-funcs for make-pins.py to work
correctly.

This patch changes the following:
- Split `..._CTS_NSS` into `..._CTS/..._NSS`
- Split `..._RTS_DE` into `..._RTS/..._DE`
- Split `JTDO_SWO` into `JTDO/TRACESWO` for consistency
- Fixed `TRACECK` to `TRACECLK` for consistency
2018-05-29 21:37:49 +10:00
Damien George 98d1609358 stm32/README: Update to include STM32F0 in list of supported MCUs. 2018-05-28 22:04:08 +10:00
Damien George e681372017 stm32/boards: Add NUCLEO_F091RC board configuration files. 2018-05-28 21:49:49 +10:00
Damien George 1163400039 stm32/boards: Add alt-func CSV list and linker script for STM32F091. 2018-05-28 21:49:49 +10:00
Damien George ea7e747979 stm32: Add support for STM32F0 MCUs. 2018-05-28 21:49:49 +10:00
Damien George 4a7d157a5b stm32/boards: Add startup_stm32f0.s for STM32F0 MCUs.
Sourced from STM32Cube_FW_F0_V1.9.0.
2018-05-28 21:49:49 +10:00
Damien George 6d83468a30 stm32: Allow a board to disable MICROPY_VFS_FAT. 2018-05-28 21:46:20 +10:00
Damien George 5c0685912f stm32/timer: Make timer_get_source_freq more efficient by using regs.
Use direct register access to get the APB clock divider.  This reduces code
size and makes the code more efficient.
2018-05-28 21:46:20 +10:00
Damien George 070937fe93 stm32: Add support for Cortex-M0 CPUs. 2018-05-28 21:46:20 +10:00
Damien George f497723802 stm32: Allow to have no storage support if there are no block devices.
If no block devices are defined by a board then storage support will be
disabled.  This means there is no filesystem provided by either the
internal flash or external SPI flash.  But the VFS system can still be
enabled and filesystems provided on external devices like an SD card.
2018-05-28 21:45:46 +10:00
Damien George aa4a7a8732 stm32/usb: Guard USB device code with #if for whether USB is enabled.
With this change, all the USB source code can now be passed through the
compiler even if the MCU does not have a USB peripheral.
2018-05-28 21:45:46 +10:00
Damien George 15ddc20436 stm32: Add new component, the mboot bootloader.
Mboot is a custom bootloader for STM32 MCUs.  It can provide a USB DFU
interface on either the FS or HS peripherals, as well as a custom I2C
bootloader interface.
2018-05-24 23:21:19 +10:00
Damien George f47eeab0ad stm32: Add low-level hardware I2C slave driver. 2018-05-24 23:11:13 +10:00
Damien George 4200018a05 stm32: Remove unneeded HTML release notes from usbdev and usbhost dirs.
These files provide no additional information, all the version and license
information is captured in the relevant files in these subdirectories.

Thanks to @JoeSc for the original patch.
2018-05-24 11:28:54 +10:00
Damien George 20b4b85f72 ports: Enable MICROPY_PY_BUILTINS_ROUND_INT on selected ports. 2018-05-22 14:18:16 +10:00
Damien George e773a2cdba stm32/main: Use consistent indenting of macro #if's. 2018-05-22 13:17:03 +10:00