Photon2 local compile issue

Can anyone help me with a platform-specific compile issue? I'm getting a persistent error on trying to compile user firmware using the Particle makefile on a P2. I can compile on argon, boron, bsom and tracker without issue. I don't see how my firmware would have anything to do with the error, so I feel confused about what to do next. The error is,

Building cpp file: /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/contexts/contexts.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-32-m/DeviceFirmware/src/contexts/
arm-none-eabi-gcc -DMCU_DEVICE -Drtl872x -DCONFIG_PLATFORM_8721D -DPLATFORM_THREADING=1 -DPLATFORM_ID=32 -DPLATFORM_NAME=p2 -DPLATFORM_GEN=3 -DUSBD_VID_PARTICLE=0x2B04 -DUSBD_PID_DFU=0xD020 -DUSBD_PID_CDC=0xC020 -DSPARK_PLATFORM -fno-builtin-puts -fno-builtin-printf -Wl,--wrap=puts -Wl,--wrap=printf -Wl,--wrap=_printf_i -Wl,--wrap=_svfprintf_r -Wl,--wrap=_scanf_i -Wl,--wrap=__ssvfscanf_r -g3 -gdwarf-2 -Os -mcpu=cortex-m33 -march=armv8-m.main+dsp -mthumb -mcmse -mfloat-abi=hard -mfpu=fpv5-sp-d16 -DARM_CPU_CORTEX_M33 --specs=nano.specs -DINCLUDE_PLATFORM=1 -DPRODUCT_ID=32 -DPRODUCT_FIRMWARE_VERSION=65535 -D_WIZCHIP_=W5500 -DUSE_STDPERIPH_DRIVER -DDFU_BUILD_ENABLE -DLFS_CONFIG=lfs_config.h -DSYSTEM_VERSION_STRING=6.1.1 -DRELEASE_BUILD -I./inc -I../wiring/inc -I../system/inc -I../services/inc -I../third_party/nanopb/nanopb -I../communication/inc -I../hal/inc -I../hal/src/tron -I../hal/network/ncp/wifi -I../hal/network/lwip/esp32 -I../hal/network/ncp/wifi -I../hal/src/rtl872x -I../hal/src/portable/FreeRTOS -I../hal/src/rtl872x -I../hal/src/rtl872x/lwip -I../hal/src/rtl872x/freertos -I../hal/src/rtl872x/mbedtls -I../hal/src/rtl872x/littlefs -I../hal -I../hal/src/rtl872x/posix -I../hal/network -I../hal/network/api -I../hal/network/lwip -I../hal/network/lwip/posix -I../hal/network/lwip/wiznet -I../hal/network/ncp -I../hal/network/ncp/at_parser -I../hal/network/util -I../third_party/lwip/lwip/src/include -I../third_party/freertos/freertos/FreeRTOS/Source/include -I../third_party/ambd_sdk/ambd_sdk/component/os/freertos/freertos_v10.2.0/Source/portable/GCC/RTL8721D_HP/non_secure -I../third_party/wiznet_driver/wiznet_driver/Ethernet -I../gsm0710muxer/gsm0710muxer/include -I../hal/shared -I../platform/shared/inc -I../third_party/ambd_sdk -I../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/cmsis -I../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include -I../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/swlib/include -I../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/app/monitor/include -I../third_party/ambd_sdk/ambd_sdk/component/os/os_dep/include -I../third_party/ambd_sdk/ambd_sdk/component/os/freertos -I../third_party/ambd_sdk/ambd_sdk/component/common/api -I../third_party/ambd_sdk/ambd_sdk/component/common/api/platform -I../third_party/ambd_sdk/ambd_sdk/component/common/api/wifi -I../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/misc -I../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad -I../third_party/ambd_sdk/ambd_sdk/component/common/drivers/wlan/realtek/include -I../third_party/ambd_sdk/ambd_sdk/component/common/drivers/wlan/realtek/src/osdep -I../third_party/ambd_sdk/ambd_sdk/component/common/drivers/wlan/realtek/src/osdep/freertos -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/board/amebad/lib -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/board/amebad/src -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/board/amebad/src/vendor_cmd -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/board/common/inc -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/app -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/bluetooth/gap -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/client -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/bluetooth/profile/server -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/os -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/platform -I../third_party/ambd_sdk/ambd_sdk/component/common/bluetooth/realtek/sdk/inc/stack -I../third_party/ambd_sdk/ambd_sdk/component/common/api/at_cmd -I../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d -I../third_party/ambd_sdk/ambd_sdk/component/common/mbed/hal_ext -I../third_party/ambd_sdk/ambd_sdk/component/common/mbed/hal -I../third_party/ambd_sdk/ambd_sdk/component/common/file_system/fatfs -I../third_party/ambd_sdk/ambd_sdk/component/common/file_system/fatfs/r0.10c/include -I../third_party/ambd_sdk/ambd_sdk/component/common/file_system/ftl -I../third_party/ambd_sdk/ambd_sdk/component/common/drivers/usb/device_new/core -I../third_party/ambd_sdk/ambd_sdk/component/common/drivers/usb/common_new -I../third_party/littlefs/littlefs -I../third_party/miniz/miniz -I../platform/MCU/rtl872x/inc -I../dynalib/inc -I../hal/shared -I/Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src -I./libraries -I/Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware/lib/Adafruit-MCP23017-Arduino-Library/src -I/Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware/lib/Adafruit_BusIO/src -I/Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware/lib/DAC80501/src -I/Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware/lib/PID/src -I/Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware/lib/SparkFun_BME280_Arduino_Library/src -I/Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware/lib/sparkfun_gps/src -I. -MD -MP -MF ../build/target/user/platform-32-m/DeviceFirmware/src/contexts/contexts.o.d -ffunction-sections -fdata-sections -Wall -Wno-switch -fmessage-length=0 -Wno-error=deprecated-declarations -Wno-error=unused-parameter -Wno-deprecated-declarations  -Wimplicit-fallthrough=2 -Wno-expansion-to-defined -Wno-cast-function-type -Wno-unused-parameter -Wno-error=type-limits -fno-strict-aliasing -DSPARK=1 -DPARTICLE=1 -Werror=return-type -Wundef -DSTART_DFU_FLASHER_SERIAL_SPEED=14400 -DSPARK_PLATFORM_NET=rtl872x -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc -DCOMPILE_FOR_HARDWARE_GENERATION=41 -DINPUTS_PARTICLE_PLATFORM="p2" -DINPUTS_HARDWARE_GENERATION="PROTOTYPE" -DINPUTS_DEPLOYMENT="prod" -DINPUTS_VERSION=309 -Wstack-usage=1000 -DBME_280=1 -DNO_BLE=1 -DLOG_INCLUDE_SOURCE_INFO=1 -DPARTICLE_USER_MODULE -DMODULAR_FIRMWARE=1 -DMODULE_VERSION=6 -DMODULE_FUNCTION=5 -DMODULE_INDEX=1 -DMODULE_DEPENDENCY=4,1,6101 -DMODULE_DEPENDENCY2=0,0,0 -D_GNU_SOURCE -DLOG_MODULE_CATEGORY="\"app\""  -fno-exceptions -fno-rtti -fcheck-new -flto -ffat-lto-objects -DPARTICLE_COMPILE_LTO_FAT -fno-use-cxa-atexit -std=gnu++17 -c -o ../build/target/user/platform-32-m/DeviceFirmware/src/contexts/contexts.o /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/contexts/contexts.cpp
In file included from ../hal/src/rtl872x/platform_headers.h:15,
                 from ./inc/application.h:38,
                 from ./inc/Particle.h:5,
                 from /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/constants/constants.h:4,
                 from /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/contexts/contexts.h:4,
                 from /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/contexts/contexts.cpp:3:
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1533:22: error: 'reinterpret_cast' from integer to pointer
 1533 | #define UART0_DEV   ((UART_TypeDef   *) UART0_REG_BASE)  /*KM4 uart0 */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:26:16: note: in expansion of macro 'UART0_DEV'
   26 |  UART_0 = (int)UART0_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1533:22: error: 'reinterpret_cast<UART_TypeDef*>(1073758208)' is not a constant expression
 1533 | #define UART0_DEV   ((UART_TypeDef   *) UART0_REG_BASE)  /*KM4 uart0 */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:26:16: note: in expansion of macro 'UART0_DEV'
   26 |  UART_0 = (int)UART0_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1533:55: error: enumerator value for 'UART_0' is not an integer constant
 1533 | #define UART0_DEV   ((UART_TypeDef   *) UART0_REG_BASE)  /*KM4 uart0 */
      |                                                       ^
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:26:16: note: in expansion of macro 'UART0_DEV'
   26 |  UART_0 = (int)UART0_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1534:22: error: 'reinterpret_cast' from integer to pointer
 1534 | #define UART1_DEV   ((UART_TypeDef   *) UART1_REG_BASE)  /*KM4 uart1_bt */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:27:16: note: in expansion of macro 'UART1_DEV'
   27 |  UART_1 = (int)UART1_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1534:22: error: 'reinterpret_cast<UART_TypeDef*>(1073782784)' is not a constant expression
 1534 | #define UART1_DEV   ((UART_TypeDef   *) UART1_REG_BASE)  /*KM4 uart1_bt */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:27:16: note: in expansion of macro 'UART1_DEV'
   27 |  UART_1 = (int)UART1_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1534:55: error: enumerator value for 'UART_1' is not an integer constant
 1534 | #define UART1_DEV   ((UART_TypeDef   *) UART1_REG_BASE)  /*KM4 uart1_bt */
      |                                                       ^
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:27:16: note: in expansion of macro 'UART1_DEV'
   27 |  UART_1 = (int)UART1_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1535:22: error: 'reinterpret_cast' from integer to pointer
 1535 | #define UART2_DEV   ((UART_TypeDef   *) UART2_REG_BASE)  /*KM0 log uart */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:28:16: note: in expansion of macro 'UART2_DEV'
   28 |  UART_2 = (int)UART2_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1535:22: error: 'reinterpret_cast<UART_TypeDef*>(1208033280)' is not a constant expression
 1535 | #define UART2_DEV   ((UART_TypeDef   *) UART2_REG_BASE)  /*KM0 log uart */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:28:16: note: in expansion of macro 'UART2_DEV'
   28 |  UART_2 = (int)UART2_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1535:55: error: enumerator value for 'UART_2' is not an integer constant
 1535 | #define UART2_DEV   ((UART_TypeDef   *) UART2_REG_BASE)  /*KM0 log uart */
      |                                                       ^
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:28:16: note: in expansion of macro 'UART2_DEV'
   28 |  UART_2 = (int)UART2_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1536:22: error: 'reinterpret_cast' from integer to pointer
 1536 | #define UART3_DEV   ((UART_TypeDef   *) UART3_REG_BASE)  /*KM0 luart*/
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:29:16: note: in expansion of macro 'UART3_DEV'
   29 |  UART_3 = (int)UART3_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1536:22: error: 'reinterpret_cast<UART_TypeDef*>(1208016896)' is not a constant expression
 1536 | #define UART3_DEV   ((UART_TypeDef   *) UART3_REG_BASE)  /*KM0 luart*/
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:29:16: note: in expansion of macro 'UART3_DEV'
   29 |  UART_3 = (int)UART3_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1536:55: error: enumerator value for 'UART_3' is not an integer constant
 1536 | #define UART3_DEV   ((UART_TypeDef   *) UART3_REG_BASE)  /*KM0 luart*/
      |                                                       ^
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:29:16: note: in expansion of macro 'UART3_DEV'
   29 |  UART_3 = (int)UART3_DEV,
      |                ^~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1538:22: error: 'reinterpret_cast' from integer to pointer
 1538 | #define SPI0_DEV    ((SPI_TypeDef   *) SPI0_REG_BASE)  /*KM4 */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:40:15: note: in expansion of macro 'SPI0_DEV'
   40 |  SPI_0 = (int)SPI0_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1538:22: error: 'reinterpret_cast<SPI_TypeDef*>(1074233344)' is not a constant expression
 1538 | #define SPI0_DEV    ((SPI_TypeDef   *) SPI0_REG_BASE)  /*KM4 */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:40:15: note: in expansion of macro 'SPI0_DEV'
   40 |  SPI_0 = (int)SPI0_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1538:53: error: enumerator value for 'SPI_0' is not an integer constant
 1538 | #define SPI0_DEV    ((SPI_TypeDef   *) SPI0_REG_BASE)  /*KM4 */
      |                                                     ^
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:40:15: note: in expansion of macro 'SPI0_DEV'
   40 |  SPI_0 = (int)SPI0_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1539:22: error: 'reinterpret_cast' from integer to pointer
 1539 | #define SPI1_DEV    ((SPI_TypeDef   *) SPI1_REG_BASE)  /*KM4 */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:41:15: note: in expansion of macro 'SPI1_DEV'
   41 |  SPI_1 = (int)SPI1_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1539:22: error: 'reinterpret_cast<SPI_TypeDef*>(1073799168)' is not a constant expression
 1539 | #define SPI1_DEV    ((SPI_TypeDef   *) SPI1_REG_BASE)  /*KM4 */
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:41:15: note: in expansion of macro 'SPI1_DEV'
   41 |  SPI_1 = (int)SPI1_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1539:53: error: enumerator value for 'SPI_1' is not an integer constant
 1539 | #define SPI1_DEV    ((SPI_TypeDef   *) SPI1_REG_BASE)  /*KM4 */
      |                                                     ^
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:41:15: note: in expansion of macro 'SPI1_DEV'
   41 |  SPI_1 = (int)SPI1_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1550:22: error: 'reinterpret_cast' from integer to pointer
 1550 | #define I2C0_DEV    ((I2C_TypeDef   *) I2C0_REG_BASE)
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:45:15: note: in expansion of macro 'I2C0_DEV'
   45 |  I2C_0 = (int)I2C0_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1550:22: error: 'reinterpret_cast<I2C_TypeDef*>(1208008704)' is not a constant expression
 1550 | #define I2C0_DEV    ((I2C_TypeDef   *) I2C0_REG_BASE)
      |                     ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:45:15: note: in expansion of macro 'I2C0_DEV'
   45 |  I2C_0 = (int)I2C0_DEV,
      |               ^~~~~~~~
../third_party/ambd_sdk/ambd_sdk/component/soc/realtek/amebad/fwlib/include/hal_platform_rtl.h:1550:53: error: enumerator value for 'I2C_0' is not an integer constant
 1550 | #define I2C0_DEV    ((I2C_TypeDef   *) I2C0_REG_BASE)
      |                                                     ^
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PeripheralNames.h:45:15: note: in expansion of macro 'I2C0_DEV'
   45 |  I2C_0 = (int)I2C0_DEV,
      |               ^~~~~~~~
In file included from ../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/objects.h:22,
                 from ../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/device.h:46,
                 from /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/contexts/contexts.cpp:4:
../third_party/ambd_sdk/ambd_sdk/component/common/mbed/targets/hal/rtl8721d/PinNames.h:112:3: error: conflicting declaration 'typedef enum PinMode PinMode'
  112 | } PinMode;
      |   ^~~~~~~
In file included from ../hal/inc/interrupts_hal.h:39,
                 from ../wiring/inc/spark_wiring.h:29,
                 from ./inc/application.h:42,
                 from ./inc/Particle.h:5,
                 from /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/constants/constants.h:4,
                 from /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/contexts/contexts.h:4,
                 from /Users/connor/Documents/coda/DeviceFirmware/DeviceFirmware//src/contexts/contexts.cpp:3:
../hal/inc/pinmap_hal.h:57:3: note: previous declaration as 'typedef enum PinMode PinMode'
   57 | } PinMode;
      |   ^~~~~~~
make[4]: *** [../build/target/user/platform-32-m/DeviceFirmware/src/contexts/contexts.o] Error 1
make[3]: *** [user] Error 2
make[2]: *** [modules/tron/user-part] Error 2
make[1]: *** [make-main] Error 2
make: *** [compile-user] Error 2

Things I've tried:

  • Upgrading deviceOS to 6.2.1
  • Reinstalling the Particle workbench toolchains
  • Using the local Docker image to build the firmware
  • Removing references to BLE (I saw an issue where BLE on P2 was not supported the same way as other platforms)

All of these resulted in the same issue. Thanks for your help.

Does cloud compile work?

Do you have a minimal source you can share? I suspect it's caused by a conflicting define, but it's probably not actually UART0_REG_BASE, it's probably something else that's triggering it.

The reason it makes a difference for P2 vs. other devices is the P2 is an RTL872x MCU and the others are an nRF52 They use different native SDK headers since they're different MCU manufacturers, and they define different things for the platforms in different ways.

I will see if I can replicate the issue with a minimal main file.

I think I figured out my issue. My project has a header file named "device.h". I've been including the device.h file without a relative path from a subdirectory like this,

#include "device.h"

This includes tries to include a different "device.h" header file in DeviceOS (I didn't know that was possible). Changing that to the relative path,

#include "../device.h"

Seems to fix the issue. I'm guessing the Photon2 has a file named "device.h" where the other platforms don't.

That makes sense. There is a device.h file in the RTL872x SDK but it doesn't exist anywhere else in Device OS.

1 Like