1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 20:10:18 +03:00
Commit graph

126 commits

Author SHA1 Message Date
jflyper
9ed7ceb47c Register changes fired by modified EOL code for html files 2019-10-03 03:18:37 +09:00
mikeller
865713460e Remove overshoot in warning suppression introduced in #8713. 2019-08-18 08:43:15 +12:00
Dominic Clifton
064b578d43
Merge pull request #8713 from jflyper/bfdev-h7-fix-ll-for-size-sensitive-spi-reg
[H7][LIB] Suppress warnings on type-punned pointers (LL-SPI)
2019-08-16 18:30:00 +02:00
jflyper
880a5d6b55 [H7][LIB] Supress strict aliasing rule warnings on deferencing type-punned pointers 2019-08-16 00:24:08 +09:00
jflyper
1d44de3d42 [H7][LIB] Remove duplicate definition of assert_param from LL dma and Tim 2019-08-12 11:25:34 +09:00
jflyper
713783c76b [F7][LIB] Fix MacOS on-board flash MSC mode for F7 (HAL)
Equivalent to a3d4048 (#7266)
2019-07-31 12:18:43 +09:00
jflyper
d99c53c86f [F7][LIB] Moved ART Prefetch enabling from library to main code
Equivalent to 397db37 (#5729)
2019-07-30 03:55:59 +09:00
jflyper
94b1f8ce9c [F7][LIB] Resolve conflicts of UNUSED defs ST library
Equivalent to #7596 change
2019-07-30 03:55:59 +09:00
jflyper
d3c012245f [F7][LIB] Fix memory corruption in usbd_hid.c 2019-07-30 03:55:59 +09:00
jflyper
7516b36bc0 [F7][LIB] Apply changes for HID and MSC 2019-07-30 03:55:59 +09:00
jflyper
ce2b5c5e3c [F7][LIB] Disable insane defs for MIN and MAX 2019-07-30 03:55:58 +09:00
jflyper
ca47e60363 [F7][LIB] Handle unused parameters 2019-07-30 03:55:55 +09:00
jflyper
e0d3af671b [F7][LIB] Import V1.15.0 library 2019-07-30 02:26:22 +09:00
jflyper
92f532f313 [F7][LIB] Remove old library 2019-07-30 02:26:04 +09:00
jflyper
6fbc0f44ca [H7][LIB][SPI] Use union to access size sensitive SPI data register
Application of

Use union to access access size sensitive registers (7a0d3e7)

to V1.4.0

----
Note from "Use union to access access size sensitive registers (7a0d3e7)":
----

Use union to access access size sensitive registers

As described in RM0433 section 49.4.13 "Data packing", STM32H7's SPI data register supports data packing and it is sensitive to actual access width.

The original code used pointer casting to obtain a code to access the register in a desired size.
However, these operation results in strict aliasing warnings (deferencing punned pointer) and are not desirable.

Here, we declare a union that allow access to a 32-bit register in 8, 16 or 32-bit width and cast pointer to the original RXDR and TXDR data registers and then access the portion of the register through an appropriate union member.

XXX FIXME Only handled 16-bit access case, as 32-bit (original declaration) and 8-bit (allowed) cases do not generate warnings, but these should be handled similarly for correctness and consistency of the code.
2019-07-08 09:36:04 +09:00
jflyper
8bbc1456f3 [H7][LIB][USB] Middlewares change: Fix memory corruption
Application of
[H7] USB LIB Middlewares change: Avoid null hhid from being deferenced
to V1.4.0
2019-07-08 09:36:04 +09:00
jflyper
c6321190a9 [H7][LIB][USB] Modify USB Library for composite device
Application of

[H7] Modify USB Middleware library for composite device support #8235 (1861c6d)

to V1.4.0
2019-07-08 09:30:55 +09:00
jflyper
d924e59c3c [H7][LIB][SDMMC] Workaround for SDMMC Errata 2.11.4
Application of

STM32H750 - Apply workaround to the SDMMC Errata 2.11.4 (8446832)

to V1.4.0
2019-07-08 09:30:55 +09:00
jflyper
41f7c0c5fd [H7][LIB][SD] Fix for H750 Errata 2.11.5.
Application of

STM32H750 - Fix for H750 Errata 2.11.5. (adcf556)

to V1.4.0
2019-07-08 09:30:55 +09:00
jflyper
125e0887b5 [H7][LIB] Take care of UNUSED parameters in V1.4.0 2019-07-08 09:30:54 +09:00
jflyper
49ee02a707 [H7][LIB] Modify HAL SPI driver for const-ness to match call from current bus_spi driver 2019-07-08 09:30:54 +09:00
jflyper
42c9475203 [H7][LIB][USB] usbd_def: disable insane defs of MIN and MAX 2019-07-08 09:30:54 +09:00
jflyper
0c7bc10bd0 [H7][LIB][CMSIS] Handle FLASH_SIZE def collision with Betaflight 2019-07-08 09:30:40 +09:00
jflyper
2f911c1163 [H7][LIB] Import V1.4.0 library 2019-07-05 00:09:01 +09:00
jflyper
1a8d40494d [H7][LIB] Remove V1.3.0 library 2019-07-05 00:09:00 +09:00
Dominic Clifton
8a1a75e2ef [H7] USB Middlewares change: Fix memory corruption 2019-05-12 22:09:09 +09:00
jflyper
1861c6d957 [H7] Modify USB Middleware library for composite device support 2019-05-09 13:56:29 +09:00
jflyper
e62cc6552d [F7] Move non-library CDC-HID code out of lib tree 2019-05-08 11:59:23 +09:00
Michael Keller
35270099c0
Removed non-library header from 'lib/'. (#8115)
Removed non-library header from 'lib/'.
2019-05-07 12:12:14 +12:00
mikeller
2d958f8d8a Removed non-library header from 'lib/'. 2019-04-28 14:58:53 +12:00
jflyper
0c5540228f Simple fixes to library files
- stm32h7xx_hal_rcc.c: Prevent signed-unsigned comparison warning

- [USBLIB] Take care of unused parameters

- [LIB] Stop signed-unsigned comparison warning (rcc_ex)

- Modify HAL SPI driver for const-ness to match call from current bus_spi driver

- [LIB] Handle unused in stm32h7xx_hal_flash.c

- UNUSED care for stm32h7xx_hal_rtc_ex.c

- UNUSED care for stm32h7xx_hal_pwr.c

- UNUSED care for stm32h7xx_hal_pcd.c

- UNUSED care for stm32h7xx_hal_flash.c

- UNUSED care for stm32h7xx_hal_adc_ex.c
2019-04-28 05:55:01 +09:00
jflyper
7a0d3e73f5 Use union to access access size sensitive registers
As described in RM0433 section 49.4.13 "Data packing", STM32H7's SPI data register supports data packing and it is sensitive to actual access width.

The original code used pointer casting to obtain a code to access the register in a desired size.
However, these operation results in strict aliasing warnings (deferencing punned pointer) and are not desirable.

Here, we declare a union that allow access to a 32-bit register in 8, 16 or 32-bit width and cast pointer to the original RXDR and TXDR data registers and then access the portion of the register through an appropriate union member.

XXX FIXME Only handled 16-bit access case, as 32-bit (original declaration) and 8-bit (allowed) cases do not generate warnings, but these should be handled similarly for correctness and consistency of the code.
2019-04-28 05:55:01 +09:00
jflyper
8670c05068 SPI HAL library bug (referencing RX side handle from TX only DMA) 2019-04-28 05:55:01 +09:00
Dominic Clifton
844683279a STM32H750 - Apply workaround to the SDMMC Errata 2.11.4
Issue: "Consecutive multiple block transfers can induce incorrect data length"
Workaround: "8 SDMMC clock cycles must elapse before DTEN can be set."
2019-04-28 05:55:01 +09:00
Dominic Clifton
adcf556ea5 STM32H750 - Fix for H750 Errata 2.11.5. 2019-04-28 05:55:00 +09:00
Dominic Clifton
a545abc511 Fix compilation error in H7 HAL library when enabling QSPI. 2019-04-28 05:55:00 +09:00
jflyper
99ea236bc2 Take care of "FLASH_SIZE" constant for stm32h750xx.h in lib 2019-04-28 05:54:36 +09:00
jflyper
0bb34cdd09 usbd_def: disable insane defs of MIN and MAX 2019-04-25 12:01:42 +09:00
jflyper
e124693d48 [LIB] stm32h7xx_hal_def.h : Include <stddef.h> instead of <stdio.h>
Inclusion of <stdio.h> produces poisoned function alert for sprintf and
variants.
F7 use <stddef.h> instead of <stdio.h>
2019-04-25 12:01:42 +09:00
jflyper
22dd78f247 [CMSIS] stm32h743xx.h: FLASH_SIZE def collide with Betaflight 2019-04-25 12:01:42 +09:00
jflyper
5f15f58aa6 Import STM32Cube_FW_H7_V1.3.0 2019-04-21 18:39:03 +09:00
Dominic Clifton
705a2c565b Fix memory corruption in USB code.
Crash occurs on my machine shortly after power up.  `hhid` is null at
the time it occurs so the change to `hhid->state` causes a crash.
2019-03-16 12:02:42 +01:00
Michael Keller
93f933f01f Fixed build for gcc 8 (SITL). 2019-02-25 15:34:34 +13:00
Bruce Luckcuck
02a368a8e7 Fix UNUSED() macro conflict with STM libraries
Added `#if !defined(` blocks around the `UNUSED()` definitions in the libraries to prevent conflicts.
2019-02-18 11:26:03 -05:00
Bruce Luckcuck
a3d4048493 Fix MacOS on-board flash MSC mode for F7 (HAL)
Needed to fix the F7 HAL library version as well. Tested on a DALRCF722DUAL.
2018-12-21 18:36:09 -05:00
Bruce Luckcuck
a1899d671b Fixes to allow the MSC command with on-board flash to work on MacOS.
Fixed a bug in the STM libraries to set the write protected bin in the device config for the mass storage SCSI sense code 6 and 10. Previously the `isWriteProtected()` result was only being examined during write attempts and they correctly failed and returned a `NOT_READY` response (we don't support writes for SPIFLASH). Unfortunately since the device was not flagged as write protected on MacOS the operating system would try to write to the device and this would fail causing the operating system to think the device wasn't ready and refuse to mount it.

General fixes:

Ensured that the filesystem appears to be at least 256MB so that the volume will be treated as FAT32 instead of FAT16. A hidden "padding.txt" file is created to represent the extra space.

Fix the directory structure to only create the "btfl_all.bbl" file if there were any logs found. Previously it would always be created and this would lead to directory corruption.

Fix the size calculation for the  "btfl_all.bbl" file. Previously it was being set to the total flash size rather than the used space.
2018-11-27 18:48:46 -05:00
Andrey Mironov
ff4c2bc145 Post-cleanup of F7 optimizations (#5729)
* Moved ART Prefetch enabling from library to main code

* Fixed tabs to spaces

* Added F7 LL EX header to simplify work with DMA and TIM

* Refactored F7 DSHOT using LL EX

* Got rid of overlooked duplicate lines
2018-04-21 18:14:35 +12:00
Andrey Mironov
bf984f39b1 F7 optimizations (#5674)
* Revert "Revert "Rewritten F7 dshot to LL (draft)" (#5430)"

This reverts commit aa42a69d2f.

* Reworked F7 linker scripts to maximize performance of both F74x and F72x

* Some comments and changes from original F7 HAL DSHOT

* Prohibit inlining of some functions to place them in ITCM-RAM

* Fixed usartTargetConfigure implicit declaration

* Moved back to SRAM1 as main RAM

* Added SRAM2 attribute

* Fixed LL DSHOT FOR SPRF7DUAL and probably other adv TIM users

* Fixed SPRF7DUAL rev. A motor order

* Enabled CCM for data on F40x

* Fixed F7 startup assembly symbols

* Fixed KISSFCV2F7 linker script

* Added a quick way of building F7 targets only

* Got rid of the useless F7 target script

* Added NOINLINE and got rid of useless __APPLE__ define

* Added some important functions to ITCM

* Added NOINLINE macro for tests

* Copy to ITCM before passing execution into it

* Minimized cache footprint of motor output code

* Evicted low-impact functions from ITCM

* Switched MATEKF722 and SPRACINGF7DUAL to burst DSHOT

* Switched CLRACINGF7 to burst DSHOT

* Moved UART RX&TX buffers to DTCM-RAM to avoid cache incoherency

* Marked taskMainPidLoop for ITCM-RAM, disallowed inlining per-function

* Revert "Added a quick way of building F7 targets only"

This reverts commit 2294518998.
2018-04-20 08:37:32 +12:00
jflyper
0ae84bebb4 Per mikeller's comment. 2018-04-13 02:59:17 +09:00
jflyper
78bc3f52ad Disable VBUSSENSING features on PA9 completely 2018-04-13 02:07:58 +09:00