From 3234aca53b04a0bd555da45afb25477c070c7b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 2 Sep 2019 15:40:19 +0200 Subject: [PATCH] px4_micro_hal: add PX4_ARCH_DCACHE_LINESIZE definition --- .../src/px4/stm/stm32_common/include/px4_arch/px4io_serial.h | 3 ++- .../nuttx/src/px4/stm/stm32f4/include/px4_arch/micro_hal.h | 1 + .../nuttx/src/px4/stm/stm32f4/include/px4_arch/px4io_serial.h | 1 - .../nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h | 1 + .../nuttx/src/px4/stm/stm32f7/include/px4_arch/px4io_serial.h | 1 - 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/px4io_serial.h b/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/px4io_serial.h index f8888f402419..27c2dacefc91 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/px4io_serial.h +++ b/platforms/nuttx/src/px4/stm/stm32_common/include/px4_arch/px4io_serial.h @@ -41,6 +41,7 @@ #include #include +#include #include @@ -164,6 +165,6 @@ class ArchPX4IOSerial : public PX4IO_serial /** * IO Buffer storage */ - static uint8_t _io_buffer_storage[] __attribute__((aligned(PX4IO_SERIAL_BUF_ALIGN))); + static uint8_t _io_buffer_storage[] __attribute__((aligned(PX4_ARCH_DCACHE_LINESIZE))); }; diff --git a/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/micro_hal.h b/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/micro_hal.h index 2c06c7641c3d..c997c4f47326 100644 --- a/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/micro_hal.h +++ b/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/micro_hal.h @@ -46,6 +46,7 @@ __BEGIN_DECLS # define PX4_BBSRAM_GETDESC_IOCTL STM32_BBSRAM_GETDESC_IOCTL #endif #define PX4_NUMBER_I2C_BUSES STM32_NI2C +#define PX4_ARCH_DCACHE_LINESIZE 32 __END_DECLS diff --git a/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/px4io_serial.h b/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/px4io_serial.h index 77564d2ad09f..5898838ee4b4 100644 --- a/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/px4io_serial.h +++ b/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/px4io_serial.h @@ -33,6 +33,5 @@ #pragma once -#define PX4IO_SERIAL_BUF_ALIGN 4 #include "../../../stm32_common/include/px4_arch/px4io_serial.h" diff --git a/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h b/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h index af9a59589596..c7d0ca02e6cd 100644 --- a/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h +++ b/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/micro_hal.h @@ -46,6 +46,7 @@ __BEGIN_DECLS #define PX4_BBSRAM_GETDESC_IOCTL STM32F7_BBSRAM_GETDESC_IOCTL #define PX4_FLASH_BASE 0x08000000 #define PX4_NUMBER_I2C_BUSES STM32F7_NI2C +#define PX4_ARCH_DCACHE_LINESIZE ARMV7M_DCACHE_LINESIZE void stm32_flash_lock(void); void stm32_flash_unlock(void); diff --git a/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/px4io_serial.h b/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/px4io_serial.h index 0e78048670cc..5898838ee4b4 100644 --- a/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/px4io_serial.h +++ b/platforms/nuttx/src/px4/stm/stm32f7/include/px4_arch/px4io_serial.h @@ -33,6 +33,5 @@ #pragma once -#define PX4IO_SERIAL_BUF_ALIGN ARMV7M_DCACHE_LINESIZE #include "../../../stm32_common/include/px4_arch/px4io_serial.h"