cd /cygdrive/y/cygwin/tmp/stm32/stm32_PIO/scsiem/
export ELF=.pio/build/genericSTM32F103CB/firmware.elf
export LST=firmware.lst
export SYM=firmware.sym
pio run && arm-none-eabi-size -A -x ${ELF} && arm-none-eabi-objdump -h -S -C ${ELF} > ${LST}

pio run --target upload && arm-none-eabi-objdump -h -S -C ${ELF} > ${LST}

ls -l .pio/build/genericSTM32F103CB/firmware.bin

arm-none-eabi-readelf -a ${ELF} > ${SYM}
arm-none-eabi-objdump -h -S -C ${ELF} > ${LST}
arm-none-eabi-size -A -x ${ELF}

pio run
pio run --target upload


### preparation building environment

## platformIO support STmicro STM32 platform
pio platform install ststm32

pio platform list
:
ststm32 ~ ST STM32
==================
The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is des
igned to offer new degrees of freedom to MCU users. It offers a 32-bit product r
ange that combines very high performance, real-time capabilities, digital signal
 processing, and low-power, low-voltage operation, while maintaining full integr
ation and ease of development.

Home: http://platformio.org/platforms/ststm32
Frameworks: arduino, cmsis, libopencm3, mbed, spl, stm32cube
Packages: tool-stm32duino, framework-libopencm3, tool-dfuutil, framework-arduino
ststm32, toolchain-gccarmnoneeabi, framework-arduinostm32mxchip, framework-ardui
noststm32-maple, tool-openocd, framework-spl, framework-stm32cube, framework-cms
is, framework-mbed, tool-jlink
Version: 5.5.0
:

## support SdFat library
pio lib -g install SdFat

pio lib -g list
Library Storage: /home/user/.platformio/lib
:
SdFat
=====
#ID: 322
FAT16/FAT32 file system for SD cards.

Version: 1.1.2
Keywords: storage, data
Compatible frameworks: arduino
Compatible platforms: atmelavr, atmelmegaavr, atmelsam, espressif32, espressif82
66, gd32v, infineonxmc, intel_arc32, kendryte210, microchippic32, nordicnrf51, n
ordicnrf52, ststm32, ststm8, teensy, timsp430
Authors: Bill Greiman
:

## Install platformIO
See => https://docs.platformio.org/en/latest/core/installation.html
System requirements
	Operating System:
		Windows, macOS, Linux, FreeBSD, Linux ARMv6+
	Python Interpreter:
		Python 3.5+ (Python 2.7 is not recommended). See detailed instruction how to
		 Install Python Interpreter for Windows.
		Terminal Application:
	All commands below should be executed in Command-line application (Terminal).
	 For macOS and Linux OS - Terminal application, for Windows OS ? cmd.exe application.
	Access to Serial Ports (USB/UART):
		Windows Users:
			Please check that you have correctly installed USB driver from board manufacturer
		Linux Users:
			Please install 99-platformio-udev.rules
			Raspberry Pi users, please read this article Enable serial port on Raspberry Pi.

Super-Quick Install (Mac / Linux)
python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/develop/scripts/get-platformio.py)"
or
pip  install -U platformio
or
pip3 install -U platformio

## show off my environment
python3 --version
Python 3.8.0

pip3 --version
pip 19.3.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

