Braids braids_bootloader hex Compilation error

I’m attempting to compile the braids bootloader hex file… I’m getting the following though: I was able to compile the .wav format firmware. pyserial is installed, Something is going on though, not sure if it’s error on my end or a problem with the code. Assistance would be awesome!

ccohen@devubuntu:~/BRAIDS/eurorack$ make -f braids/bootloader/makefile hex
/home/ccohen/arm-cs-tools/bin/arm-none-eabi-g++ -c -g -O2 -Wall -Werror -fasm -finline -finline-functions-called-once -fdata-sections -ffunction-sections -fno-unroll-loops -fshort-enums -fno-move-loop-invariants -I. -DGCC_ARMCM3 -DSTM32F10X_MD -DNO_APPLICATION -DF_CPU=72000000L -DF_CRYSTAL=8000000L -DUSE_STDPERIPH_DRIVER -DSYSCLK_FREQ_72MHz=72000000L -Istmlib/third_party/STM -Istmlib/third_party/STM/CMSIS/CM3_f10x -Istmlib/third_party/STM/CMSIS/CM3_f10x/startup/gcc -Istmlib/third_party/STM/STM32F10x_StdPeriph_Driver/inc -mcpu=cortex-m3 -mthumb -fno-exceptions -fno-rtti braids/bootloader/bootloader.cc -o build/braids_bootloader/bootloader.o
braids/bootloader/bootloader.cc:53:8: error: ‘braids::System system’ redeclared as different kind of symbol
In file included from /home/ccohen/arm-cs-tools/lib/gcc/arm-none-eabi/4.7.3/…/…/…/…/arm-none-eabi/include/c++/4.7.3/cstdlib:66:0,
from /home/ccohen/arm-cs-tools/lib/gcc/arm-none-eabi/4.7.3/…/…/…/…/arm-none-eabi/include/c++/4.7.3/bits/stl_algo.h:61,
from /home/ccohen/arm-cs-tools/lib/gcc/arm-none-eabi/4.7.3/…/…/…/…/arm-none-eabi/include/c++/4.7.3/algorithm:63,
from ./stmlib/utils/ring_buffer.h:33,
from braids/bootloader/bootloader.cc:29:
/home/ccohen/arm-cs-tools/lib/gcc/arm-none-eabi/4.7.3/…/…/…/…/arm-none-eabi/include/stdlib.h:150:5: error: previous declaration of 'int system(const char*)'
braids/bootloader/bootloader.cc: In function ‘void Init()’:
braids/bootloader/bootloader.cc:147:10: error: request for member ‘Init’ in ‘system’, which is of non-class type 'int(const char*)'
braids/bootloader/bootloader.cc:152:10: error: request for member ‘StartTimers’ in ‘system’, which is of non-class type 'int(const char*)'
make: ***** [build/braids_bootloader/bootloader.o] Error 1

Maybe I’m reading this wrong, but it looks like you have gcc version 4.7.3? I know that in order to develop for Shruthi, you need avr-gcc version 4.3.3 – I’m not sure if that is also necessary for Braids.

I’m using gcc version 4.8.1 on Ubuntu 13.10 It looksl ike those libraries were compiled with 4.7.3 but those were downloaded and are the arm-cs-tools…do i need the gcc for arm? I could downgrade gcc if needed… do i need to have gcc-avr installed?

I’ve seen the problem before, it looks like depending on the version/installation, some header which declares “system” is included by default or not, causing a name conflict.

Simply rename all instances of “system” by “sys” or whatever in braids.cc

Also, this was fixed some time ago, so please git pull.

I downloaded to 4.7 still same problem…

What’s the problem with 4.8.1?

This source was pulled late last night, and is updated

Ah, it’s in the bootloader, not in the main braids.cc file! Fixed.

ok i see you just updated it…just pulled new source…awesome compiles now

will give this a go and see if i can get the firmware to upload via the ARM-USB-OCD-H

Hrm…the firmware looks to be the same, I had it on 1.5, looks like it wrote it…did this work? What do you make of this? Suggestions?

make -f braids/makefile upload_combo_jtag
cat build/braids/braids.hex build/braids_bootloader/braids_bootloader.hex | \\
awk -f stmlib/programming/merge_hex.awk > build/braids/braids_bootloader_combo.hex
/home/ccohen/arm-cs-tools/bin/arm-none-eabi-objcopy -I ihex -O binary build/braids/braids_bootloader_combo.hex build/braids/braids_bootloader_combo.bin
openocd -f stmlib/programming/jtag/interface.cfg -f stmlib/programming/jtag/stm32f10x.cfg -f stmlib/programming/jtag/prelude_f10x.cfg -f stmlib/programming/jtag/erase_f10x.cfg -c “flash write_bank 0 build/braids/braids_bootloader_combo.bin 0x0” -c “verify_image build/braids/braids_bootloader_combo.bin” -f stmlib/programming/jtag/postlude.cfg || openocd -f stmlib/programming/jtag/interface.cfg -f stmlib/programming/jtag/stm32f10x.cfg -f stmlib/programming/jtag/prelude_f10x.cfg -f stmlib/programming/jtag/erase_f10x.cfg -c “flash write_bank 0 build/braids/braids_bootloader_combo.bin 0x0” -c “verify_image build/braids/braids_bootloader_combo.bin” -f stmlib/programming/jtag/postlude.cfg
Open On-Chip Debugger 0.7.0 (2013-05-15-17:28)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag’
DEPRECATED! use ‘adapter_khz’ not 'jtag_khz’
adapter speed: 1000 kHz
DEPRECATED! use ‘adapter_nsrst_delay’ not 'jtag_nsrst_delay’
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Warn : target name is deprecated use: 'cortex_m’
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway…
Error: stm32.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0 in JTAG-DP transaction
Polling target stm32.cpu failed, GDB will be halted. Polling again in 100ms
Polling target stm32.cpu failed, GDB will be halted. Polling again in 300ms
Error: Target not examined yet
Runtime Error: stmlib/programming/jtag/prelude_f10x.cfg:25:
in procedure 'script’
at file “embedded:startup.tcl”, line 58
in procedure ‘halt’ called at file “stmlib/programming/jtag/prelude_f10x.cfg”, line 25
Open On-Chip Debugger 0.7.0 (2013-05-15-17:28)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag’
DEPRECATED! use ‘adapter_khz’ not 'jtag_khz’
adapter speed: 1000 kHz
DEPRECATED! use ‘adapter_nsrst_delay’ not 'jtag_nsrst_delay’
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Warn : target name is deprecated use: 'cortex_m’
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway…
Error: stm32.cpu: IR capture error; saw 0x00 not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0 in JTAG-DP transaction
Polling target stm32.cpu failed, GDB will be halted. Polling again in 100ms
Polling target stm32.cpu failed, GDB will be halted. Polling again in 300ms
Error: Target not examined yet
Runtime Error: stmlib/programming/jtag/prelude_f10x.cfg:25:
in procedure 'script’
at file “embedded:startup.tcl”, line 58
in procedure ‘halt’ called at file “stmlib/programming/jtag/prelude_f10x.cfg”, line 25
make: ***** [upload_combo_jtag] Error 1
ccohen@devubuntu:~/BRAIDS/eurorack$ make -f braids/makefile upload_combo_jtag
cat build/braids/analog_oscillator.d build/braids/braids.d build/braids/digital_oscillator.d build/braids/macro_oscillator.d build/braids/resources.d build/braids/settings.d build/braids/ui.d build/braids/adc.d build/braids/dac.d build/braids/debug_pin.d build/braids/display.d build/braids/encoder.d build/braids/gate_input.d build/braids/system.d build/braids/uart_logger.d build/braids/random.d build/braids/bootloader_utils.d build/braids/system_clock.d build/braids/core_cm3.d build/braids/system_stm32f10x.d build/braids/misc.d build/braids/stm32f10x_adc.d build/braids/stm32f10x_bkp.d build/braids/stm32f10x_can.d build/braids/stm32f10x_crc.d build/braids/stm32f10x_dac.d build/braids/stm32f10x_dbgmcu.d build/braids/stm32f10x_dma.d build/braids/stm32f10x_exti.d build/braids/stm32f10x_flash.d build/braids/stm32f10x_fsmc.d build/braids/stm32f10x_gpio.d build/braids/stm32f10x_i2c.d build/braids/stm32f10x_iwdg.d build/braids/stm32f10x_pwr.d build/braids/stm32f10x_rcc.d build/braids/stm32f10x_rtc.d build/braids/stm32f10x_sdio.d build/braids/stm32f10x_spi.d build/braids/stm32f10x_tim.d build/braids/stm32f10x_usart.d build/braids/stm32f10x_wwdg.d build/braids/startup_stm32f10x_md.d > build/braids/depends.mk
openocd -f stmlib/programming/jtag/interface.cfg -f stmlib/programming/jtag/stm32f10x.cfg -f stmlib/programming/jtag/prelude_f10x.cfg -f stmlib/programming/jtag/erase_f10x.cfg -c “flash write_bank 0 build/braids/braids_bootloader_combo.bin 0x0” -c “verify_image build/braids/braids_bootloader_combo.bin” -f stmlib/programming/jtag/postlude.cfg || openocd -f stmlib/programming/jtag/interface.cfg -f stmlib/programming/jtag/stm32f10x.cfg -f stmlib/programming/jtag/prelude_f10x.cfg -f stmlib/programming/jtag/erase_f10x.cfg -c “flash write_bank 0 build/braids/braids_bootloader_combo.bin 0x0” -c “verify_image build/braids/braids_bootloader_combo.bin” -f stmlib/programming/jtag/postlude.cfg
Open On-Chip Debugger 0.7.0 (2013-05-15-17:28)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag’
DEPRECATED! use ‘adapter_khz’ not 'jtag_khz’
adapter speed: 1000 kHz
DEPRECATED! use ‘adapter_nsrst_delay’ not 'jtag_nsrst_delay’
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Warn : target name is deprecated use: 'cortex_m’
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
target state: halted
target halted due to debug-request, current mode: Handler External Interrupt(25)
xPSR: 0x01000029 pc: 0x08004c94 msp: 0x20000480
Info : device id = 0x20036410
Info : ignoring flash probed value, using configured bank size
Info : flash size = 128kbytes
stm32x mass erase complete
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Error: stm32.cpu – clearing lockup after double fault
target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffdc
Polling target stm32.cpu failed, GDB will be halted. Polling again in 100ms
Polling target stm32.cpu succeeded again
wrote 121672 bytes from file build/braids/braids_bootloader_combo.bin to flash bank 0 at offset 0x00000000 in 4.018419s (29.569 KiB/s)
verified 121672 bytes in 1.945360s (61.079 KiB/s)
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
shutdown command invoked

Looks good.