This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

gcc options -mhwmult=32bit and -mhwmult=16bit produce malfunctioning binary for msp430fr6989

Other Parts Discussed in Thread: MSP430FR6989

Hello,

Datasheet msp430fr6989.pdf  mentions 32-Bit Hardware Multiplier (MPY) available.

However when the project is built with -mhwmult=32bit or -mhwmult=16bit, multiplications are not performed.

With option -mhwmult=f5series and -mhwmult=none project works as expected. Build log and malfunctioning binary are msp430fr.030.zipattached

build-log.txt
Using built-in specs.
COLLECT_GCC=msp430-elf-g++
Target: msp430-elf
Configured with: /opt/redhat/msp430-14r1-364/sources/tools/configure --host=i686-redhat-linux --build=i686-redhat-linux --target=msp430-elf --prefix=/opt/redhat/msp430-14r1-364/i686-redhat-linux --enable-languages=c,c++
Thread model: single
gcc version 4.9.1 20140707 (prerelease (msp430-14r1-364)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1) (GCC) 
COLLECT_GCC_OPTIONS='-I' '/opt/ti/gcc/include' '-I' '/home/eugene/workspace/cojson/include' '-I' '/home/eugene/workspace/cojson/src' '-I' '/home/eugene/workspace/cojson/test/tools' '-I' '/home/eugene/workspace/cojson/test/suites/include' '-D' 'COJSON_TEST_OMIT_NAMES' '-D' 'BENCH_DATA_ATTR=__attribute__((section(".text")))' '-mmcu=msp430fr6989' '-mhwmult=32bit' '-msmall' '-mcode-region=none' '-mdata-region=none' '-std=c++1y' '-v' '-Wall' '-Wpedantic' '-Os' '-fno-exceptions' '-fno-threadsafe-statics' '-fno-rtti' '-fno-use-cxa-atexit' '-fno-check-new' '-fsingle-precision-constant' '-ffunction-sections' '-fdata-sections' '-ffreestanding' '-c' '-o' 'msp430fr.o'
 /opt/ti/gcc/bin/../libexec/gcc/msp430-elf/4.9.1/cc1plus -quiet -v -I /opt/ti/gcc/include -I /home/eugene/workspace/cojson/include -I /home/eugene/workspace/cojson/src -I /home/eugene/workspace/cojson/test/tools -I /home/eugene/workspace/cojson/test/suites/include -imultilib 32mul -iprefix /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/ -D COJSON_TEST_OMIT_NAMES -D BENCH_DATA_ATTR=__attribute__((section(".text"))) /home/eugene/workspace/cojson/test/tools/msp430fr.cpp -quiet -dumpbase msp430fr.cpp -mmcu=msp430fr6989 -mhwmult=32bit -msmall -mcode-region=none -mdata-region=none -auxbase-strip msp430fr.o -Os -Wall -Wpedantic -std=c++1y -version -fno-exceptions -fno-threadsafe-statics -fno-rtti -fno-use-cxa-atexit -fno-check-new -fsingle-precision-constant -ffunction-sections -fdata-sections -ffreestanding -o /tmp/ccNdEmeB.s
GNU C++ (GCC) version 4.9.1 20140707 (prerelease (msp430-14r1-364)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1) (msp430-elf)
	compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-55), GMP version 5.0.1, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/sys-include"
ignoring duplicate directory "/opt/ti/gcc/bin/../lib/gcc/../../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include/c++/4.9.1"
ignoring duplicate directory "/opt/ti/gcc/bin/../lib/gcc/../../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include/c++/4.9.1/msp430-elf/32mul"
ignoring duplicate directory "/opt/ti/gcc/bin/../lib/gcc/../../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include/c++/4.9.1/backward"
ignoring duplicate directory "/opt/ti/gcc/bin/../lib/gcc/../../lib/gcc/msp430-elf/4.9.1/include"
ignoring duplicate directory "/opt/ti/gcc/bin/../lib/gcc/../../lib/gcc/msp430-elf/4.9.1/include-fixed"
ignoring nonexistent directory "/opt/ti/gcc/bin/../lib/gcc/../../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/sys-include"
ignoring duplicate directory "/opt/ti/gcc/bin/../lib/gcc/../../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/ti/gcc/include
 /home/eugene/workspace/cojson/include
 /home/eugene/workspace/cojson/src
 /home/eugene/workspace/cojson/test/tools
 /home/eugene/workspace/cojson/test/suites/include
 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include/c++/4.9.1
 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include/c++/4.9.1/msp430-elf/32mul
 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include/c++/4.9.1/backward
 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/include
 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/include-fixed
 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/include
End of search list.
GNU C++ (GCC) version 4.9.1 20140707 (prerelease (msp430-14r1-364)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1) (msp430-elf)
	compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-55), GMP version 5.0.1, MPFR version 3.1.0, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 1a1fed4172c6cd7daa4ff072f27c6f2a
COLLECT_GCC_OPTIONS='-I' '/opt/ti/gcc/include' '-I' '/home/eugene/workspace/cojson/include' '-I' '/home/eugene/workspace/cojson/src' '-I' '/home/eugene/workspace/cojson/test/tools' '-I' '/home/eugene/workspace/cojson/test/suites/include' '-D' 'COJSON_TEST_OMIT_NAMES' '-D' 'BENCH_DATA_ATTR=__attribute__((section(".text")))' '-mmcu=msp430fr6989' '-mhwmult=32bit' '-msmall' '-mcode-region=none' '-mdata-region=none' '-std=c++1y' '-v' '-Wall' '-Wpedantic' '-Os' '-fno-exceptions' '-fno-threadsafe-statics' '-fno-rtti' '-fno-use-cxa-atexit' '-fno-check-new' '-fsingle-precision-constant' '-ffunction-sections' '-fdata-sections' '-ffreestanding' '-c' '-o' 'msp430fr.o'
 /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/bin/as -v -I /opt/ti/gcc/include -I /home/eugene/workspace/cojson/include -I /home/eugene/workspace/cojson/src -I /home/eugene/workspace/cojson/test/tools -I /home/eugene/workspace/cojson/test/suites/include -mP -mmcu=msp430fr6989 -md -gdwarf-sections -o msp430fr.o /tmp/ccNdEmeB.s
GNU assembler version 2.24.51 (msp430-elf) using BFD version (GNU Binutils) 2.24.51.20140505
COMPILER_PATH=/opt/ti/gcc/bin/../libexec/gcc/msp430-elf/4.9.1/:/opt/ti/gcc/bin/../libexec/gcc/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/bin/
LIBRARY_PATH=/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/32mul/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/32mul/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/:/opt/ti/gcc/bin/../lib/gcc/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/
COLLECT_GCC_OPTIONS='-I' '/opt/ti/gcc/include' '-I' '/home/eugene/workspace/cojson/include' '-I' '/home/eugene/workspace/cojson/src' '-I' '/home/eugene/workspace/cojson/test/tools' '-I' '/home/eugene/workspace/cojson/test/suites/include' '-D' 'COJSON_TEST_OMIT_NAMES' '-D' 'BENCH_DATA_ATTR=__attribute__((section(".text")))' '-mmcu=msp430fr6989' '-mhwmult=32bit' '-msmall' '-mcode-region=none' '-mdata-region=none' '-std=c++1y' '-v' '-Wall' '-Wpedantic' '-Os' '-fno-exceptions' '-fno-threadsafe-statics' '-fno-rtti' '-fno-use-cxa-atexit' '-fno-check-new' '-fsingle-precision-constant' '-ffunction-sections' '-fdata-sections' '-ffreestanding' '-c' '-o' 'msp430fr.o'
Using built-in specs.
COLLECT_GCC=msp430-elf-g++
COLLECT_LTO_WRAPPER=/opt/ti/gcc/bin/../libexec/gcc/msp430-elf/4.9.1/lto-wrapper
Target: msp430-elf
Configured with: /opt/redhat/msp430-14r1-364/sources/tools/configure --host=i686-redhat-linux --build=i686-redhat-linux --target=msp430-elf --prefix=/opt/redhat/msp430-14r1-364/i686-redhat-linux --enable-languages=c,c++
Thread model: single
gcc version 4.9.1 20140707 (prerelease (msp430-14r1-364)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1) (GCC) 
COMPILER_PATH=/opt/ti/gcc/bin/../libexec/gcc/msp430-elf/4.9.1/:/opt/ti/gcc/bin/../libexec/gcc/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/bin/
LIBRARY_PATH=/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/32mul/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/32mul/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/:/opt/ti/gcc/bin/../lib/gcc/:/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/
COLLECT_GCC_OPTIONS='-I' '/opt/ti/gcc/include' '-I' '/home/eugene/workspace/cojson/include' '-I' '/home/eugene/workspace/cojson/src' '-I' '/home/eugene/workspace/cojson/test/tools' '-I' '/home/eugene/workspace/cojson/test/suites/include' '-D' 'COJSON_TEST_OMIT_NAMES' '-D' 'BENCH_DATA_ATTR=__attribute__((section(".text")))' '-mmcu=msp430fr6989' '-mhwmult=32bit' '-msmall' '-mcode-region=none' '-mdata-region=none' '-std=c++1y' '-v' '-Wall' '-Wpedantic' '-Os' '-fno-exceptions' '-fno-threadsafe-statics' '-fno-rtti' '-fno-use-cxa-atexit' '-fno-check-new' '-fsingle-precision-constant' '-ffunction-sections' '-fdata-sections' '-ffreestanding' '-o' '/home/eugene/workspace/cojson/test/bin/msp430fr.030.elf'
 /opt/ti/gcc/bin/../libexec/gcc/msp430-elf/4.9.1/collect2 -plugin /opt/ti/gcc/bin/../libexec/gcc/msp430-elf/4.9.1/liblto_plugin.so -plugin-opt=/opt/ti/gcc/bin/../libexec/gcc/msp430-elf/4.9.1/lto-wrapper -plugin-opt=-fresolution=/tmp/cchvmZuX.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lcrt -plugin-opt=-pass-through=-lnosys -plugin-opt=-pass-through=-lgcc -o /home/eugene/workspace/cojson/test/bin/msp430fr.030.elf /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/32mul/crt0.o /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/32mul/crtbegin.o -L/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/32mul -L/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/32mul -L/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1 -L/opt/ti/gcc/bin/../lib/gcc -L/opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib --gc-sections -s -relax -L/opt/ti/gcc/include -Map /home/eugene/workspace/cojson/test/bin/msp430fr.030.elf.map common.o cojson.o cojson_libdep.o chartypetable.o msp430cppfix.o msp430.o msp430fr.o 030.o -lstdc++ -lm -lgcc --start-group -lc -lgcc -lcrt -lnosys --end-group --script=msp430fr6989.ld -lgcc /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/32mul/crtend.o /opt/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/lib/32mul/crtn.o -lgcc

  • Your device only supports the f5series HW multiply.  Building with no HW multiply works because the multiplies are inefficiently done in SW.  Building with 32bit or 16bit fails because your device doesn't support it. 

    Please see the MSP430 GCC manual.  Search for the options -mmcu and -mhwmult.  You'll see that the best thing to do is not specify -mhwmult at all, and let the compiler choose it for based on your -mmcu option.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for clarification. Though it's still not clear what the datasheet means:

    SLAS789B –JUNE 2014–REVISED MARCH 2015
    MSP430FR698x(1), MSP430FR598x(1) Mixed-Signal Microcontrollers
    ...
    Intelligent Digital Peripherals:
    – 32-Bit Hardware Multiplier (MPY)