From 2869e9b1c45c142817c04cf8901e52df5413ff03 Mon Sep 17 00:00:00 2001 From: Augusto Fraga Giachero Date: Fri, 15 Jan 2021 10:05:41 -0300 Subject: [PATCH 1/3] Fix wrong i2c id range check i2c_take_by_chipid should check chip_id against I2C_CHIP_CNT. This fixes the PCIe link never coming up and other problems related to I2C access. --- modules/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/i2c.c b/modules/i2c.c index 946b1d928..aa3ab7e7f 100644 --- a/modules/i2c.c +++ b/modules/i2c.c @@ -85,7 +85,7 @@ bool i2c_take_by_busid( uint8_t bus_id, uint8_t *i2c_interface, TickType_t timeo bool i2c_take_by_chipid( uint8_t chip_id, uint8_t *i2c_address, uint8_t *i2c_interface, uint32_t timeout ) { - if ( chip_id > I2C_BUS_CNT ) { + if ( chip_id > I2C_CHIP_CNT ) { return false; } From 87b0a3fc73ad94444336f930e2cdd3c1e687d02c Mon Sep 17 00:00:00 2001 From: Augusto Fraga Giachero Date: Fri, 15 Jan 2021 10:21:38 -0300 Subject: [PATCH 2/3] Remove unnecessary builds, fixes build errors for the 'devel' branch --- ci_build.sh | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/ci_build.sh b/ci_build.sh index e0e1e6fbb..41457cc3b 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -10,37 +10,27 @@ LC_ALL=C export LANG LC_ALL # Location of releases +set +e GIT_DESCRIBE=$(git describe --tags --abbrev=10) +if [ $? -ne 0 ]; then + GIT_DESCRIBE=devel +fi +set -e # Declare all combinations for deploy all # Note that the key is the name of the release object declare -A BUILDS BUILDS[afc-bpm-3.0-${GIT_DESCRIBE}]="\ - -DBOARD=afc-bpm \ - -DVERSION=3.0 \ - -DBOARD_RTM= \ - -DCMAKE_BUILD_TYPE=Release" -BUILDS[afc-bpm-3.1-${GIT_DESCRIBE}]="\ - -DBOARD=afc-bpm \ - -DVERSION=3.1 \ - -DBOARD_RTM= \ - -DCMAKE_BUILD_TYPE=Release" -BUILDS[afc-timing-${GIT_DESCRIBE}]="\ - -DBOARD=afc-timing \ - -DVERSION= \ - -DBOARD_RTM=rtm-8sfp \ - -DCMAKE_BUILD_TYPE=Release" -BUILDS[debug-afc-bpm-3.0-${GIT_DESCRIBE}]="\ -DBOARD=afc-bpm \ -DVERSION=3.0 \ -DBOARD_RTM= \ -DCMAKE_BUILD_TYPE=RelWithDebInfo" -BUILDS[debug-afc-bpm-3.1-${GIT_DESCRIBE}]="\ +BUILDS[afc-bpm-3.1-${GIT_DESCRIBE}]="\ -DBOARD=afc-bpm \ -DVERSION=3.1 \ -DBOARD_RTM= \ -DCMAKE_BUILD_TYPE=RelWithDebInfo" -BUILDS[debug-afc-timing-${GIT_DESCRIBE}]="\ +BUILDS[afc-timing-${GIT_DESCRIBE}]="\ -DBOARD=afc-timing \ -DVERSION= \ -DBOARD_RTM=rtm-8sfp \ From 17e0cd377174bb78a9190b003a2b63cd8bde7cae Mon Sep 17 00:00:00 2001 From: Augusto Fraga Giachero Date: Fri, 15 Jan 2021 10:25:59 -0300 Subject: [PATCH 3/3] Force -fno-common on old GCC versions Force older GCC versions to place uninitialized global variables in the BSS section. This will cause linking errors if the same global variable is defined in different compilation units that should be linked in the end. --- toolchain/toolchain-arm-none-eabi.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/toolchain-arm-none-eabi.cmake b/toolchain/toolchain-arm-none-eabi.cmake index 51ac651a6..21cd66daa 100644 --- a/toolchain/toolchain-arm-none-eabi.cmake +++ b/toolchain/toolchain-arm-none-eabi.cmake @@ -26,7 +26,7 @@ set( CMAKE_OBJCOPY ${TC_PATH}${CROSS_COMPILE}objcopy set( CMAKE_OBJDUMP ${TC_PATH}${CROSS_COMPILE}objdump CACHE FILEPATH "The toolchain objdump command " FORCE ) -set(COMMON_FLAGS "-fno-builtin -ffunction-sections -fdata-sections -fno-strict-aliasing -fmessage-length=0") +set(COMMON_FLAGS "-fno-common -fno-builtin -ffunction-sections -fdata-sections -fno-strict-aliasing -fmessage-length=0") set(CMAKE_C_FLAGS "${COMMON_FLAGS} -std=gnu99") set(CMAKE_CXX_FLAGS "${COMMON_FLAGS} -std=gnu++0x") set(CMAKE_EXE_LINKER_FLAGS "-Wl,-gc-sections --specs=nosys.specs -nostdlib -static -nostartfiles")