STM32 Development

That’s very strange. And your usart.c includes <string.h>? Mine’s quite clean:

$ touch Src/usart.c 
$ make
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/usart.d" -MT"build/usart.d" -std=gnu99 -Wa,-a,-ad,-alms=build/usart.lst Src/usart.c -o build/usart.o
/usr/bin/arm-none-eabi-gcc build/adc.o build/power.o build/stm32f3xx_hal_msp.o build/stm32f3xx_hal_uart.o build/stm32f3xx_hal_adc_ex.o build/stm32f3xx_hal_adc.o build/stm32f3xx_hal_tim.o build/stm32f3xx_hal_gpio.o build/usart.o build/stm32f3xx_hal_rcc_ex.o build/gpio.o build/stm32f3xx_hal_i2c.o build/stm32f3xx_hal_pwr.o build/stm32f3xx_hal_flash_ex.o build/stm32f3xx_hal_cortex.o build/main.o build/stm32f3xx_it.o build/stm32f3xx_hal_dma.o build/system_stm32f3xx.o build/dma.o build/stm32f3xx_hal_tim_ex.o build/tim.o build/stm32f3xx_hal_uart_ex.o build/stm32f3xx_hal_rcc.o build/stm32f3xx_hal_flash.o build/stm32f3xx_hal_pwr_ex.o build/stm32f3xx_hal.o build/stm32f3xx_hal_i2c_ex.o build/startup_stm32f303xe.o -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32F303RETx_FLASH.ld  -lc -lm -lnosys  -Wl,-Map=build/emonTxshield.map,--cref -Wl,--gc-sections -Xlinker --no-wchar-size-warning -u _printf_float -o build/emonTxshield.elf
/usr/bin/arm-none-eabi-size build/emonTxshield.elf
   text	   data	    bss	    dec	    hex	filename
  27576	    172	   5908	  33656	   8378	build/emonTxshield.elf
/usr/bin/arm-none-eabi-objcopy -O ihex build/emonTxshield.elf build/emonTxshield.hex
/usr/bin/arm-none-eabi-objcopy -O binary -S build/emonTxshield.elf build/emonTxshield.bin	
$

I think you’re looking at different projects. Robert is looking at my “stm32tests/stm32test1” which is my copy of the original tutorial, and you are looking at the “emonTxshield” presumably v4.

I have just recompiled my “stm32tests/stm32test1” which Robert is getting the strlen warning and this is the full print

pi@raspberrypi:~/emonTxshield $ make
mkdir build
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/adc.d" -MT"build/adc.d" -std=gnu99 -Wa,-a,-ad,-alms=build/adc.lst Src/adc.c -o build/adc.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/power.d" -MT"build/power.d" -std=gnu99 -Wa,-a,-ad,-alms=build/power.lst Src/power.c -o build/power.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_msp.d" -MT"build/stm32f3xx_hal_msp.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_msp.lst Src/stm32f3xx_hal_msp.c -o build/stm32f3xx_hal_msp.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_uart.d" -MT"build/stm32f3xx_hal_uart.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_uart.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c -o build/stm32f3xx_hal_uart.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_adc_ex.d" -MT"build/stm32f3xx_hal_adc_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_adc_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc_ex.c -o build/stm32f3xx_hal_adc_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_adc.d" -MT"build/stm32f3xx_hal_adc.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_adc.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc.c -o build/stm32f3xx_hal_adc.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_tim.d" -MT"build/stm32f3xx_hal_tim.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_tim.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c -o build/stm32f3xx_hal_tim.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_gpio.d" -MT"build/stm32f3xx_hal_gpio.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_gpio.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c -o build/stm32f3xx_hal_gpio.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/usart.d" -MT"build/usart.d" -std=gnu99 -Wa,-a,-ad,-alms=build/usart.lst Src/usart.c -o build/usart.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_rcc_ex.d" -MT"build/stm32f3xx_hal_rcc_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_rcc_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c -o build/stm32f3xx_hal_rcc_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/gpio.d" -MT"build/gpio.d" -std=gnu99 -Wa,-a,-ad,-alms=build/gpio.lst Src/gpio.c -o build/gpio.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_i2c.d" -MT"build/stm32f3xx_hal_i2c.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_i2c.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c -o build/stm32f3xx_hal_i2c.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_pwr.d" -MT"build/stm32f3xx_hal_pwr.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_pwr.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c -o build/stm32f3xx_hal_pwr.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_flash_ex.d" -MT"build/stm32f3xx_hal_flash_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_flash_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c -o build/stm32f3xx_hal_flash_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_cortex.d" -MT"build/stm32f3xx_hal_cortex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_cortex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c -o build/stm32f3xx_hal_cortex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/main.d" -MT"build/main.d" -std=gnu99 -Wa,-a,-ad,-alms=build/main.lst Src/main.c -o build/main.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_it.d" -MT"build/stm32f3xx_it.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_it.lst Src/stm32f3xx_it.c -o build/stm32f3xx_it.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_dma.d" -MT"build/stm32f3xx_hal_dma.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_dma.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c -o build/stm32f3xx_hal_dma.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/system_stm32f3xx.d" -MT"build/system_stm32f3xx.d" -std=gnu99 -Wa,-a,-ad,-alms=build/system_stm32f3xx.lst Src/system_stm32f3xx.c -o build/system_stm32f3xx.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/dma.d" -MT"build/dma.d" -std=gnu99 -Wa,-a,-ad,-alms=build/dma.lst Src/dma.c -o build/dma.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_tim_ex.d" -MT"build/stm32f3xx_hal_tim_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_tim_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c -o build/stm32f3xx_hal_tim_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/tim.d" -MT"build/tim.d" -std=gnu99 -Wa,-a,-ad,-alms=build/tim.lst Src/tim.c -o build/tim.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_uart_ex.d" -MT"build/stm32f3xx_hal_uart_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_uart_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c -o build/stm32f3xx_hal_uart_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_rcc.d" -MT"build/stm32f3xx_hal_rcc.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_rcc.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c -o build/stm32f3xx_hal_rcc.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_flash.d" -MT"build/stm32f3xx_hal_flash.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_flash.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c -o build/stm32f3xx_hal_flash.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_pwr_ex.d" -MT"build/stm32f3xx_hal_pwr_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_pwr_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c -o build/stm32f3xx_hal_pwr_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal.d" -MT"build/stm32f3xx_hal.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c -o build/stm32f3xx_hal.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_i2c_ex.d" -MT"build/stm32f3xx_hal_i2c_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_i2c_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c -o build/stm32f3xx_hal_i2c_ex.o
make: *** No rule to make target 'build/startup_stm32f303xe.o', needed by 'build/emonTxshield.elf'.  Stop.
pi@raspberrypi:~/emonTxshield $ cd ../stm32tests/stm32test1
pi@raspberrypi:~/stm32tests/stm32test1 $ make
make: Nothing to be done for 'all'.
pi@raspberrypi:~/stm32tests/stm32test1 $ make clean
rm -fR .dep build
pi@raspberrypi:~/stm32tests/stm32test1 $ make
mkdir build
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_uart.d" -MT"build/stm32f3xx_hal_uart.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_uart.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c -o build/stm32f3xx_hal_uart.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/main.d" -MT"build/main.d" -std=gnu99 -Wa,-a,-ad,-alms=build/main.lst Src/main.c -o build/main.o
Src/main.c: In function 'main':
Src/main.c:110:3: warning: implicit declaration of function 'debug_printf' [-Wimplicit-function-declaration]
   debug_printf(log_buffer);
   ^
Src/main.c:111:3: warning: implicit declaration of function 'calibrate_ADC2' [-Wimplicit-function-declaration]
   calibrate_ADC2();
   ^
Src/main.c:112:3: warning: implicit declaration of function 'start_ADC2' [-Wimplicit-function-declaration]
   start_ADC2();
   ^
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal.d" -MT"build/stm32f3xx_hal.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c -o build/stm32f3xx_hal.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_pwr_ex.d" -MT"build/stm32f3xx_hal_pwr_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_pwr_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c -o build/stm32f3xx_hal_pwr_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_i2c_ex.d" -MT"build/stm32f3xx_hal_i2c_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_i2c_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c -o build/stm32f3xx_hal_i2c_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_cortex.d" -MT"build/stm32f3xx_hal_cortex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_cortex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c -o build/stm32f3xx_hal_cortex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_msp.d" -MT"build/stm32f3xx_hal_msp.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_msp.lst Src/stm32f3xx_hal_msp.c -o build/stm32f3xx_hal_msp.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_pwr.d" -MT"build/stm32f3xx_hal_pwr.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_pwr.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c -o build/stm32f3xx_hal_pwr.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_flash.d" -MT"build/stm32f3xx_hal_flash.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_flash.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c -o build/stm32f3xx_hal_flash.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_tim.d" -MT"build/stm32f3xx_hal_tim.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_tim.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c -o build/stm32f3xx_hal_tim.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_it.d" -MT"build/stm32f3xx_it.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_it.lst Src/stm32f3xx_it.c -o build/stm32f3xx_it.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_flash_ex.d" -MT"build/stm32f3xx_hal_flash_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_flash_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c -o build/stm32f3xx_hal_flash_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_uart_ex.d" -MT"build/stm32f3xx_hal_uart_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_uart_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c -o build/stm32f3xx_hal_uart_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_dma.d" -MT"build/stm32f3xx_hal_dma.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_dma.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c -o build/stm32f3xx_hal_dma.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_rcc.d" -MT"build/stm32f3xx_hal_rcc.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_rcc.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c -o build/stm32f3xx_hal_rcc.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_rcc_ex.d" -MT"build/stm32f3xx_hal_rcc_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_rcc_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c -o build/stm32f3xx_hal_rcc_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_gpio.d" -MT"build/stm32f3xx_hal_gpio.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_gpio.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c -o build/stm32f3xx_hal_gpio.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_i2c.d" -MT"build/stm32f3xx_hal_i2c.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_i2c.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c -o build/stm32f3xx_hal_i2c.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/system_stm32f3xx.d" -MT"build/system_stm32f3xx.d" -std=gnu99 -Wa,-a,-ad,-alms=build/system_stm32f3xx.lst Src/system_stm32f3xx.c -o build/system_stm32f3xx.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_tim_ex.d" -MT"build/stm32f3xx_hal_tim_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_tim_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c -o build/stm32f3xx_hal_tim_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/usart.d" -MT"build/usart.d" -std=gnu99 -Wa,-a,-ad,-alms=build/usart.lst Src/usart.c -o build/usart.o
Src/usart.c: In function 'debug_printf':
Src/usart.c:128:43: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   HAL_UART_Transmit(&huart2, (uint8_t*)p, strlen(p), 1000);
                                           ^
Src/usart.c:128:43: warning: incompatible implicit declaration of built-in function 'strlen'
Src/usart.c:128:43: note: include '<string.h>' or provide a declaration of 'strlen'
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/gpio.d" -MT"build/gpio.d" -std=gnu99 -Wa,-a,-ad,-alms=build/gpio.lst Src/gpio.c -o build/gpio.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_adc.d" -MT"build/stm32f3xx_hal_adc.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_adc.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc.c -o build/stm32f3xx_hal_adc.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/stm32f3xx_hal_adc_ex.d" -MT"build/stm32f3xx_hal_adc_ex.d" -std=gnu99 -Wa,-a,-ad,-alms=build/stm32f3xx_hal_adc_ex.lst Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc_ex.c -o build/stm32f3xx_hal_adc_ex.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/adc.d" -MT"build/adc.d" -std=gnu99 -Wa,-a,-ad,-alms=build/adc.lst Src/adc.c -o build/adc.o
/usr/bin/arm-none-eabi-gcc -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/dma.d" -MT"build/dma.d" -std=gnu99 -Wa,-a,-ad,-alms=build/dma.lst Src/dma.c -o build/dma.o
/usr/bin/arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -DUSE_HAL_DRIVER -DSTM32F303xE -IInc -IDrivers/STM32F3xx_HAL_Driver/Inc -IDrivers/STM32F3xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32F3xx/Include -IDrivers/CMSIS/Include -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/startup_stm32f303xe.d" -MT"build/startup_stm32f303xe.d" -std=gnu99 startup_stm32f303xe.s -o build/startup_stm32f303xe.o
/usr/bin/arm-none-eabi-gcc build/stm32f3xx_hal_uart.o build/main.o build/stm32f3xx_hal.o build/stm32f3xx_hal_pwr_ex.o build/stm32f3xx_hal_i2c_ex.o build/stm32f3xx_hal_cortex.o build/stm32f3xx_hal_msp.o build/stm32f3xx_hal_pwr.o build/stm32f3xx_hal_flash.o build/stm32f3xx_hal_tim.o build/stm32f3xx_it.o build/stm32f3xx_hal_flash_ex.o build/stm32f3xx_hal_uart_ex.o build/stm32f3xx_hal_dma.o build/stm32f3xx_hal_rcc.o build/stm32f3xx_hal_rcc_ex.o build/stm32f3xx_hal_gpio.o build/stm32f3xx_hal_i2c.o build/system_stm32f3xx.o build/stm32f3xx_hal_tim_ex.o build/usart.o build/gpio.o build/stm32f3xx_hal_adc.o build/stm32f3xx_hal_adc_ex.o build/adc.o build/dma.o build/startup_stm32f303xe.o -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32F303RETx_FLASH.ld  -lc -lm -lnosys  -Wl,-Map=build/stm32test1.map,--cref -Wl,--gc-sections -Xlinker --no-wchar-size-warning -o build/stm32test1.elf
/usr/bin/arm-none-eabi-size build/stm32test1.elf
   text    data     bss     dec     hex filename
  11256      12    4948   16216    3f58 build/stm32test1.elf
/usr/bin/arm-none-eabi-objcopy -O ihex build/stm32test1.elf build/stm32test1.hex
/usr/bin/arm-none-eabi-objcopy -O binary -S build/stm32test1.elf build/stm32test1.bin
pi@raspberrypi:~/stm32tests/stm32test1 $

here’s what Robert is compiling
stm32tests-master.zip (653.8 KB)

I do not get those errors with the emonTxshield_2 andemonTxshield_3 I haven’t tried _4 yet and _1 doesn’t compile.

Since I was missing a jumper to connect PA0 to PB14 and to help my learning process I’ve decided to build on the end of your 3. ADC Tutorial Part3, adding user code to make it useful. tutorial @dBC adding in some RMS voltage and current maths to see if I could get my head around it. I’ve stuck to 1 ADC and inputs A0 (Voltage) and A1 (CT1) for now and am getting good results :slight_smile:

rmscalc

These are the modifications I made from my last point showing the rms math https://github.com/TrystanLea/STM32Dev/commit/3b37aa5acdb2169fa835b9a8d956fd1a29f35221

Im using the shiftedFCL filter documented by @Robert.Wall in learn Learn | OpenEnergyMonitor and Im not doing any zero crossing detection to start/end the sampling period yet.

Now with a calculation of real power :slight_smile:
https://github.com/TrystanLea/STM32Dev/blob/master/STM02/Src/main.c

Cool. And to answer your question in the comment…

`ADC1_DMA_BUFFSIZE 4000    // must me integer multiple of number of channels?`

The practical answer is yes, it must be a multiple. If it’s not the DMA controller will still jump back to the beginning of the buffer when it gets to the end (so there’ll be no overrun into what lives past the buffer) but it will do that part way through the sequence. Once that happens, you’ll lose track of which channel buff[0] represents as it’ll change each time around.

On the multiple ADC front, I’ve made some progress on how to support negative (and 0) delays… currently the delays only go in one direction (Current ADCs start early, Voltage ADC starts late). Not quite there yet though, and then there’ll be a lot of scope testing to make sure they’re all kicking off on the correct edges.

1 Like

Thanks @dBC, that sounds great, looking forward to hearing more about how it develops.

I’ve now amended my test code to print out, Vrms, Irms, realPower, apparentPower and powerFactor as floats with the makefile modifications you mentioned.

BINPATH = /usr/bin
CFLAGS += -std=gnu99
LDFLAGS += -Xlinker --no-wchar-size-warning -u _printf_float

A much better way, as long as the bias/offset is stable, is like emonLibCM: remove the offset at the reporting stage. (Not that you’re worried about speeding up the calculation - but it does!)

Yes, I followed your lead on that in power.c and I agree it’s much better.

I’ve been thinking a bit about how to best approach 3 phase. ADC1 and ADC2 can each reach 7 input pins, while ADC3 and ADC4 can each reach 3 pins, so it might make sense to permanently devote ADC4 to Voltage measurements and let it continuously cycle through the 3 voltage measurements. That leaves 17 Current inputs spread across the other three.

Using the sequencer slots, I think we could have a lot of flexibility on assigning a Current input to a phase, i.e. it could be done at runtime (or config time) rather than hardwired at the factory. The simplest case is where the phases happen to end up well distributed across the 3 Current ADCs like this:
easy
In this diagram, C2.6 for example means channel 6 on ADC2, phase is indicated by colour. So you can choose C2.6’s phase simply by which slot you drop it into. When they’re well dispersed like in the above example it’s easy because there are slots to spare.

The more challenging case is where all the Red phase CTs happen to end up on ADC1, all the Yellow on ADC2 and all the Blue on ADC3. In that case we run out of slots and compromises have to be made:
congestion
We had to move one of the Reds to ADC2 and one of the Yellows to ADC1 and one of the Blues to ADC2. So it doesn’t give total flexibility, but apart from a few pathological cases, it comes pretty close.

I wonder if the 64 pin package is making things too awkward, the 144pin package would offer 40 adc channels to pick from. We don’t need to break them all out for to use the full 40 all at once, but it might give us the flexibility to have a wider variety of profiles, some physical inputs could be hardwired or jumpered to multiple adc’s.

There was also a question about using the F373 which has only 2 ADC’s (16bit) and 40 channels, as that might fit better with with what we’re doing. I haven’t looked at the F373 spec closely, but as long as there are at least 3 adc12 channels for the Vac, the configuration will be pretty easy as any CT channel can then be associated with any Vac channel.

If there’s not much in the pricing 64p v 144p or F303 v F373, we maybe making hard work for ourselves unnecessarily.

The extra resolution would be nice. The downside is that the phase-shift approach shifts an entire ADC (not individual channels), so if you want to use it to avoid interpolation and all that stuff, I think you need an ADC dedicated to Voltage measurements.

Unless here’s no other way, that’s unlikely to be satisfactory to most potential users, in my view. The more flexibility there is, the better. But I can understand permanently committing 1 c.t. to each phase.

But if we have a well thought out modular front end, the choice of physical input to ADC channel might be made there, in which case the software must be capable of mapping to the physical arrangement.

That’s nice to avoid, but it does have one advantage: by organising the maths differently, you can apply it after the event when the rms values, hence the phase errors, are known, which opens the way to real-time correction. But if the timing can be shifted on-the-fly, it will negate that.

Actually, I’m saying assign CTs to phases at runtime, all in software. You can associate a CT with a phase simply by which slot you drop it into in the sequence (apart from a few extreme cases). Or is your concern about those extreme cases?

Nice… and allows per-channel correction which the ADC triggering solution will never be able to achieve. The other big advantage of going the s/w route to phase correction is it means I don’t have to work out how to write those remaining two empty routines in adc.c to support changing the shift in the other direction ;-).

I think that as long as most are flexible, that should be enough. There will always be that one situation that nobody expected. But to (say) permanently allocate a third of the c.t’s to each phase would be rather restrictive, especially to users who want per-circuit values.

Also remember that not everybody wants 3 voltages, 1 only (UK domestic) and 2 only (US domestic) are also valid, so (again assuming a fully modular front end) one or two “V” channels become free to be used for currents if the hardware allows.

It’s not just the extra resolution either from what I read the sigma adc’s are aimed at removing/reducing noise.

depending on how thw 40 channels are distributed on the f373, it might be possible to get 15 to 18 ct channels on one adc, leaving the other adc to just do Vac, regardless of whether it’s single, split or 3 phase. configuring the pairs will be totally flexible 0-all CT’s per Vac input.

Yes, totally agree. The first example above was to demonstrate how easy that case is, not to mandate that case. A common situation in Aus is to have all your house circuits on one phase, and then later, as you add air-con, bring in a second phase just for that. Later again when you bring in a shed full of power tools, bring in a third phase for that. The above scheme would support that like this:
heavy_red

But I also agree a fully modular front-end makes all these solutions easy, although I suppose it would come down to h/w jumpers Vs s/w config?

STM32CubeMX is excellent for quickly answering questions like that. Just fire it up, select your CPU of interest, and start assigning pins to ADCs over on the left hand panel.

1 Like

Would I be right in thinking the method of correcting phase errors currently being experimented with, might also accomadate a derived-3phase solution too?

It’d be difficult to support that with the ADC-trigger approach. I’ll let Robert speak to the s/w approach, but assuming he’s hopeful, that’s probably another nail in the coffin for the ADC-trigger approach.

Not sure what you mean by that? Measuring one voltage and phase-shifting to generate a ‘best guess’? I know there are objections and practical difficulties in having 3 a.c. adapters, but there are definite advantages in knowing all 3 voltages.

A big problem with - shall we call it “time displacement” - is the differential phase error between current and voltage depends now on the timing of the voltage in addition to the transformer errors, and that depends on a variable mains frequency. You need to measure it and adjust the delay, or phase lock to it, to remove that variable. So the 3-phase PLL sketch calibrates in much the same way as the single-phase ones, because the timing variable has gone.

(But with a fully modular front end and enough power for some op.amps, it might just be possible to do the “capacitive v.t.” to get the voltages, although that has big uncertainties regarding construction, installation and calibration.)