Skip to content

Build of NUCLEO_F030R8 fails when DEVICE_SERIAL=0 #8913

@deece

Description

@deece

Description

I am trying to build a cutdown mbed to use as part of a bootloader. In order to make the final binary as small as possible, I have historically passed: -D DEVICE_SERIAL=0 -D DEVICE_STDIO_MESSAGES=0 to the build script.

When passing these defines to tagmbed-os-5.9.7 (I can't build master due to #8912), I get the following failure:

$ MBED_GCC_ARM_PATH=/usr/local/gcc-arm-none-eabi-7-2018-q2-update/bin python build.py -c -v -m NUCLEO_F030R8 -t GCC_ARM --profile release -D DEVICE_SERIAL=0 -D USE_PLL_HSE_EXTC=0 -D USE_PLL_HSE_XTAL=0 -D DEVICE_STDIO_MESSAGES=0
...
Compile [ 28.8%]: RawSerial.cpp
Compile: /usr/local/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-g++ -std=gnu++98 -fno-rtti -Wvla -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -MMD -fno-delete-null-pointer-checks -fomit-frame-pointer -Os -DNDEBUG -g1 -DMBED_RTOS_SINGLE_THREAD -mcpu=cortex-m0 -mthumb -D__CORTEX_M0 -DCMSIS_VECTAB_VIRTUAL -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DDEVICE_PORTOUT=1 -DDEVICE_PORTINOUT=1 -D__MBED_CMSIS_RTOS_CM -DTARGET_STM32F0 -DDEVICE_RTC=1 -DTARGET_NUCLEO_F030R8 -D__CMSIS_RTOS -DUSE_PLL_HSE_EXTC=0 -DTOOLCHAIN_GCC -DDEVICE_CRC=1 -DTARGET_CORTEX_M -DDEVICE_I2C_ASYNCH=1 -DARM_MATH_CM0 -DTARGET_UVISOR_UNSUPPORTED -DTARGET_M0 -DDEVICE_SPI_ASYNCH=1 -DMBED_BUILD_TIMESTAMP=1543552042.53 -DDEVICE_INTERRUPTIN=1 -DTARGET_CORTEX -DDEVICE_I2C=1 -DTRANSACTION_QUEUE_SIZE_SPI=2 -DDEVICE_STDIO_MESSAGES=1 -DDEVICE_STDIO_MESSAGES=0 -DTARGET_FF_MORPHO -DTARGET_FAMILY_STM32 -DTARGET_FF_ARDUINO -DTARGET_RELEASE -DTARGET_STM -DDEVICE_SERIAL=1 -DDEVICE_USTICKER=1 -DDEVICE_PORTIN=1 -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DCMSIS_VECTAB_VIRTUAL_HEADER_FILE="cmsis_nvic.h" -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_PWMOUT=1 -DDEVICE_SERIAL=0 -DUSE_PLL_HSE_XTAL=0 -DTARGET_STM32F030R8 -DTARGET_LIKE_CORTEX_M0 -DDEVICE_SERIAL_FC=1 @/home/adsilva/src/mbed-os/BUILD/mbed/.temp/TARGET_NUCLEO_F030R8/TOOLCHAIN_GCC_ARM/.includes_60b08cff41dbb009a5ee08b83a809415.txt -include /home/adsilva/src/mbed-os/BUILD/mbed/.temp/TARGET_NUCLEO_F030R8/TOOLCHAIN_GCC_ARM/mbed_config.h -MD -MF ../BUILD/mbed/.temp/TARGET_NUCLEO_F030R8/TOOLCHAIN_GCC_ARM/RawSerial.d -o ../BUILD/mbed/.temp/TARGET_NUCLEO_F030R8/TOOLCHAIN_GCC_ARM/RawSerial.o /home/adsilva/src/mbed-os/drivers/RawSerial.cpp
[Warning] <command-line>@0,0: "DEVICE_STDIO_MESSAGES" redefined
[Warning] <command-line>@0,0: "DEVICE_SERIAL" redefined
[Error] SerialBase.h@166,43: 'SerialIrq' has not been declared
[Error] SerialBase.h@259,5: 'serial_t' does not name a type; did you mean 'serial_s'?
[DEBUG] Return: 1
[DEBUG] Output: <command-line>:0:0: warning: "DEVICE_STDIO_MESSAGES" redefined
[DEBUG] Output: <command-line>:0:0: note: this is the location of the previous definition
[DEBUG] Output: <command-line>:0:0: warning: "DEVICE_SERIAL" redefined
[DEBUG] Output: <command-line>:0:0: note: this is the location of the previous definition
[DEBUG] Output: In file included from /home/adsilva/src/mbed-os/BUILD/mbed/drivers/RawSerial.h:23:0,
[DEBUG] Output:                  from /home/adsilva/src/mbed-os/drivers/RawSerial.cpp:16:
[DEBUG] Output: /home/adsilva/src/mbed-os/BUILD/mbed/drivers/SerialBase.h:166:43: error: 'SerialIrq' has not been declared
[DEBUG] Output:      static void _irq_handler(uint32_t id, SerialIrq irq_type);
[DEBUG] Output:                                            ^~~~~~~~~
[DEBUG] Output: /home/adsilva/src/mbed-os/BUILD/mbed/drivers/SerialBase.h:259:5: error: 'serial_t' does not name a type; did you mean 'serial_s'?
[DEBUG] Output:      serial_t         _serial;
[DEBUG] Output:      ^~~~~~~~
[DEBUG] Output:      serial_s
Traceback (most recent call last):
  File "build.py", line 210, in <module>
    notify=notifier,
  File "/home/adsilva/src/mbed-os/tools/build_api.py", line 1083, in build_mbed_libs
    library_incdirs + incdirs)
  File "/home/adsilva/src/mbed-os/tools/toolchains/__init__.py", line 930, in compile_sources
    return self.compile_queue(queue, objects)
  File "/home/adsilva/src/mbed-os/tools/toolchains/__init__.py", line 993, in compile_queue
    raise ToolException(err)
ToolException: <command-line>:0:0: warning: "DEVICE_STDIO_MESSAGES" redefined
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: warning: "DEVICE_SERIAL" redefined
<command-line>:0:0: note: this is the location of the previous definition
In file included from /home/adsilva/src/mbed-os/BUILD/mbed/drivers/RawSerial.h:23:0,
                 from /home/adsilva/src/mbed-os/drivers/RawSerial.cpp:16:
/home/adsilva/src/mbed-os/BUILD/mbed/drivers/SerialBase.h:166:43: error: 'SerialIrq' has not been declared
     static void _irq_handler(uint32_t id, SerialIrq irq_type);
                                           ^~~~~~~~~
/home/adsilva/src/mbed-os/BUILD/mbed/drivers/SerialBase.h:259:5: error: 'serial_t' does not name a type; did you mean 'serial_s'?
     serial_t         _serial;
     ^~~~~~~~
     serial_s

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions