# Sapog esc flashing

**URL:** <https://forum.zubax.com/t/sapog-esc-flashing/864>\
**Category:** Electric drives\
**Tags:** sapog\
**Created:** [January 31, 2018, 12:19pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864 "2018-01-31T12:19:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [January 31, 2018, 12:19pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/1 "2018-01-31T12:19:18Z")

</div>

Hello How could we flash the stm32 inside the sapog ESC?  
the command ./blackmagic\_flash.sh [portname] (/dev/ttyUSB0 in my case)  
is not making any result

---

<div class="post-metadata">

**Author:** ![pavel-kirienko](https://forum.zubax.com/user_avatar/forum.zubax.com/pavel-kirienko/32/180_2.png) [@pavel-kirienko](https://forum.zubax.com/u/pavel-kirienko)\
**Post date:** [January 31, 2018, 1:21pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/2 "2018-01-31T13:21:45Z")

</div>

Please describe what debugger are you using? The command you mentioned only works with [Dronecode Probe](https://kb.zubax.com/display/MAINKB/Dronecode+Probe+documentation) and Black Magic Probe adapters.

If you don’t have any of the above, you could use the embedded UAVCAN bootloader via the [UAVCAN GUI Tool](http://uavcan.org/GUI_Tool).

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [January 31, 2018, 3:44pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/3 "2018-01-31T15:44:49Z")

</div>

we tried to flash it with a simple FTTI adpater …

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [January 31, 2018, 3:47pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/4 "2018-01-31T15:47:50Z")

</div>

in our case we have a bare stm32 without any bootloader installed

---

<div class="post-metadata">

**Author:** ![pavel-kirienko](https://forum.zubax.com/user_avatar/forum.zubax.com/pavel-kirienko/32/180_2.png) [@pavel-kirienko](https://forum.zubax.com/u/pavel-kirienko)\
**Post date:** [January 31, 2018, 3:56pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/5 "2018-01-31T15:56:53Z")

</div>

Ah, sorry that won’t work, you need a debugger. I believe you can order a Dronecode Probe here [nicadrone.com](http://nicadrone.com/index.php?id_product=61&controller=product)

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 13, 2018, 12:55pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/6 "2018-02-13T12:55:14Z")

</div>

Thanks Pavel.  
Now with a Dronecode probe it is better, I am able to flash it.  
However, after flashing I’m not able to configure it with the serial interface. Do I have to update the source code somewhere to activate this interface?  
Thanks

---

<div class="post-metadata">

**Author:** ![pavel-kirienko](https://forum.zubax.com/user_avatar/forum.zubax.com/pavel-kirienko/32/180_2.png) [@pavel-kirienko](https://forum.zubax.com/u/pavel-kirienko)\
**Post date:** [February 13, 2018, 1:09pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/7 "2018-02-13T13:09:25Z")

</div>

The serial interface is always enabled. Make sure the hardware is functioning, the firmware is running, and the serial port settings are correct. The latter are provided at page 29 here [https://files.zubax.com/products/io.px4.sapog/Sapog\_v2\_Reference\_Manual.pdf](https://files.zubax.com/products/io.px4.sapog/Sapog_v2_Reference_Manual.pdf).

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 8:14am UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/8 "2018-02-14T08:14:46Z")

</div>

The hardware is an official orel 20 esc and was working before we flashed it.

what puzzles me is that in your hal definition file, neither CAN nor the UART are activated, is that normal?

#define HAL\_USE\_TM TRUE  
#define HAL\_USE\_PAL TRUE  
#define HAL\_USE\_ADC FALSE  
#define HAL\_USE\_CAN FALSE  
#define HAL\_USE\_DAC FALSE  
#define HAL\_USE\_EXT FALSE  
#define HAL\_USE\_GPT FALSE  
#define HAL\_USE\_I2C FALSE  
#define HAL\_USE\_I2S FALSE  
#define HAL\_USE\_ICU TRUE  
#define HAL\_USE\_MAC FALSE  
#define HAL\_USE\_MMC\_SPI FALSE  
#define HAL\_USE\_PWM FALSE  
#define HAL\_USE\_RTC FALSE  
#define HAL\_USE\_SDC FALSE  
#define HAL\_USE\_SERIAL TRUE  
#define HAL\_USE\_SERIAL\_USB FALSE  
#define HAL\_USE\_SPI FALSE  
#define HAL\_USE\_UART FALSE  
#define HAL\_USE\_USB FALSE  
#define HAL\_USE\_WDG FALSE

---

<div class="post-metadata">

**Author:** ![pavel-kirienko](https://forum.zubax.com/user_avatar/forum.zubax.com/pavel-kirienko/32/180_2.png) [@pavel-kirienko](https://forum.zubax.com/u/pavel-kirienko)\
**Post date:** [February 14, 2018, 8:26am UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/9 "2018-02-14T08:26:31Z")

</div>

Yes. In ChibiOS parlance, what we’re using is called SERIAL, not UART. The latter is a lower-level driver. CAN is provided by Libuavcan, which doesn’t need the abstractions provided by ChibiOS - it works directly with the hardware.

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 8:31am UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/10 "2018-02-14T08:31:54Z")

</div>

then why doen’t it work, when we flash it manually? Did we forgot a step?

---

<div class="post-metadata">

**Author:** ![pavel-kirienko](https://forum.zubax.com/user_avatar/forum.zubax.com/pavel-kirienko/32/180_2.png) [@pavel-kirienko](https://forum.zubax.com/u/pavel-kirienko)\
**Post date:** [February 14, 2018, 10:10am UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/11 "2018-02-14T10:10:40Z")

</div>

Please post here the full build output here after `make clean`, I’ll have a look. Also please submit the contents of your build directory after the build, and the output of the command that you use to flash the board.

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 1:46pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/12 "2018-02-14T13:46:37Z")

</div>

build output

```auto
philippe@philippe-MS-7641:~/sapog/firmware$ make clean

Cleaning
rm -fR .dep build

Done
philippe@philippe-MS-7641:~/sapog/firmware$ make RELEASE=1

Compiler Options
arm-none-eabi-gcc -c -mcpu=cortex-m3 -falign-functions=16 -U __STRICT_ANSI__ -fno-exceptions -fno-unwind-tables -fno-stack-protector -fno-builtin-printf -fno-builtin-fprintf -fno-builtin-vprintf -fno-builtin-vfprintf -fno-builtin-puts -u_port_lock -u_port_unlock -u_exit -u_kill -u_getpid -uchThdExit -u __errno -nodefaultlibs -lc -lgcc -lm -O2 -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-common -flto -std=c99 -Wshadow -Wpointer-arith -Wno-packed -Wno-attributes -Wno-error=undef -Wno-error=shadow -Werror -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/ -DCORTEX_VTOR_INIT=16384 -DCRT1_AREAS_NUMBER=0 -DCONFIG_PARAMS_MAX=50 -DRELEASE_BUILD=1 -DNDEBUG=1 -Dasm=__ asm -DCORTEX_USE_FPU=FALSE -DFW_VERSION_MAJOR=2 -DFW_VERSION_MINOR=2 -DHW_VERSION_MAJOR=1 -DNODE_NAME="io.px4.sapog" -DCONFIG_PARAM_MAX_NAME_LENGTH=16 -DUAVCAN_STM32_TIMER_NUMBER=7 -DUAVCAN_STM32_NUM_IFACES=2 -DUAVCAN_CPP_VERSION=UAVCAN_CPP11 -DUAVCAN_STM32_CHIBIOS=1 -DGIT_HASH=0x7719d6e -DSTDOUT_SD=SD1 -DSTDIN_SD=STDOUT_SD -DSERIAL_CLI_PORT_NUMBER=1 -DCORTEX_ENABLE_WFI_IDLE=1 -fno-single-precision-constant -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/build.d -I. -Izubax_chibios///chibios/os/rt/ports/ARMCMx -Izubax_chibios///chibios/os/rt/ports/ARMCMx/compilers/GCC -Izubax_chibios///chibios/os/rt/include -Izubax_chibios///chibios/os/hal/include -Izubax_chibios//chibios/os/hal/ports/common/ARMCMx -Izubax_chibios//chibios/os/hal/ports/STM32/STM32F1xx -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/CANv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/DACv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/DMAv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/EXTIv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/GPIOv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/I2Cv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/MACv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/OTGv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/RTCv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/SDIOv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/SPIv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/TIMv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/USARTv1 -Izubax_chibios//chibios/os/hal/ports/STM32/LLD/xWDGv1 -Izubax_chibios///chibios/os/various/cpp_wrappers -Izubax_chibios///chibios/os/common/ports/ARMCMx/compilers/GCC -Izubax_chibios///chibios/os/common/ports/ARMCMx/devices/STM32F1xx -Izubax_chibios///chibios/os/ext/CMSIS/include -Izubax_chibios///chibios/os/ext/CMSIS/ST/STM32F1xx -Izubax_chibios///chibios/os/hal/osal/rt -Izubax_chibios///chibios/os/various -Izubax_chibios///chibios/os/hal/lib/streams -Isrc -Isrc/os_config -Ilibuavcan/libuavcan/include -Ilibuavcan/libuavcan_drivers/stm32/driver/include/ -Idsdlc_generated -Izubax_chibios// main.c -o main.o

Compiling crt0_v7m.s
Compiling chcoreasm_v7m.s
Compiling motor.c
Compiling rpmctl.c
Compiling motor_adc.c
Compiling motor_rtctl.c
Compiling motor_pwm.c
Compiling motor_debug_cli.c
Compiling motor_forced_rotation_detection.c
Compiling motor_rtctl_test.c
Compiling motor_timer.c
Compiling crt1.c
Compiling vectors.c
Compiling chsys.c
Compiling chdebug.c
Compiling chvt.c
Compiling chschd.c
Compiling chthreads.c
Compiling chtm.c
Compiling chstats.c
Compiling chdynamic.c
Compiling chregistry.c
Compiling chsem.c
Compiling chmtx.c
Compiling chcond.c
Compiling chevents.c
Compiling chmsg.c
Compiling chmboxes.c
Compiling chqueues.c
Compiling chmemcore.c
Compiling chheap.c
Compiling chmempools.c
Compiling chcore.c
Compiling chcore_v7m.c
Compiling osal.c
Compiling hal.c
Compiling hal_buffers.c
Compiling hal_queues.c
Compiling hal_mmcsd.c
Compiling adc.c
Compiling can.c
Compiling dac.c
Compiling ext.c
Compiling gpt.c
Compiling i2c.c
Compiling i2s.c
Compiling icu.c
Compiling mac.c
Compiling mmc_spi.c
Compiling pal.c
Compiling pwm.c
Compiling rtc.c
Compiling sdc.c
Compiling serial.c
Compiling serial_usb.c
Compiling spi.c
Compiling st.c
Compiling uart.c
Compiling usb.c
Compiling wdg.c
Compiling nvic.c
Compiling hal_lld.c
Compiling adc_lld.c
Compiling ext_lld_isr.c
Compiling can_lld.c
Compiling dac_lld.c
Compiling stm32_dma.c
Compiling ext_lld.c
Compiling pal_lld.c
Compiling i2c_lld.c
Compiling mac_lld.c
Compiling usb_lld.c
Compiling rtc_lld.c
Compiling sdc_lld.c
Compiling spi_lld.c
Compiling gpt_lld.c
Compiling icu_lld.c
Compiling pwm_lld.c
Compiling st_lld.c
Compiling serial_lld.c
Compiling uart_lld.c
Compiling wdg_lld.c
Compiling syscalls.c
Compiling chprintf.c
Compiling memstreams.c
Compiling shell.c
Compiling pwm_input.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling temperature_sensor.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling console.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/console.cpp:47:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from /home/philippe/sapog/firmware/src/console.cpp:40:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling main.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/main.cpp:48:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from /home/philippe/sapog/firmware/src/main.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling indication_controller.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/indication_controller.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/indication_controller.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/indication_controller.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/indication_controller.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling bootloader_interface.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uavcan_node.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 92u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 92u>]':
/home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:115:13: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'bool uavcan::Array<T, ArrayMode, MaxSize_>::operator==(const char*) const [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 92u]':
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:822:87: required from 'bool uavcan::Array<T, ArrayMode, MaxSize_>::operator!=(const R&) const [with R = char [10]; T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 92u]'
/home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:293:61: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:810:10: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     bool operator==(const char* ch) const
          ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^

```

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 1:47pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/13 "2018-02-14T13:47:21Z")

</div>

```auto
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator+=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:694:23: required from 'uavcan::Array<T, ArrayMode, MaxSize_>::Array(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u]'
/home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:411:36: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:848:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator+=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 31u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 31u>]':
libuavcan/libuavcan/include/uavcan/protocol/logger.hpp:266:29: required from 'int uavcan::Logger::log(uavcan::Logger::LogLevel, const char*, const char*, Args ...) [with Args = {}; uavcan::Logger::LogLevel = unsigned char]'
libuavcan/libuavcan/include/uavcan/node/node.hpp:74:9: required from 'void uavcan::Node<MemPoolSize>::registerInternalFailure(const char*) [with unsigned int MemPoolSize = 7168u]'
/home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:600:1: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator+=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 90u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 90u>]':
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:916:21: required from 'void uavcan::Array<T, ArrayMode, MaxSize_>::appendFormatted(const char*, A) [with A = const char*; T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 90u]'
libuavcan/libuavcan/include/uavcan/marshal/char_array_formatter.hpp:66:9: required from 'void uavcan::CharArrayFormatter<ArrayType_>::writeValue(const char*) [with ArrayType_ = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 90u>]'
libuavcan/libuavcan/include/uavcan/marshal/char_array_formatter.hpp:81:24: required from 'void uavcan::CharArrayFormatter<ArrayType_>::write(const char*) [with ArrayType_ = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 90u>]'
libuavcan/libuavcan/include/uavcan/protocol/logger.hpp:269:13: required from 'int uavcan::Logger::log(uavcan::Logger::LogLevel, const char*, const char*, Args ...) [with Args = {}; uavcan::Logger::LogLevel = unsigned char]'
libuavcan/libuavcan/include/uavcan/node/node.hpp:74:9: required from 'void uavcan::Node<MemPoolSize>::registerInternalFailure(const char*) [with unsigned int MemPoolSize = 7168u]'
/home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:600:1: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:848:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator+=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/uavcan_node.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling esc_controller.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:7,
                 from /home/philippe/sapog/firmware/src/uavcan_node/esc_controller.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/esc_controller.cpp:35:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/uavcan_stm32.hpp:9,
                 from /home/philippe/sapog/firmware/src/uavcan_node/esc_controller.hpp:37,
                 from /home/philippe/sapog/firmware/src/uavcan_node/esc_controller.cpp:35:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling board.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling led.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_dispatcher.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_transfer_listener.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_frame.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_transfer_sender.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_transfer_receiver.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_can_acceptance_filter_configurator.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_crc.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_outgoing_transfer_registry.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_can_io.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_transfer_buffer.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_transfer.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_bit_array_copy.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_scalar_codec.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_bit_stream.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_float_spec.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_dynamic_node_id_client.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_node_status_provider.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_can.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_error.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_generic_subscriber.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_service_client.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_timer.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_generic_publisher.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_global_data_type_registry.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_scheduler.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_data_type.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_dynamic_memory.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling uc_stm32_thread.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:26,
                 from libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_thread.cpp:5:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_thread.cpp:5:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling uc_stm32_clock.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/driver/system_clock.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/clock.hpp:8,
                 from libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_clock.cpp:5:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_clock.cpp:6:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling uc_stm32_can.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from libuavcan/libuavcan/include/uavcan/marshal/types.hpp:10:0,
                 from dsdlc_generated/uavcan/Timestamp.hpp:14,
                 from libuavcan/libuavcan/include/uavcan/time.hpp:12,
                 from libuavcan/libuavcan/include/uavcan/uavcan.hpp:11,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:26,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/can.hpp:8,
                 from libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp:7:
libuavcan/libuavcan/include/uavcan/marshal/array.hpp: In instantiation of 'uavcan::Array<T, ArrayMode, MaxSize_>::SelfType& uavcan::Array<T, ArrayMode, MaxSize_>::operator=(const char*) [with T = uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>; uavcan::ArrayMode ArrayMode = (uavcan::ArrayMode)1u; unsigned int MaxSize_ = 80u; uavcan::Array<T, ArrayMode, MaxSize_>::SelfType = uavcan::Array<uavcan::IntegerSpec<8u, (uavcan::Signedness)0u, (uavcan::CastMode)0u>, (uavcan::ArrayMode)1u, 80u>]':
libuavcan/libuavcan/include/uavcan/protocol/data_type_info_provider.hpp:82:23: required from here
libuavcan/libuavcan/include/uavcan/marshal/array.hpp:828:15: warning: declaration of 'ch' shadows a global declaration [-Wshadow]
     SelfType& operator=(const char* ch)
               ^
In file included from zubax_chibios///chibios/os/rt/include/ch.h:78:0,
                 from zubax_chibios///chibios/os/various/cpp_wrappers/ch.hpp:25,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp:10,
                 from libuavcan/libuavcan_drivers/stm32/driver/include/uavcan_stm32/can.hpp:8,
                 from libuavcan/libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp:7:
zubax_chibios///chibios/os/rt/include/chschd.h:521:20: note: shadowed declaration is here
 extern ch_system_t ch;
                    ^
Compiling sys_stm32.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling watchdog_stm32.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling libstdcpp.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling sys_console.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling sys.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling config.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling config_cli.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling ch.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Compiling syscalls_cpp.cpp
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
Linking build/io.px4.sapog.elf
Creating build/io.px4.sapog.bin
# Building the bootloader
cd /home/philippe/sapog/bootloader && make
make[1]: Entering directory '/home/philippe/sapog/bootloader'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/philippe/sapog/bootloader'
# Removing previous build outputs that could use a different git hash
rm -rf build/*.uavcan.bin build/*.compound.bin
# Generating compound image with embedded bootloader
cd build && dd if=/dev/zero bs=16384 count=1 | tr "\000" "\377" >padded_bootloader.tmp.bin
1+0 records in
1+0 records out
16384 bytes (16 kB, 16 KiB) copied, 4,8337e-05 s, 339 MB/s
cd build && dd if=/home/philippe/sapog/bootloader/build/bootloader.bin of=padded_bootloader.tmp.bin conv=notrunc
15+1 records in
15+1 records out
7933 bytes (7,9 kB, 7,7 KiB) copied, 0,000148278 s, 53,5 MB/s
cd build && cat padded_bootloader.tmp.bin io.px4.sapog.bin >io.px4.sapog-1-2.2.7719d6e.compound.bin
# Generating the signed image for the bootloader
cd build && ../zubax_chibios/tools/make_boot_descriptor.py io.px4.sapog.bin io.px4.sapog 1 \
                                                           --also-patch-descriptor-in=io.px4.sapog.elf \
                                                           --also-patch-descriptor-in=io.px4.sapog-1-2.2.7719d6e.compound.bin
# Injecting the bootloader into the final ELF; note that we're using unpadded bootloader to preserve signature
cd build && arm-none-eabi-objcopy --add-section bootloader=/home/philippe/sapog/bootloader/build/bootloader.bin \
                                        --set-section-flags bootloader=load,alloc \
                                        --change-section-address bootloader=0x08000000 \
                                        io.px4.sapog.elf compound.elf
arm-none-eabi-objcopy: compound.elf: warning: allocated section `bootloader' not in segment
# Removing temporary files
cd build && rm -f io.px4.sapog.bin io.px4.sapog.elf *.hex *.tmp.bin

```

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 1:48pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/14 "2018-02-14T13:48:45Z")

</div>

flash command :

```auto
philippe@philippe-MS-7641:~/sapog/tools$ ./blackmagic_flash.sh /dev/ttyACM0
   text data bss dec hex	filename
 141112 10598 43564 195274 2faca	compound.elf
Target voltage: 0.0V
Available Targets:
No. Att Driver
 1 STM32F1 high density
0x08005aa2 in __udivdi3 ()
Loading section bootloader, size 0x1efd lma 0x8000000
Loading section startup, size 0x180 lma 0x8004000
Loading section constructors, size 0x4 lma 0x8004180
Loading section .padding1, size 0xc lma 0x8004184
Loading section .text, size 0x22730 lma 0x8004190
Loading section .ARM.exidx, size 0x8 lma 0x80268c0
Loading section .data, size 0x8d4 lma 0x80268c8
Loading section .noinit, size 0x5 lma 0x802719c
Start address 0x8004190, load size 151710
Transfer rate: 18 KB/sec, 936 bytes/write.
Kill the program being debugged? (y or n) [answered Y; input not from terminal]

```

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 1:50pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/15 "2018-02-14T13:50:26Z")

</div>

content of the build directory

```auto
philippe@philippe-MS-7641:~/sapog/firmware/build$ ls -l
total 1760
-rwxrwxr-x 1 philippe philippe 320248 févr. 14 14:43 compound.elf
-rw-rw-r-- 1 philippe philippe 143784 févr. 14 14:43 io.px4.sapog-1-2.2.7719d6e.application.bin
-rw-rw-r-- 1 philippe philippe 160161 févr. 14 14:43 io.px4.sapog-1-2.2.7719d6e.compound.bin
-rw-rw-r-- 1 philippe philippe 1193328 févr. 14 14:43 io.px4.sapog.map
drwxrwxr-x 2 philippe philippe 4096 févr. 14 14:43 lst
drwxrwxr-x 2 philippe philippe 4096 févr. 14 14:43 obj

```

---

<div class="post-metadata">

**Author:** ![pavel-kirienko](https://forum.zubax.com/user_avatar/forum.zubax.com/pavel-kirienko/32/180_2.png) [@pavel-kirienko](https://forum.zubax.com/u/pavel-kirienko)\
**Post date:** [February 14, 2018, 2:42pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/16 "2018-02-14T14:42:17Z")

</div>

Thank you, Philippe. The outputs look good. You said above that your hardware is an official Orel 20, but you also said in the beginning:

> in our case we have a bare stm32 without any bootloader installed

How did you come to own an Orel 20 with a bare MCU?

Regardless, please run another test: try uploading the attached file and see if it changes anything:  
[compound.elf](https://forum.zubax.com/uploads/default/original/1X/4ee5a66357a48401f52df54dd190debd67da773c.elf) (1.8 MB)

Please also describe the behavior of the LED indicator after the board is powered on.

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 3:02pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/17 "2018-02-14T15:02:04Z")

</div>

Thanks Pavel,

We have two official Orel 20 and also made two custom modified board based on the zubax design.  
As we saw that the flashing was not working on our custom board, we tried flashing the official Orel 20, that stopped working after the flashing. I will try to flash your file.

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 3:07pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/18 "2018-02-14T15:07:40Z")

</div>

led status after powering up. Orange fixed during several seconds. Then blue/red for one two seconds, then green fixed.

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 3:11pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/19 "2018-02-14T15:11:48Z")

</div>

here is the result of the flashing with your file :

philippe@philippe-MS-7641:~/sapog/tools$ ./blackmagic\_flash.sh /dev/ttyACM0  
text data bss dec hex filename  
191320 10601 43612 245533 3bf1d compound.elf  
Target voltage: 0.0V  
Available Targets:  
No. Att Driver  
1 STM32F1 high density  
0x08009fb0 in registerDataType (id=…, this=0x0) at libuavcan/libuavcan/include/uavcan/node/global\_data\_type\_registry.hpp:214  
214 libuavcan/libuavcan/include/uavcan/node/global\_data\_type\_registry.hpp: No such file or directory.  
Loading section bootloader, size 0x1efd lma 0x8000000  
Loading section startup, size 0x180 lma 0x8004000  
Loading section constructors, size 0x4 lma 0x8004180  
Loading section .padding1, size 0xc lma 0x8004184  
Loading section .text, size 0x2eb50 lma 0x8004190  
Loading section .ARM.exidx, size 0x8 lma 0x8032ce0  
Loading section .data, size 0x8d4 lma 0x8032ce8  
Loading section .noinit, size 0x8 lma 0x80335bc  
Start address 0x8004190, load size 201921  
Transfer rate: 18 KB/sec, 947 bytes/write.  
Kill the program being debugged? (y or n) [answered Y; input not from terminal]

---

<div class="post-metadata">

**Author:** ![anemostec](https://forum.zubax.com/user_avatar/forum.zubax.com/anemostec/32/463_2.png) [@anemostec](https://forum.zubax.com/u/anemostec)\
**Post date:** [February 14, 2018, 3:12pm UTC](https://forum.zubax.com/t/sapog-esc-flashing/864/20 "2018-02-14T15:12:08Z")

</div>

there is a missing file ?

[Next page](https://forum.zubax.com/t/sapog-esc-flashing/864.md?page=2)
