![](https://private-user-images.githubusercontent.com/1186214/346999862-9e117d81-e808-493e-a20c-7284ea630f37.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NzI2NTksIm5iZiI6MTczOTg3MjM1OSwicGF0aCI6Ii8xMTg2MjE0LzM0Njk5OTg2Mi05ZTExN2Q4MS1lODA4LTQ5M2UtYTIwYy03Mjg0ZWE2MzBmMzcuanBlZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDA5NTIzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFhYzg0Y2U2ZDE1ZWJjMjMwOGU0ODJhYjk3YTZhOTU5ZjJhNjUyZDFlOGIzMzRiYjFlYTJiYmJiMDA5NDJjZDYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bdGQf5V5U11v2XdS15FqHSWkjltXCU7XuPUGjRyY4wM)
- Connect the STM32F746G-DISCO board via the ST-LINK USB port to your Mac.
- Make sure you have a recent nightly Swift toolchain that has Embedded Swift support.
- Install the
stlink
(https://github.com/stlink-org/stlink) command line tools, e.g. viabrew install stlink
. - Build and upload the program to flash memory of the STM:
$ cd stm32-lcd-logo
$ TOOLCHAINS='<toolchain-identifier>' ./build.sh
$ st-flash --reset write .build/lcd-logo.bin 0x08000000
- The LCD display on the board should now be showing a bouncing animating Swift logo on a fading background, and the user LED on should be blinking.
Resulting size of the compiled and linked binary follows (3.5 kB of code + 10 kB of pixel data):
$ size -m .build/lcd-logo
Segment __TEXT: 14376
Section __text: 3604
Section __const: 10000
total 13604
Segment __DATA: 8
Section __nl_symbol_ptr: 4
Section __data: 4
total 8
Segment __VECTORS: 456
Section __text: 456
total 456
Segment __LINKEDIT: 1056
total 15896