Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 10 months ago.
Mbed cli hides error messages from gcc if compiler process does not finish
I was able to gat the command line build to get stuck and finally die. The root cause for this was a circular include in my (autogenerated) code. During build process mbed cli hides the error messages from gcc tolchain, so at first I wasn't able to figure out why the build never finishes, even adding the -vv option didi not give any useful information.
$ mbed compile -DPB_FIELD_16BIT -vv
WARNING: MBED_GCC_ARM_PATH set as environment variable but doesn't exist
Building project ambit-client-lib (NUCLEO_F429ZI, GCC_ARM)
Scan: .
Scan: env
Scan: mbed
Scan: FEATURE_LWIP
[DEBUG] Macros: -DDEVICE_SPISLAVE=1 -DFEATURE_LWIP=1 -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -D__FPU_PRESENT=1 -DTRANSACTION_QUEUE_SIZE_SPI=2 -DUSBHOST_OTHER -DDEVICE_PORTINOUT=1 -DTARGET_RTOS_M4_M7 -DTARGET_NUCLEO_F429ZI -DDEVICE_LOWPOWERTIMER=1 -DDEVICE_RTC=1 -DTOOLCHAIN_object -DTARGET_STM32F4 -D__CMSIS_RTOS -DPB_FIELD_16BIT -DTARGET_FLASH_CMSIS_ALGO -DTOOLCHAIN_GCC -DDEVICE_CAN=1 -DTARGET_CORTEX_M -DDEVICE_I2C_ASYNCH=1 -DTARGET_LIKE_CORTEX_M4 -DDEVICE_ANALOGOUT=1 -DTARGET_M4 -DTARGET_UVISOR_UNSUPPORTED -DDEVICE_PORTOUT=1 -DDEVICE_SPI_ASYNCH=1 -DDEVICE_PWMOUT=1 -DDEVICE_INTERRUPTIN=1 -DTARGET_STM32F429xx -DDEVICE_I2C=1 -DTARGET_STM32F429 -D__CORTEX_M4 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_FAMILY_STM32 -DMBED_BUILD_TIMESTAMP=1550155240.58 -DTARGET_FF_ARDUINO -DDEVICE_PORTIN=1 -DTARGET_RELEASE -DTARGET_STM -DDEVICE_SERIAL_FC=1 -DDEVICE_TRNG=1 -DTARGET_LIKE_MBED -DTARGET_STM32F429ZI -D__MBED_CMSIS_RTOS_CM -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DUSB_STM_HAL -DDEVICE_ERROR_RED=1 -DTARGET_STM32F429xI -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_FLASH=1 -DARM_MATH_CM4
Exception in thread Thread-2:
Traceback (most recent call last):
File "c:\python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "c:\python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "c:\python27\lib\subprocess.py", line 699, in _readerthread
buffer.append(fh.read())
MemoryError
Finally I checked the running processes with Process Explorer https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer, and ran the build command manually. Then I was able to see the actual error message and fix the problem.
$ "C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\bin\arm-none-eabi-gcc.exe" -std=gnu99 -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 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -DDEVICE_SPI=1 -DFEATURE_LWIP=1 -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -D__FPU_PRESENT=1 -DTRANSACTION_QUEUE_SIZE_SPI=2 -DUSBHOST_OTHER -DDEVICE_PORTINOUT=1 -DTARGET_RTOS_M4_M7 -DTARGET_NUCLEO_F429ZI -DDEVICE_LOWPOWERTIMER=1 -DDEVICE_RTC=1 -DTOOLCHAIN_object -DTARGET_STM32F4 -D__CMSIS_RTOS -DPB_FIELD_16BIT -DDEVICE_SPISLAVE=1 -DTARGET_FLASH_CMSIS_ALGO -DTOOLCHAIN_GCC -DMBED_BUILD_TIMESTAMP=1550154069.71 -DTARGET_CORTEX_M -DDEVICE_I2C_ASYNCH=1 -DTARGET_LIKE_CORTEX_M4 -DDEVICE_ANALOGOUT=1 -DTARGET_M4 -DTARGET_UVISOR_UNSUPPORTED -DDEVICE_PORTOUT=1 -DDEVICE_SPI_ASYNCH=1 -DDEVICE_PWMOUT=1 -DDEVICE_INTERRUPTIN=1 -DTARGET_STM32F429xx -DDEVICE_I2C=1 -DTARGET_STM32F429 -D__CORTEX_M4 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_FAMILY_STM32 -DTARGET_FF_ARDUINO -DDEVICE_PORTIN=1 -DTARGET_RELEASE -DTARGET_STM -DDEVICE_SERIAL_FC=1 -DDEVICE_TRNG=1 -DTARGET_LIKE_MBED -DTARGET_STM32F429ZI -D__MBED_CMSIS_RTOS_CM -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_CAN=1 -DUSB_STM_HAL -DDEVICE_ERROR_RED=1 -DTARGET_STM32F429xI -DDEVICE_ANALOGIN=1 -DDEVICE_SERIAL=1 -DDEVICE_FLASH=1 -DARM_MATH_CM4 @.\BUILD\NUCLEO_F429ZI\GCC_ARM\.includes_373909758ae13b993fd462229f3b7337.txt -include .\BUILD\NUCLEO_F429ZI\GCC_ARM\mbed_config.h -MD -MF .\BUILD\NUCLEO_F429ZI\GCC_ARM\yyyyy\src\xxxxx.d -o .\BUILD\NUCLEO_F429ZI\GCC_ARM\yyyyy\src\xxxxx.o .\yyyyy\src\xxxxx.c
.
.
.
In file included from ./yyyyy/src/xxxxx.c:2:0,
from ./yyyyy/src/xxxxx.c:3,
from ./yyyyy/src/xxxxx.c:3,
.
.
.
from ./yyyyy/src/xxxxx.c:2,
from ./yyyyy/src/xxxxx.c:2,
from ./yyyyy/src/xxxxx.c:2:
./yyyyy/src/xxxxx.c:1:33: error: #include nested too deeply
#include "xxxxx.h"
^
./yyyyy/src/xxxxx.c:2:33: error: #include nested too deeply
#include "xxxxx.c"
^
./yyyyy/src/xxxxx.c:3:33: error: #include nested too deeply
#include "xxxxx.c"
I think it would be good to see these error messages from mbed-cli output. Not sure why it is not shown like some other compiler error messagess, maybe it has something to do how the compiler process is invoked from python, and also the fact the compiler process never finishes in this case. ATM Im not able to debug this further or propose any fixes, but maybe this information will help someone.
BTW, running on win7, bash, latest release of mbed cli.