Commit Graph

676 Commits

Author SHA1 Message Date
Dave Hylands
8a1a5c236d stmhal: Fix hardfault when configured as a SPI slave 2015-08-05 23:42:05 +01:00
Dave Hylands
5e11d2b349 stmhal: Enable SPI support for F7 MCUs. 2015-08-05 23:38:49 +01:00
Dave Hylands
34fe5a30c6 stmhal: Enable I2C support for F7 MCUs. 2015-08-05 23:38:24 +01:00
Damien George
4434e43fa1 stmhal: Add HALCOMMITS file with list of commits that touch the hal.
This file should be kept up to date with list of hal commits.
2015-08-03 00:55:36 +01:00
Dave Hylands
7a55c1a884 stmhal: Port of f4 hal commit 1d7fb82 to f7 hal 2015-08-03 00:49:36 +01:00
Dave Hylands
28e51c9eb1 stmhal: Port of f4 hal commit 09de030 to f7 hal 2015-08-03 00:49:36 +01:00
Dave Hylands
af9d885f8c stmhal: Port of f4 hal commit c568a2b to f7 hal 2015-08-03 00:49:35 +01:00
Dave Hylands
9e8eba797e stmhal: M7 Reset clocksources changed by DFU bootloader
The DFU bootloader on the ST32F7 chip changes the clocksource
for various possible boot sources (UART1, UART3, I2C1-3).
This commit resets those clock sources back to their cold
reset values.
2015-08-03 00:46:31 +01:00
Dave Hylands
8f1eced69d stmhal: Add STM32F7 support for USB serial and storage.
USB serial is now working for F7.

Internal file storage is now working for F7.  The flash is laid out a bit
differently to the F4 - 4 x 32K, 1 x 128K with the rest 256K, so the
internal storage is 96K.

Added more pind definitions for STM32F7DISC board.  Made USART1 be the
default HWUART repl.  The STLINK usb connector also looks like a USB
serial port which is attached to USART1 on the STM32F7DISC.
2015-08-03 00:39:27 +01:00
Damien George
751485fe6b stmhal: Add support for USART1 and conditional pins in make-pins.py.
Thanks to Dave Hylands for the patch.
2015-08-03 00:23:47 +01:00
Damien George
a632037866 stmhal: Add better support for UART having Tx and Rx on different ports.
Thanks to Dave Hylands for the patch.
2015-08-03 00:22:16 +01:00
Damien George
c0e39864c6 stmhal: Fix make-pins.py to allow Port K.
Thanks to Dave Hylands for the patch.
2015-08-03 00:18:40 +01:00
Damien George
6e552e15fa stmhal: Add debug capability to print out info about a hard fault.
Capability is #if'd off by default.

Thanks to Dave Hylands for the patch.
2015-08-03 00:14:51 +01:00
Damien George
0851751615 stmhal: Factor GPIO clock enable logic into mp_hal_gpio_clock_enable.
Extracted GPIO clock enable logic into mp_hal_gpio_clock_enable
and called from anyplace which might need to use GPIO functions
on ports other than A-D.

Thanks to Dave Hylands for the patch.
2015-08-03 00:14:48 +01:00
Damien George
6f1c00869c stmhal: Factor out USRSW boot-up code and support boards with 1 LED.
Thanks to Dave Hylands for the patch.
2015-08-03 00:14:44 +01:00
Dave Hylands
92d4b51ad5 stmhal: Add STM32F7DISC and associated changes. 2015-07-30 00:38:32 +01:00
Dave Hylands
7e7fb0b7a3 stmhal: Renamed startup/system/_it.[ch] file to generic names. 2015-07-30 00:38:29 +01:00
Dave Hylands
ea8bf81058 stmhal: Replace #include "stm32f4xx_hal.h" with #include STM32_HAL_H. 2015-07-30 00:38:25 +01:00
Damien George
f243851ccd stmhal: Expose uwTick in f7 hal. 2015-07-30 00:38:25 +01:00
Dave Hylands
7c934ae501 stmhal: Add hal and cmsis files from STM32Cube_FW_F7_V1.1.0.
All files were converted to linux line endings.
All trailing whitespace was removed using:
for f in f7/inc/* f7/src/*; do sed --in-place 's/[[:space:]]\+$//' $f; done
All non-ascii chars in comments were replaced with ascii equivalents or
removed.
2015-07-30 00:38:18 +01:00
Damien George
f5d04750db stmhal: Put fs_user_mount pointer in root ptr section of global state.
Should fix issue #1393.
2015-07-27 23:52:56 +01:00
Damien George
92e9a5e0a7 stmhal: Check if user block device is mounted before accessing it.
In particular this fixes a bug where pyb.sync (and os.sync) fail because
they try to sync the user mounted device even if it's not mounted.
2015-07-27 23:40:19 +01:00
Tom Soulanille
7d588b0c7c lib/mp-readline: Add emacs-style control characters for cursor movement.
Disabled by default.  Adds 108 bytes to Thumb2 arch when enabled.
2015-07-26 15:22:13 +01:00
Damien George
7693ef3bd6 stmhal: Allow ADC.read_timed to take Timer object in place of freq.
This allows a user-specified Timer for the triggering of the ADC read,
mirroring the new behaviour of DAC.write_timed.

Addresses issue #1129.
2015-07-22 19:41:13 +01:00
Damien George
99a21dc05d stmhal: Add stm32fxxx_hal_i2s_ex.c to hal/f2 (dummy) and hal/f4. 2015-07-21 23:49:19 +01:00
Damien George
abc24c1876 stmhal: Allow DAC.write_timed to take Timer object in place of freq.
This allows the DAC to use a user-specified Timer for the triggering
(instead of the default Timer(6)), while still supporting original
behaviour.

Addresses issues #1129 and #1388.
2015-07-21 23:39:49 +01:00
Damien George
6f5e0fe955 stmhal: Clean up DAC code a little. 2015-07-21 22:05:56 +01:00
blmorris
2af846e711 stmhal/boards/stm32fxx_prefix.c: Fix alt function number calculation
This prevented pin_find_af* functions from being able to find some
of the alternate functions in the pin struct
2015-07-20 16:19:12 +01:00
Damien George
f576057274 stmhal: Add CMSIS device header files for STM32F2xx series. 2015-07-20 12:33:05 +01:00
Wojtek Siudzinski
0621eca05e stmhal: Add STM32CubeF2 version 1.1.0, in hal/f2 directory.
Only those files which are needed by the stmhal port are added.

Also includes a dummy file (stm32f2xx_hal_pcd_ex.c) to keep the build
system the same for f4 and f2 MCU series.
2015-07-20 12:32:09 +01:00
Damien George
a39df51d8a stmhal: Update Makefile and board configs to compile with relocated hal. 2015-07-20 12:30:18 +01:00
Damien George
e4d43401eb stmhal: Move HAL Cube files to f4/ subdir, keeping only those we use.
This is in preparation for supporting other MCU series, such as
STM32F2xx.  Directory structure for the HAL is now hal/f4/{inc,src},
where "f4" will in the future be different for other series.

HAL source/header files that are not use are removed to reduce the size
of the code.
2015-07-20 12:30:18 +01:00
Dave Hylands
9309e609cd stmhal: Add qstr definition for ifconfig when building for WizNet 2015-07-14 23:00:29 +01:00
Dave Hylands
11115e4d23 stmhal: Add I2S support to make-pins.py 2015-07-07 10:15:37 +01:00
Damien George
0807139c1d stmhal: Add config option for storage to use second flash segment.
When enabled this allows the internal storage to be split over 2
contiguous regions of flash (two segments), and so the storage can be
increased.

This option is disabled by default, giving original behaviour.
2015-06-27 23:27:23 +01:00
blmorris
c5175526dd stmhal/dma.c: Modify dma_init() to accept init struct as an argument
This removes hard-coded DMA init params from dma_init(), instead defining
these parameters in a DMA_InitTypeDef struct that gets passed as an
argument to dma_init()
This makes dma_init more generic so it can be used for I2S and SD Card,
which require different initialization parameters.
2015-06-24 17:48:52 +01:00
Damien George
6e1dfb0d1a stmhal: Reorganise code for parsing keyword args in I2C methods.
To make it the same as SPI and UART.
2015-06-22 23:46:22 +01:00
Damien George
76285469d3 stmhal: Make I2C use DMA when interrupts are enabled. 2015-06-10 14:01:44 +01:00
Damien George
3d30d605f5 stmhal: Factor out DMA initialisation code from spi.c.
This is so that the DMA can be shared by multiple peripherals.
2015-06-10 14:01:44 +01:00
Damien George
0aa5e75000 stmhal: Break immediately from USB CDC busy wait loop if IRQs disabled.
If IRQs are disabled then the USB CDC buffer will never be
drained/filled and the sys-tick timer will never increase, so we should
not busy wait in this case.
2015-06-07 23:48:07 +01:00
Damien George
53a8aeb6e7 stmhal: Fix slow SPI DMA transfers by removing wfi from DMA wait loop.
Addresses issue #1268.
2015-06-03 23:20:23 +01:00
Dave Hylands
3ac2d06bd1 stmhal: Add support for UART5
I tested this on my CERB40 board and it seems to be working fine.
2015-06-01 00:14:46 +01:00
Damien George
17d9b5006d stmhal: Fix off-by-one error when checking for valid I2C and SPI bus. 2015-05-28 11:05:44 +01:00
Damien George
70446f46c2 stmhal: Allow to name SPI busses, and give them names for pyboard. 2015-05-27 17:21:42 +01:00
Damien George
0e6f5e08e1 stmhal: Allow to name I2C busses, and give them names for pyboard. 2015-05-27 17:16:26 +01:00
Damien George
1775b65e07 stmhal: Remove PYBVxx defines and use config vars for UART/CAN names.
Now all stmhal-based boards can name their peripherals (if they want) to
any string.
2015-05-27 16:51:04 +01:00
Damien George
3c4b5d4281 stmhal: Implement sys.std{in,out,err}.buffer, for raw byte mode.
It's configurable and only enabled for stmhal port.
2015-05-24 14:31:33 +01:00
Dave Hylands
968b7dd173 stmhal: Detect disk full condition 2015-05-24 14:07:11 +01:00
Damien George
0d31bbc7fa stmhal: Make pendsv variable non-static so gcc-5 doesn't opt it away. 2015-05-23 17:42:58 +01:00
Kaspar Schleiser
f5dd6f7f37 py/binary: Make return type of mp_binary_get_size size_t instead of int.
Fixes sign-compare warning.
2015-05-17 18:12:19 +01:00