Hi all,
I'm trying to build firmware for Rowetel's SM1000 smart microphone,
which is based around the STM32F4 microcontroller.
http://www.rowetel.com/blog/?page_id=3902
The device is basically a digital voice modem for radio communications,
the firmware implements code that encodes and decodes audio into Codec2
format and modulating that for transmission via HF radio. It needs
hardware floating point to work.
I *had* thought `crossdev -t arm-none-eabi` would be sufficient for
this, but imagine my surprise when I received this error:
> arm-none-eabi-gcc -std=gnu99 -O0 -g -Wall -Tstm32_flash.ld -DSTM32F40_41xxx -DCORTEX_M4 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 -DUSE_STDPERIPH_DRIVER -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/inc -ISTM32F4xx_DSP_StdPeriph_Lib/Project/STM32F4xx_StdPeriph_Templates -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Include -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Device/ST/STM32F4xx/Include -DARM_MATH_CM4 -D__EMBEDDED__ -I../src -I../unittest -Iinc -Iusb_conf -Iusb_lib/cdc -Iusb_lib/core -Iusb_lib/otg -c -o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
> arm-none-eabi-gcc -std=gnu99 -O0 -g -Wall -Tstm32_flash.ld -DSTM32F40_41xxx -DCORTEX_M4 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 -DUSE_STDPERIPH_DRIVER -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/inc -ISTM32F4xx_DSP_StdPeriph_Lib/Project/STM32F4xx_StdPeriph_Templates -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Include -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Device/ST/STM32F4xx/Include -DARM_MATH_CM4 -D__EMBEDDED__ -I../src -I../unittest -Iinc -Iusb_conf -Iusb_lib/cdc -Iusb_lib/core -Iusb_lib/otg -c -o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.c
> find STM32F4xx_DSP_StdPeriph_Lib -type f -name '*.o' -exec ar crs libstm32f4.a {} ";"
> arm-none-eabi-gcc -std=gnu99 -O0 -g -Wall -Tstm32_flash.ld -DSTM32F40_41xxx -DCORTEX_M4 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 -DUSE_STDPERIPH_DRIVER -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/inc -ISTM32F4xx_DSP_StdPeriph_Lib/Project/STM32F4xx_StdPeriph_Templates -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Include -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Device/ST/STM32F4xx/Include -DARM_MATH_CM4 -D__EMBEDDED__ -I../src -I../unittest -Iinc -Iusb_conf -Iusb_lib/cdc -Iusb_lib/core -Iusb_lib/otg -DPROFILE src/codec2_profile.c src/gdb_stdio.c src/stm32f4_machdep.c src/startup_stm32f4xx.s src/init.c src/system_stm32f4xx.c ../src/lpc.c ../src/nlp.c ../src/postfilter.c ../src/sine.c ../src/codec2.c ../src/kiss_fft.c ../src/interp.c ../src/lsp.c ../src/phase.c ../src/quantise.c ../src/pack.c ../src/codebook.c ../
s
rc/codebookd.c ../src/codebookjvm.c ../src/codebookge.c ../src/dump.c ../src/fdmdv.c ../src/freedv_api.c ../src/varicode.c ../src/golay23.c -o codec2_profile.elf libstm32f4.a -lg -lnosys -lm
> ../src/freedv_api.c: In function ‘freedv_comptx’:
> ../src/freedv_api.c:260:46: warning: unused variable ‘nspare’ [-Wunused-variable]
> int data, codeword1, data_flag_index, nspare;
> ^
> ../src/freedv_api.c:258:29: warning: unused variable ‘k’ [-Wunused-variable]
> int bit, byte, i, j, k;
> ^
> ../src/freedv_api.c: In function ‘freedv_comprx’:
> ../src/freedv_api.c:516:77: warning: unused variable ‘nspare’ [-Wunused-variable]
> int recd_codeword, codeword1, data_flag_index, n_ascii, nspare;
> ^
> ../src/freedv_api.c:515:58: warning: unused variable ‘k’ [-Wunused-variable]
> int i, j, bit, byte, nin_prev, nout, k;
> ^
> /usr/libexec/gcc/arm-none-eabi/ld: error: codec2_profile.elf uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-assert.o) does not
> /usr/libexec/gcc/arm-none-eabi/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-assert.o)
> /usr/libexec/gcc/arm-none-eabi/ld: error: codec2_profile.elf uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-exit.o) does not
> /usr/libexec/gcc/arm-none-eabi/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-exit.o)
Okay, so I read that as "newlib has been built using softfloat". No
matter. I thought maybe I can coax a hardfloat toolchain out by
manipulation of the target.
When I try `crossdev -t arm-hardfloat-eabi` (as clearly "none" gave me a
softfloat one) I got this building gcc at stage 1.
> configure:3389: /tmp/portage/cross-arm-hardfloat-eabi/gcc-4.9.3/work/build/./gcc/xgcc -B/tmp/portage/cross-arm-hardfloat-eabi/gcc-4.9.3/work/build/./gcc/
> -B/usr/arm-hardfloat-eabi/bin/ -B/usr/arm-hardfloat-eabi/lib/ -isystem /usr/arm-hardfloat-eabi/include -isystem /usr/arm-hardfloat-eabi/sys-include -mt
> humb -o conftest -g -O2 -pipe conftest.c >&5
> conftest.c: In function 'main':
> conftest.c:12:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
> {
Now, there's an option to pass in ABIs to crossdev, and for the default
one to be identified. Question is, where can I find what the ABIs are
called?
--
Stuart Longland (aka Redhatter, VK4MSL)
I haven't lost my mind...
...it's backed up on a tape somewhere.
I'm trying to build firmware for Rowetel's SM1000 smart microphone,
which is based around the STM32F4 microcontroller.
http://www.rowetel.com/blog/?page_id=3902
The device is basically a digital voice modem for radio communications,
the firmware implements code that encodes and decodes audio into Codec2
format and modulating that for transmission via HF radio. It needs
hardware floating point to work.
I *had* thought `crossdev -t arm-none-eabi` would be sufficient for
this, but imagine my surprise when I received this error:
> arm-none-eabi-gcc -std=gnu99 -O0 -g -Wall -Tstm32_flash.ld -DSTM32F40_41xxx -DCORTEX_M4 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 -DUSE_STDPERIPH_DRIVER -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/inc -ISTM32F4xx_DSP_StdPeriph_Lib/Project/STM32F4xx_StdPeriph_Templates -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Include -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Device/ST/STM32F4xx/Include -DARM_MATH_CM4 -D__EMBEDDED__ -I../src -I../unittest -Iinc -Iusb_conf -Iusb_lib/cdc -Iusb_lib/core -Iusb_lib/otg -c -o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
> arm-none-eabi-gcc -std=gnu99 -O0 -g -Wall -Tstm32_flash.ld -DSTM32F40_41xxx -DCORTEX_M4 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 -DUSE_STDPERIPH_DRIVER -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/inc -ISTM32F4xx_DSP_StdPeriph_Lib/Project/STM32F4xx_StdPeriph_Templates -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Include -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Device/ST/STM32F4xx/Include -DARM_MATH_CM4 -D__EMBEDDED__ -I../src -I../unittest -Iinc -Iusb_conf -Iusb_lib/cdc -Iusb_lib/core -Iusb_lib/otg -c -o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.o STM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_wwdg.c
> find STM32F4xx_DSP_StdPeriph_Lib -type f -name '*.o' -exec ar crs libstm32f4.a {} ";"
> arm-none-eabi-gcc -std=gnu99 -O0 -g -Wall -Tstm32_flash.ld -DSTM32F40_41xxx -DCORTEX_M4 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 -DUSE_STDPERIPH_DRIVER -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/STM32F4xx_StdPeriph_Driver/inc -ISTM32F4xx_DSP_StdPeriph_Lib/Project/STM32F4xx_StdPeriph_Templates -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Include -ISTM32F4xx_DSP_StdPeriph_Lib/Libraries/CMSIS/Device/ST/STM32F4xx/Include -DARM_MATH_CM4 -D__EMBEDDED__ -I../src -I../unittest -Iinc -Iusb_conf -Iusb_lib/cdc -Iusb_lib/core -Iusb_lib/otg -DPROFILE src/codec2_profile.c src/gdb_stdio.c src/stm32f4_machdep.c src/startup_stm32f4xx.s src/init.c src/system_stm32f4xx.c ../src/lpc.c ../src/nlp.c ../src/postfilter.c ../src/sine.c ../src/codec2.c ../src/kiss_fft.c ../src/interp.c ../src/lsp.c ../src/phase.c ../src/quantise.c ../src/pack.c ../src/codebook.c ../
s
rc/codebookd.c ../src/codebookjvm.c ../src/codebookge.c ../src/dump.c ../src/fdmdv.c ../src/freedv_api.c ../src/varicode.c ../src/golay23.c -o codec2_profile.elf libstm32f4.a -lg -lnosys -lm
> ../src/freedv_api.c: In function ‘freedv_comptx’:
> ../src/freedv_api.c:260:46: warning: unused variable ‘nspare’ [-Wunused-variable]
> int data, codeword1, data_flag_index, nspare;
> ^
> ../src/freedv_api.c:258:29: warning: unused variable ‘k’ [-Wunused-variable]
> int bit, byte, i, j, k;
> ^
> ../src/freedv_api.c: In function ‘freedv_comprx’:
> ../src/freedv_api.c:516:77: warning: unused variable ‘nspare’ [-Wunused-variable]
> int recd_codeword, codeword1, data_flag_index, n_ascii, nspare;
> ^
> ../src/freedv_api.c:515:58: warning: unused variable ‘k’ [-Wunused-variable]
> int i, j, bit, byte, nin_prev, nout, k;
> ^
> /usr/libexec/gcc/arm-none-eabi/ld: error: codec2_profile.elf uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-assert.o) does not
> /usr/libexec/gcc/arm-none-eabi/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-assert.o)
> /usr/libexec/gcc/arm-none-eabi/ld: error: codec2_profile.elf uses VFP register arguments, /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-exit.o) does not
> /usr/libexec/gcc/arm-none-eabi/ld: failed to merge target specific data of file /usr/lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libg.a(lib_a-exit.o)
Okay, so I read that as "newlib has been built using softfloat". No
matter. I thought maybe I can coax a hardfloat toolchain out by
manipulation of the target.
When I try `crossdev -t arm-hardfloat-eabi` (as clearly "none" gave me a
softfloat one) I got this building gcc at stage 1.
> configure:3389: /tmp/portage/cross-arm-hardfloat-eabi/gcc-4.9.3/work/build/./gcc/xgcc -B/tmp/portage/cross-arm-hardfloat-eabi/gcc-4.9.3/work/build/./gcc/
> -B/usr/arm-hardfloat-eabi/bin/ -B/usr/arm-hardfloat-eabi/lib/ -isystem /usr/arm-hardfloat-eabi/include -isystem /usr/arm-hardfloat-eabi/sys-include -mt
> humb -o conftest -g -O2 -pipe conftest.c >&5
> conftest.c: In function 'main':
> conftest.c:12:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
> {
Now, there's an option to pass in ABIs to crossdev, and for the default
one to be identified. Question is, where can I find what the ABIs are
called?
--
Stuart Longland (aka Redhatter, VK4MSL)
I haven't lost my mind...
...it's backed up on a tape somewhere.