Damien George
b63cc1e9ef
stm32/Makefile: Re-enable strict aliasing optimisation for ST HAL files.
...
The HAL requires strict aliasing optimisation to be turned on to function
correctly (at least for the SD card driver on F4 MCUs). This optimisation
was recently disabled with the addition of H7 support due to the H7 HAL
having errors with the strict aliasing optimisation enabled. But this is
now fixed in the latest stm32lib and so the optimisation can now be
re-enabled.
Thanks to @chuckbook for finding that there was a problem with the SD card
on F4 MCUs with the strict aliasing optimisation disabled.
2018-03-26 00:00:47 +11:00
Damien George
23f07b77e5
lib/stm32lib: Update library for fix to H7 SPI strict aliasing error.
2018-03-25 23:58:56 +11:00
iabdalkader
7b0a020a02
stm32/boards/NUCLEO_H743ZI: Disable uSD transceiver.
...
There's no uSD Transceiver on this NUCLEO board.
2018-03-20 23:26:03 +11:00
iabdalkader
1e0a67f290
stm32/boards/NUCLEO_H743ZI: Enable hardware I2C support.
2018-03-20 23:25:43 +11:00
iabdalkader
24a9facd89
stm32/i2c: Add H7 I2C timing configurations.
...
Found the timing for full (400 KHz) and FM+ (1MHz) in the HAL examples, and
used CubeMX to calculate the standard value (100KHz).
2018-03-20 23:25:01 +11:00
iabdalkader
2ebc538d63
stm32/dma: Enable H7 DMA descriptors.
2018-03-20 23:24:45 +11:00
Damien George
22c693aa6f
tests/pyb/can: Update to test pyb.CAN restart, state, info, inplace recv
2018-03-19 15:15:39 +11:00
Damien George
0abbafd424
stm32/can: Add "list" param to CAN.recv() to receive data inplace.
...
This API matches (as close as possible) how other pyb classes allow inplace
operations, such as pyb.SPI.recv(buf).
2018-03-19 15:12:24 +11:00
Damien George
5e1279d41a
travis: Pass -j4 to make to speed up compilation.
...
This seems to reduce the Travis build time by roughly 1 minute / 10%.
2018-03-19 11:57:38 +11:00
Damien George
e37b8ba5a5
stm32: Use STM32xx macros instead of MCU_SERIES_xx to select MCU type.
...
The CMSIS files for the STM32 range provide macros to distinguish between
the different MCU series: STM32F4, STM32F7, STM32H7, STM32L4, etc. Prefer
to use these instead of custom ones.
2018-03-17 10:42:50 +11:00
Damien George
5edce4539b
py/objexcept: Make MP_DEFINE_EXCEPTION public so ports can define excs.
2018-03-17 00:31:40 +11:00
Damien George
f6a1f18603
py/makeqstrdefs.py: Optimise by using compiled re's so it runs faster.
...
By using pre-compiled regexs, using startswith(), and explicitly checking
for empty lines (of which around 30% of the input lines are), automatic
qstr extraction is speed up by about 10%.
2018-03-16 23:54:06 +11:00
Damien George
06aa13c350
stm32/can: Use explicit byte extraction instead of casting to word ptr.
...
Casting the Data array to a uint32_t* leads to strict aliasing errors on
older gcc compilers.
2018-03-16 23:52:13 +11:00
Damien George
9600a1f207
tests/pyb: Update CAN test to expect that auto_restart is printed.
2018-03-16 18:37:55 +11:00
Damien George
b7d576d69a
docs/library/pyb.CAN: Clean up documentation of data constants.
2018-03-16 18:29:43 +11:00
Damien George
a25e6c6b65
stm32/can: Add CAN.info() method to retrieve error and tx/rx buf info.
2018-03-16 18:28:35 +11:00
Damien George
d7e67fb1b4
stm32/can: Add CAN.state() method to get the state of the controller.
...
This is useful for monitoring errors on the bus and knowing when a restart
is needed.
2018-03-16 17:10:41 +11:00
Damien George
1272c3c65d
stm32/can: Add CAN.restart() method so controller can leave bus-off.
2018-03-15 17:29:30 +11:00
Damien George
823ca03008
stm32/can: Add "auto_restart" option to constructor and init() method.
2018-03-15 17:17:33 +11:00
Damien George
1608c4f5be
stm32/can: Use enums to index keyword arguments, for clarity.
2018-03-15 17:15:41 +11:00
Damien George
2036196d71
stm32/can: Improve can.recv() so it checks for events, eg ctrl-C.
...
This patch provides a custom (and simple) function to receive data on the
CAN bus, instead of the HAL function. This custom version calls
mp_handle_pending() while waiting for messages, which, among other things,
allows to interrupt the recv() method via KeyboardInterrupt.
2018-03-15 16:34:07 +11:00
Damien George
22a9158ced
stm32/boards/STM32L476DISC: Enable CAN peripheral.
...
This board allows to test CAN support on the L4 series.
2018-03-15 16:32:11 +11:00
Damien George
d91a1989f5
docs/library/pyb.CAN: Update markup to use latest doc conventions.
2018-03-15 16:30:05 +11:00
Damien George
0db49c37a4
docs: Fix some references and RST markup to eliminate Sphinx warnings.
2018-03-15 15:50:51 +11:00
Damien George
c926e72750
tests/cpydiff: Indent workaround code snippet so it formats correctly.
2018-03-15 15:49:38 +11:00