1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Removed ATOMIC_BARRIER check, fixed ITCM_RAM overflow.

This commit is contained in:
mikeller 2019-11-24 13:56:16 +13:00
parent 1583cb8106
commit a302b5bae2
7 changed files with 30 additions and 20 deletions

View file

@ -21,6 +21,7 @@ env:
- GOAL=targets-group-2
- GOAL=targets-group-3
- GOAL=targets-group-4
- GOAL=targets-group-5
- GOAL=targets-group-rest
# - GOAL=all
# - GOAL=AFROMINI

View file

@ -235,6 +235,13 @@ CC_SPEED_OPTIMISATION := $(OPTIMISATION_BASE) $(OPTIMISE_SPEED)
CC_SIZE_OPTIMISATION := $(OPTIMISATION_BASE) $(OPTIMISE_SIZE)
CC_NO_OPTIMISATION :=
#
# Added after GCC version update, remove once the warnings have been fixed
#
TEMPORARY_FLAGS := -Wno-stringop-truncation \
-Wno-attributes \
-Wno-cast-function-type
CFLAGS += $(ARCH_FLAGS) \
$(addprefix -D,$(OPTIONS)) \
$(addprefix -I,$(INCLUDE_DIRS)) \
@ -245,10 +252,7 @@ CFLAGS += $(ARCH_FLAGS) \
-fdata-sections \
-fno-common \
-pedantic \
-Wno-stringop-truncation \
-Wno-attributes \
-Wno-cast-function-type \
-Wno-stringop-overflow \
$(TEMPORARY_FLAGS) \
$(DEVICE_FLAGS) \
-D_GNU_SOURCE \
-DUSE_STDPERIPH_DRIVER \
@ -462,9 +466,12 @@ targets-group-2: $(GROUP_2_TARGETS)
## targets-group-3 : build some targets
targets-group-3: $(GROUP_3_TARGETS)
## targets-group-3 : build some targets
## targets-group-4 : build some targets
targets-group-4: $(GROUP_4_TARGETS)
## targets-group-5 : build some targets
targets-group-5: $(GROUP_5_TARGETS)
## targets-group-rest: build the rest of the targets (not listed in group 1, 2 or 3)
targets-group-rest: $(GROUP_OTHER_TARGETS)
@ -599,12 +606,14 @@ targets:
@echo "targets-group-2: $(GROUP_2_TARGETS)"
@echo "targets-group-3: $(GROUP_3_TARGETS)"
@echo "targets-group-4: $(GROUP_4_TARGETS)"
@echo "targets-group-5: $(GROUP_5_TARGETS)"
@echo "targets-group-rest: $(GROUP_OTHER_TARGETS)"
@echo "targets-group-1: $(words $(GROUP_1_TARGETS)) targets"
@echo "targets-group-2: $(words $(GROUP_2_TARGETS)) targets"
@echo "targets-group-3: $(words $(GROUP_3_TARGETS)) targets"
@echo "targets-group-4: $(words $(GROUP_4_TARGETS)) targets"
@echo "targets-group-5: $(words $(GROUP_5_TARGETS)) targets"
@echo "targets-group-rest: $(words $(GROUP_OTHER_TARGETS)) targets"
@echo "total in all groups $(words $(CI_TARGETS)) targets"

View file

@ -154,10 +154,10 @@ LEGACY_TARGETS := MATEKF405 \
TMOTORF7 \
TRANSTECF7
CI_TARGETS := $(filter-out $(LEGACY_TARGETS), $(filter-out $(UNSUPPORTED_TARGETS), $(VALID_TARGETS)))
CI_TARGETS := $(filter-out $(LEGACY_TARGETS) $(UNSUPPORTED_TARGETS), $(VALID_TARGETS))
TARGETS_TOTAL := $(words $(CI_TARGETS))
TARGET_GROUPS := 5
TARGET_GROUPS := 6
TARGETS_PER_GROUP := $(shell expr $(TARGETS_TOTAL) / $(TARGET_GROUPS) )
ST := 1
@ -176,4 +176,8 @@ ST := $(shell expr $(ET) + 1)
ET := $(shell expr $(ST) + $(TARGETS_PER_GROUP))
GROUP_4_TARGETS := $(wordlist $(ST), $(ET), $(CI_TARGETS))
GROUP_OTHER_TARGETS := $(filter-out $(GROUP_1_TARGETS) $(GROUP_2_TARGETS) $(GROUP_3_TARGETS) $(GROUP_4_TARGETS), $(CI_TARGETS))
ST := $(shell expr $(ET) + 1)
ET := $(shell expr $(ST) + $(TARGETS_PER_GROUP))
GROUP_5_TARGETS := $(wordlist $(ST), $(ET), $(CI_TARGETS))
GROUP_OTHER_TARGETS := $(filter-out $(GROUP_1_TARGETS) $(GROUP_2_TARGETS) $(GROUP_3_TARGETS) $(GROUP_4_TARGETS) $(GROUP_5_TARGETS), $(CI_TARGETS))

View file

@ -61,7 +61,10 @@ MEMORY
DTCM_RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
RAM (rwx) : ORIGIN = 0x24000000, LENGTH = 64K
CODE_RAM (rx) : ORIGIN = 0x24010000, LENGTH = 448K - _exst_hash_size /* hard coded start address, as required by SPRACINGH7 boot loader, don't change! */
EXST_HASH (rx) : ORIGIN = 0x24010000 + LENGTH(CODE_RAM), LENGTH = _exst_hash_size
/*EXST_HASH (rx) : ORIGIN = 0x24010000 + LENGTH(CODE_RAM), LENGTH = _exst_hash_size*/
/* Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=24289,
* revert after this has been fixed in the ARM gcc. */
EXST_HASH (rx) : ORIGIN = 0x2407FFC0, LENGTH = _exst_hash_size
D2_RAM (rwx) : ORIGIN = 0x30000000, LENGTH = 256K /* SRAM1 + SRAM2 */

View file

@ -137,13 +137,6 @@ static inline uint8_t __basepriSetRetVal(uint8_t prio)
// On gcc 5 and higher, this protects only memory passed as parameter (any type can be used)
// this macro can be used only ONCE PER LINE, but multiple uses per block are fine
#if (__GNUC__ > 8)
# warning "Please verify that ATOMIC_BARRIER works as intended"
// increment version number if BARRIER works
// TODO - use flag to disable ATOMIC_BARRIER and use full barrier instead
// you should check that local variable scope with cleanup spans entire block
#endif
#ifndef __UNIQL
# define __UNIQL_CONCAT2(x,y) x ## y
# define __UNIQL_CONCAT(x,y) __UNIQL_CONCAT2(x,y)

View file

@ -33,7 +33,7 @@ mpuRegion_t mpuRegions[] = {
#ifdef USE_ITCM_RAM
{
// Mark ITCM-RAM as read-only
// "For Cortex®-M7, TCMs memories always behave as Non-cacheable, Non-shared normal memories, irrespectiveof the memory type attributes defined in the MPU for a memory region containing addresses held in the TCM"
// "For Cortex®-M7, TCMs memories always behave as Non-cacheable, Non-shared normal memories, irrespective of the memory type attributes defined in the MPU for a memory region containing addresses held in the TCM"
// See AN4838
.start = 0x00000000,
.end = 0, // Size defined by "size"

View file

@ -64,12 +64,12 @@ void initBoardAlignment(const boardAlignment_t *boardAlignment)
buildRotationMatrix(&rotationAngles, &boardRotation);
}
FAST_CODE static void alignBoard(float *vec)
static FAST_CODE void alignBoard(float *vec)
{
applyRotation(vec, &boardRotation);
}
FAST_CODE void alignSensorViaMatrix(float *dest, fp_rotationMatrix_t* sensorRotationMatrix)
FAST_CODE_NOINLINE void alignSensorViaMatrix(float *dest, fp_rotationMatrix_t* sensorRotationMatrix)
{
applyRotation(dest, sensorRotationMatrix);