Using Qt Creator with msp430-gcc & msp-debug
-
Hello,
I am currently developing some projects with an MSP430 launchpad, and I am trying to use Qt Creator and qmake to generate the makefile.
However, I am running into issues because qmake attaches the build configuration of the current kit.
Here is my qmake include file for the current project:
#------------------------------------------------------------------------------- # Define MCU #------------------------------------------------------------------------------- MCU = MSP430G2553 DEFINES += __MSP430G2553__ #------------------------------------------------------------------------------- # Includes for different operating systems #------------------------------------------------------------------------------- macx* { MSP430_BIN = /opt/local/bin MPS430_LIB = /opt/local/msp430/lib MSP430_INC = /opt/local/msp430/include } #------------------------------------------------------------------------------- # Toolchain setup #------------------------------------------------------------------------------- CONFIG = "" UI_DIR = uic MOC_DIR = moc RCC_DIR = qrc OBJECTS_DIR = obj LFLAGS = -mmcu=$$MCU CFLAGS = -mmcu=$$MCU CXXFLAGS = -mmcu=$$MCU QMAKE_INCDIR = $$MSP430_INC QMAKE_LIBDIR = $$MSP430_LIB QMAKE_CC = $$MSP430_BIN/msp430-gcc QMAKE_CXX = $$MSP430_BIN/msp430-g++ QMAKE_LINK = $$MSP430_BIN/msp430-gcc QMAKE_CFLAGS = "" QMAKE_LFLAGS = "" QMAKE_CXXFLAGS = "" QMAKE_CFLAGS_DEBUG = $$CFLAGS QMAKE_LFLAGS_DEBUG = $$LFLAGS QMAKE_CFLAGS_RELEASE = $$CFLAGS QMAKE_LFLAGS_RELEASE = $$LFLAGS QMAKE_CXXFLAGS_DEBUG = $$CXXFLAGS QMAKE_CXXFLAGS_RELEASE = $$CXXFLAGS QMAKE_EXTRA_TARGETS = mspdebug rf2500 --force-reset 'prog $TARGET'
And the build output:
/Users/alex/Developer/Qt/5.13.0/clang_64/bin/qmake -o Makefile ../LED_Blink/LED_Blink.pro -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug /opt/local/bin/msp430-gcc -c -mmcu=MSP430G2553 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min= -fPIC -D__MSP430G2553__ -I../LED_Blink -I. -I/opt/local/msp430/include -I../../../../Developer/Qt/5.13.0/clang_64/mkspecs/macx-clang -o obj/main.o ../LED_Blink/src/main.c /opt/local/bin/msp430-gcc -c -mmcu=MSP430G2553 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min= -fPIC -D__MSP430G2553__ -I../LED_Blink -I. -I/opt/local/msp430/include -I../../../../Developer/Qt/5.13.0/clang_64/mkspecs/macx-clang -o obj/LED.o ../LED_Blink/src/LED.c msp430-gcc: error: x86_64: No such file or directory make: *** [obj/main.o] Error 1 make: *** Waiting for unfinished jobs.... msp430-gcc: error: x86_64: No such file or directory make: *** [obj/LED.o] Error 1 13:34:53: The process "/usr/bin/make" exited with code 2. Error while building/deploying project LED_Blink (kit: Desktop Qt 5.13.0 clang 64bit) When executing step "Make"
How can I make sure that the compiler only uses the build flags that I specified?
Thanks in advance!
-
I'm not sure that it is possible with qmake. But, you can try to use the next version of QtC (I hope, it is 4.11?). There are added new MSP430 architecture. You can use e.g. future QBS 1.15? instead of make, because I know that it will work. You even can take a look the baremetal examples, comes with that QBS. There are provided simple example for MSP430.
PS: Maybe, you also can use CMake instead of QBS, but I'm not sure.