{"action":"created","issue":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8913","repository_url":"https://api.github.com/repos/ARMmbed/mbed-os","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8913/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8913/comments","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8913/events","html_url":"https://github.com/ARMmbed/mbed-os/issues/8913","id":386033686,"node_id":"MDU6SXNzdWUzODYwMzM2ODY=","number":8913,"title":"Build of NUCLEO_F030R8 fails when DEVICE_SERIAL=0","user":{"login":"deece","id":1862055,"node_id":"MDQ6VXNlcjE4NjIwNTU=","avatar_url":"https://avatars3.githubusercontent.com/u/1862055?v=4","gravatar_id":"","url":"https://api.github.com/users/deece","html_url":"https://github.com/deece","followers_url":"https://api.github.com/users/deece/followers","following_url":"https://api.github.com/users/deece/following{/other_user}","gists_url":"https://api.github.com/users/deece/gists{/gist_id}","starred_url":"https://api.github.com/users/deece/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deece/subscriptions","organizations_url":"https://api.github.com/users/deece/orgs","repos_url":"https://api.github.com/users/deece/repos","events_url":"https://api.github.com/users/deece/events{/privacy}","received_events_url":"https://api.github.com/users/deece/received_events","type":"User","site_admin":false},"labels":[{"id":1075658157,"node_id":"MDU6TGFiZWwxMDc1NjU4MTU3","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/Jira%20status:%20OPEN","name":"Jira status: OPEN","color":"f9d0c4","default":false},{"id":427713129,"node_id":"MDU6TGFiZWw0Mjc3MTMxMjk=","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/mirrored","name":"mirrored","color":"ededed","default":false},{"id":28847979,"node_id":"MDU6TGFiZWwyODg0Nzk3OQ==","url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/type:%20bug","name":"type: bug","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-11-30T04:30:56Z","updated_at":"2018-12-05T08:54:54Z","closed_at":null,"author_association":"NONE","body":"### Description\r\nI 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.\r\n\r\nWhen passing these defines to tag`mbed-os-5.9.7` (I can't build master due to #8912), I get the following failure:\r\n\r\n```\r\n$ 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\r\n...\r\nCompile [ 28.8%]: RawSerial.cpp\r\nCompile: /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\r\n[Warning] <command-line>@0,0: \"DEVICE_STDIO_MESSAGES\" redefined\r\n[Warning] <command-line>@0,0: \"DEVICE_SERIAL\" redefined\r\n[Error] SerialBase.h@166,43: 'SerialIrq' has not been declared\r\n[Error] SerialBase.h@259,5: 'serial_t' does not name a type; did you mean 'serial_s'?\r\n[DEBUG] Return: 1\r\n[DEBUG] Output: <command-line>:0:0: warning: \"DEVICE_STDIO_MESSAGES\" redefined\r\n[DEBUG] Output: <command-line>:0:0: note: this is the location of the previous definition\r\n[DEBUG] Output: <command-line>:0:0: warning: \"DEVICE_SERIAL\" redefined\r\n[DEBUG] Output: <command-line>:0:0: note: this is the location of the previous definition\r\n[DEBUG] Output: In file included from /home/adsilva/src/mbed-os/BUILD/mbed/drivers/RawSerial.h:23:0,\r\n[DEBUG] Output:                  from /home/adsilva/src/mbed-os/drivers/RawSerial.cpp:16:\r\n[DEBUG] Output: /home/adsilva/src/mbed-os/BUILD/mbed/drivers/SerialBase.h:166:43: error: 'SerialIrq' has not been declared\r\n[DEBUG] Output:      static void _irq_handler(uint32_t id, SerialIrq irq_type);\r\n[DEBUG] Output:                                            ^~~~~~~~~\r\n[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'?\r\n[DEBUG] Output:      serial_t         _serial;\r\n[DEBUG] Output:      ^~~~~~~~\r\n[DEBUG] Output:      serial_s\r\nTraceback (most recent call last):\r\n  File \"build.py\", line 210, in <module>\r\n    notify=notifier,\r\n  File \"/home/adsilva/src/mbed-os/tools/build_api.py\", line 1083, in build_mbed_libs\r\n    library_incdirs + incdirs)\r\n  File \"/home/adsilva/src/mbed-os/tools/toolchains/__init__.py\", line 930, in compile_sources\r\n    return self.compile_queue(queue, objects)\r\n  File \"/home/adsilva/src/mbed-os/tools/toolchains/__init__.py\", line 993, in compile_queue\r\n    raise ToolException(err)\r\nToolException: <command-line>:0:0: warning: \"DEVICE_STDIO_MESSAGES\" redefined\r\n<command-line>:0:0: note: this is the location of the previous definition\r\n<command-line>:0:0: warning: \"DEVICE_SERIAL\" redefined\r\n<command-line>:0:0: note: this is the location of the previous definition\r\nIn file included from /home/adsilva/src/mbed-os/BUILD/mbed/drivers/RawSerial.h:23:0,\r\n                 from /home/adsilva/src/mbed-os/drivers/RawSerial.cpp:16:\r\n/home/adsilva/src/mbed-os/BUILD/mbed/drivers/SerialBase.h:166:43: error: 'SerialIrq' has not been declared\r\n     static void _irq_handler(uint32_t id, SerialIrq irq_type);\r\n                                           ^~~~~~~~~\r\n/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'?\r\n     serial_t         _serial;\r\n     ^~~~~~~~\r\n     serial_s\r\n```\r\n\r\n\r\n### Issue request type\r\n\r\n    [ ] Question\r\n    [ ] Enhancement\r\n    [X] Bug\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments/444407912","html_url":"https://github.com/ARMmbed/mbed-os/issues/8913#issuecomment-444407912","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/8913","id":444407912,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDQwNzkxMg==","user":{"login":"kjbracey-arm","id":11025917,"node_id":"MDQ6VXNlcjExMDI1OTE3","avatar_url":"https://avatars3.githubusercontent.com/u/11025917?v=4","gravatar_id":"","url":"https://api.github.com/users/kjbracey-arm","html_url":"https://github.com/kjbracey-arm","followers_url":"https://api.github.com/users/kjbracey-arm/followers","following_url":"https://api.github.com/users/kjbracey-arm/following{/other_user}","gists_url":"https://api.github.com/users/kjbracey-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/kjbracey-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjbracey-arm/subscriptions","organizations_url":"https://api.github.com/users/kjbracey-arm/orgs","repos_url":"https://api.github.com/users/kjbracey-arm/repos","events_url":"https://api.github.com/users/kjbracey-arm/events{/privacy}","received_events_url":"https://api.github.com/users/kjbracey-arm/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T08:54:54Z","updated_at":"2018-12-05T08:54:54Z","author_association":"CONTRIBUTOR","body":"I've never tried it myself, but I've read those docs and seen \"The Mbed OS tools now look for custom targets in a file named custom_targets.json in the root of an application and treat custom targets the same as Mbed targets.\"\r\n\r\nSo I believe you can put an entry in there that `\"inherits\"` a target in targets.json and removes the devices.\r\n\r\n> I do think there is some value in keeping things consistent though, Would we be better off making all DEVICE tests ifdefs instead?\r\n\r\nPossibly, yes.\r\n"}}
{"actor":{"display_login":"kjbracey-arm"}}