Error: Incomplete type is not allowed in "mbed-stm32f100r6/api/CAN.h"

With non-standard devices without CAN n.e. F100R6 compiled as a target F103RB.

Reason:
Compiler cli macro definition(-DDEVICE_CAN=1) causes unwanted compilation. Missing definition and setting to 0 in device.h.

Workaround:
add to device.h:

#undef DEVICE_CAN

#define DEVICE_CAN              0



Additional info:

Macros defined in online mbed compiler for F103RB (command line only, not in source files):

__MBED__=1
DEVICE_I2CSLAVE=1
TARGET_LIKE_MBED
DEVICE_PORTINOUT=1
__MBED_CMSIS_RTOS_CM
TARGET_STM32F1
DEVICE_RTC=1
TOOLCHAIN_object
__CMSIS_RTOS
MBED_BUILD_TIMESTAMP=1472830900.8
DEVICE_CAN=1
TARGET_LIKE_CORTEX_M3
TARGET_CORTEX_M
ARM_MATH_CM3
TARGET_UVISOR_UNSUPPORTED
TARGET_M3
DEVICE_SERIAL=1
DEVICE_INTERRUPTIN=1
MBED_USERNAME=mega64
DEVICE_I2C=1
DEVICE_PORTOUT=1
__CORTEX_M3
DEVICE_STDIO_MESSAGES=1
TARGET_FF_MORPHO
TARGET_FF_ARDUINO
TARGET_RELEASE
TARGET_STM
DEVICE_PORTIN=1
DEVICE_SLEEP=1
TARGET_NUCLEO_F103RB
DEVICE_SPI=1
TARGET_STM32F103RB
DEVICE_SPISLAVE=1
DEVICE_ANALOGIN=1
DEVICE_PWMOUT=1
TOOLCHAIN_ARM
TOOLCHAIN_ARM_STD


2016.9.2


1 comment on Error: Incomplete type is not allowed in "mbed-stm32f100r6/api/CAN.h":

13 Sep 2016

Thank You, Adding

  1. undef DEVICE_CAN
  1. define DEVICE_CAN 0

Did the trick. Program compiled with out error.

Please log in to post comments.