1. Hands-on VeriFast with STM32
microcontroller
Hands-on VeriFast with STM32
microcontroller
Hands-on VeriFast with STM32
microcontroller
Hands-on VeriFast with STM32
microcontroller
Hands-on VeriFast with STM32
microcontroller
Kiwamu OkabeKiwamu OkabeKiwamu OkabeKiwamu OkabeKiwamu Okabe
2. Table of ContentsTable of ContentsTable of ContentsTable of ContentsTable of Contents
☆ Introduce ChibiOS/RT which is a RTOS☆ Introduce ChibiOS/RT which is a RTOS☆ Introduce ChibiOS/RT which is a RTOS☆ Introduce ChibiOS/RT which is a RTOS☆ Introduce ChibiOS/RT which is a RTOS
☆ Get development environment for ChibiOS/RT☆ Get development environment for ChibiOS/RT☆ Get development environment for ChibiOS/RT☆ Get development environment for ChibiOS/RT☆ Get development environment for ChibiOS/RT
☆ Build sample application on ChibiOS/RT☆ Build sample application on ChibiOS/RT☆ Build sample application on ChibiOS/RT☆ Build sample application on ChibiOS/RT☆ Build sample application on ChibiOS/RT
☆ Introduce STM32 microcontroller☆ Introduce STM32 microcontroller☆ Introduce STM32 microcontroller☆ Introduce STM32 microcontroller☆ Introduce STM32 microcontroller
☆ Run the application on STM32 board☆ Run the application on STM32 board☆ Run the application on STM32 board☆ Run the application on STM32 board☆ Run the application on STM32 board
☆ Introduce VeriFast☆ Introduce VeriFast☆ Introduce VeriFast☆ Introduce VeriFast☆ Introduce VeriFast
☆ Verify the application using VeriFast☆ Verify the application using VeriFast☆ Verify the application using VeriFast☆ Verify the application using VeriFast☆ Verify the application using VeriFast
3. What's ChibiOS/RT?What's ChibiOS/RT?What's ChibiOS/RT?What's ChibiOS/RT?What's ChibiOS/RT?
☆ http://www.chibios.org/☆ http://www.chibios.org/☆ http://www.chibios.org/☆ http://www.chibios.org/☆ http://www.chibios.org/
☆ Simple/Small/Fast/Portable real-time OS☆ Simple/Small/Fast/Portable real-time OS☆ Simple/Small/Fast/Portable real-time OS☆ Simple/Small/Fast/Portable real-time OS☆ Simple/Small/Fast/Portable real-time OS
☆ Run on ARM Cortex-M, Arduino Uno, PowerPC
e200
☆ Run on ARM Cortex-M, Arduino Uno, PowerPC
e200
☆ Run on ARM Cortex-M, Arduino Uno, PowerPC
e200
☆ Run on ARM Cortex-M, Arduino Uno, PowerPC
e200
☆ Run on ARM Cortex-M, Arduino Uno, PowerPC
e200
☆ Context Switch (STM32F4xx): 0.40 µsec☆ Context Switch (STM32F4xx): 0.40 µsec☆ Context Switch (STM32F4xx): 0.40 µsec☆ Context Switch (STM32F4xx): 0.40 µsec☆ Context Switch (STM32F4xx): 0.40 µsec
☆ Kernel Size (STM32F4xx): 6172 byte☆ Kernel Size (STM32F4xx): 6172 byte☆ Kernel Size (STM32F4xx): 6172 byte☆ Kernel Size (STM32F4xx): 6172 byte☆ Kernel Size (STM32F4xx): 6172 byte
4. Get the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #Windows
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Windows.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Windows.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Windows.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Windows.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Windows.en.md
☆ Install following:☆ Install following:☆ Install following:☆ Install following:☆ Install following:
*�https://git-for-windows.github.io/
*�https://launchpad.net/gcc-arm-embedded/+download
*�https://ttssh2.osdn.jp/index.html.en
*�https://cygwin.com/
*�https://git-for-windows.github.io/
*�https://launchpad.net/gcc-arm-embedded/+download
*�https://ttssh2.osdn.jp/index.html.en
*�https://cygwin.com/
*�https://git-for-windows.github.io/
*�https://launchpad.net/gcc-arm-embedded/+download
*�https://ttssh2.osdn.jp/index.html.en
*�https://cygwin.com/
*�https://git-for-windows.github.io/
*�https://launchpad.net/gcc-arm-embedded/+download
*�https://ttssh2.osdn.jp/index.html.en
*�https://cygwin.com/
*�https://git-for-windows.github.io/
*�https://launchpad.net/gcc-arm-embedded/+download
*�https://ttssh2.osdn.jp/index.html.en
*�https://cygwin.com/
☆ Install following cygwin packages☆ Install following cygwin packages☆ Install following cygwin packages☆ Install following cygwin packages☆ Install following cygwin packages
*�cmake
*�libusb1.0-devel
*�cmake
*�libusb1.0-devel
*�cmake
*�libusb1.0-devel
*�cmake
*�libusb1.0-devel
*�cmake
*�libusb1.0-devel
5. Get the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #Windows
☆ Open cygwin terminal, and install "stlink":☆ Open cygwin terminal, and install "stlink":☆ Open cygwin terminal, and install "stlink":☆ Open cygwin terminal, and install "stlink":☆ Open cygwin terminal, and install "stlink":
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�make�install)
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�make�install)
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�make�install)
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�make�install)
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�make�install)
☆ Download VeriFast from following URL, unzip it
and set PATH to "verifast-XXXXXXX/bin" directory.
☆ Download VeriFast from following URL, unzip it
and set PATH to "verifast-XXXXXXX/bin" directory.
☆ Download VeriFast from following URL, unzip it
and set PATH to "verifast-XXXXXXX/bin" directory.
☆ Download VeriFast from following URL, unzip it
and set PATH to "verifast-XXXXXXX/bin" directory.
☆ Download VeriFast from following URL, unzip it
and set PATH to "verifast-XXXXXXX/bin" directory.
https://github.com/verifast/verifast#binarieshttps://github.com/verifast/verifast#binarieshttps://github.com/verifast/verifast#binarieshttps://github.com/verifast/verifast#binarieshttps://github.com/verifast/verifast#binaries
6. Get the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #WindowsGet the devel-environment #Windows
☆ Open cygwin terminal, and checkout custom
ChibiOS/RT source code:w
☆ Open cygwin terminal, and checkout custom
ChibiOS/RT source code:w
☆ Open cygwin terminal, and checkout custom
ChibiOS/RT source code:w
☆ Open cygwin terminal, and checkout custom
ChibiOS/RT source code:w
☆ Open cygwin terminal, and checkout custom
ChibiOS/RT source code:w
$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git
8. Get the devel-environment #MacOSGet the devel-environment #MacOSGet the devel-environment #MacOSGet the devel-environment #MacOSGet the devel-environment #MacOS
☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly-osx.tar.gz
$�tar�xf�verifast-nightly-osx.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly-osx.tar.gz
$�tar�xf�verifast-nightly-osx.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly-osx.tar.gz
$�tar�xf�verifast-nightly-osx.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly-osx.tar.gz
$�tar�xf�verifast-nightly-osx.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly-osx.tar.gz
$�tar�xf�verifast-nightly-osx.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:
$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git
9. Get the devel-environment #LinuxGet the devel-environment #LinuxGet the devel-environment #LinuxGet the devel-environment #LinuxGet the devel-environment #Linux
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Linux.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Linux.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Linux.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Linux.en.md
Detail:�https://github.com/fpiot/chibios-verifast/blob/master/doc/
README.Linux.en.md
☆ Install deb packages:☆ Install deb packages:☆ Install deb packages:☆ Install deb packages:☆ Install deb packages:
$�sudo�apt-get�install�wget�git�libgtk2.0-0�libusb-1.0-0-dev�libgtk-3-dev�
build-essential�cmake�gcc-arm-none-eabi�gdb-arm-none-eabi�picocom
$�sudo�apt-get�install�wget�git�libgtk2.0-0�libusb-1.0-0-dev�libgtk-3-dev�
build-essential�cmake�gcc-arm-none-eabi�gdb-arm-none-eabi�picocom
$�sudo�apt-get�install�wget�git�libgtk2.0-0�libusb-1.0-0-dev�libgtk-3-dev�
build-essential�cmake�gcc-arm-none-eabi�gdb-arm-none-eabi�picocom
$�sudo�apt-get�install�wget�git�libgtk2.0-0�libusb-1.0-0-dev�libgtk-3-dev�
build-essential�cmake�gcc-arm-none-eabi�gdb-arm-none-eabi�picocom
$�sudo�apt-get�install�wget�git�libgtk2.0-0�libusb-1.0-0-dev�libgtk-3-dev�
build-essential�cmake�gcc-arm-none-eabi�gdb-arm-none-eabi�picocom
☆ Install "stlink":☆ Install "stlink":☆ Install "stlink":☆ Install "stlink":☆ Install "stlink":
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�sudo�make�install)
$�sudo�ldconfig
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�sudo�make�install)
$�sudo�ldconfig
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�sudo�make�install)
$�sudo�ldconfig
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�sudo�make�install)
$�sudo�ldconfig
$�git�clone�https://github.com/texane/stlink.git
$�(cd�stlink�&&�make)
$�(cd�stlink/build/Release�&&�sudo�make�install)
$�sudo�ldconfig
10. Get the devel-environment #LinuxGet the devel-environment #LinuxGet the devel-environment #LinuxGet the devel-environment #LinuxGet the devel-environment #Linux
☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:☆ Download VeriFast, unzip it and set PATH:
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly.tar.gz
$�tar�xf�verifast-nightly.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly.tar.gz
$�tar�xf�verifast-nightly.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly.tar.gz
$�tar�xf�verifast-nightly.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly.tar.gz
$�tar�xf�verifast-nightly.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
$�wget�
http://82076e0e62875f063ae8-929808a701855dfb71539d0a4342d4be.r54.cf5.rackcdn.
com/verifast-nightly.tar.gz
$�tar�xf�verifast-nightly.tar.gz
$�mv�verifast-*/�verifast
$�export�PATH=`pwd`/verifast/bin:$PATH
☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:☆ Checkout custom ChibiOS/RT source code:
$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git$�git�clone�https://github.com/fpiot/chibios-verifast.git
11. Build a ChibiOS applicationBuild a ChibiOS applicationBuild a ChibiOS applicationBuild a ChibiOS applicationBuild a ChibiOS application
☆ Finally build the code:☆ Finally build the code:☆ Finally build the code:☆ Finally build the code:☆ Finally build the code:
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make
13. What's STM32?What's STM32?What's STM32?What's STM32?What's STM32?
http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-
arm-cortex-mcus.html
http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-
arm-cortex-mcus.html
http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-
arm-cortex-mcus.html
http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-
arm-cortex-mcus.html
http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-
arm-cortex-mcus.html
The STM32 family of 32-bit Flash microcontrollers
based on the ARM Cortex-M processor is designed
to offer new degrees of freedom to MCU users. It
offers a 32-bit product range that combines very
high performance, real-time capabilities, digital
signal processing, and low-power, low-voltage
operation, while maintaining full integration and
ease of development.
The STM32 family of 32-bit Flash microcontrollers
based on the ARM Cortex-M processor is designed
to offer new degrees of freedom to MCU users. It
offers a 32-bit product range that combines very
high performance, real-time capabilities, digital
signal processing, and low-power, low-voltage
operation, while maintaining full integration and
ease of development.
The STM32 family of 32-bit Flash microcontrollers
based on the ARM Cortex-M processor is designed
to offer new degrees of freedom to MCU users. It
offers a 32-bit product range that combines very
high performance, real-time capabilities, digital
signal processing, and low-power, low-voltage
operation, while maintaining full integration and
ease of development.
The STM32 family of 32-bit Flash microcontrollers
based on the ARM Cortex-M processor is designed
to offer new degrees of freedom to MCU users. It
offers a 32-bit product range that combines very
high performance, real-time capabilities, digital
signal processing, and low-power, low-voltage
operation, while maintaining full integration and
ease of development.
The STM32 family of 32-bit Flash microcontrollers
based on the ARM Cortex-M processor is designed
to offer new degrees of freedom to MCU users. It
offers a 32-bit product range that combines very
high performance, real-time capabilities, digital
signal processing, and low-power, low-voltage
operation, while maintaining full integration and
ease of development.
14. You can free to get own STM32 board!You can free to get own STM32 board!You can free to get own STM32 board!You can free to get own STM32 board!You can free to get own STM32 board!
https://developer.mbed.org/platforms/ST-Nucleo-F091RC/https://developer.mbed.org/platforms/ST-Nucleo-F091RC/https://developer.mbed.org/platforms/ST-Nucleo-F091RC/https://developer.mbed.org/platforms/ST-Nucleo-F091RC/https://developer.mbed.org/platforms/ST-Nucleo-F091RC/
☆ "NUCLEO-F091RC"☆ "NUCLEO-F091RC"☆ "NUCLEO-F091RC"☆ "NUCLEO-F091RC"☆ "NUCLEO-F091RC"
☆ ARM Cortex-M0 CPU / 256 KB Flash / 32 KB SRAM☆ ARM Cortex-M0 CPU / 256 KB Flash / 32 KB SRAM☆ ARM Cortex-M0 CPU / 256 KB Flash / 32 KB SRAM☆ ARM Cortex-M0 CPU / 256 KB Flash / 32 KB SRAM☆ ARM Cortex-M0 CPU / 256 KB Flash / 32 KB SRAM
☆ ADC / DAC / RTC / I2C / USART / SPI / CAN / HDMI
CEC
☆ ADC / DAC / RTC / I2C / USART / SPI / CAN / HDMI
CEC
☆ ADC / DAC / RTC / I2C / USART / SPI / CAN / HDMI
CEC
☆ ADC / DAC / RTC / I2C / USART / SPI / CAN / HDMI
CEC
☆ ADC / DAC / RTC / I2C / USART / SPI / CAN / HDMI
CEC
☆ Able to download fiwmware and debug it using
GDB
☆ Able to download fiwmware and debug it using
GDB
☆ Able to download fiwmware and debug it using
GDB
☆ Able to download fiwmware and debug it using
GDB
☆ Able to download fiwmware and debug it using
GDB
☆ Thanks a lot, STMicroelectronics!☆ Thanks a lot, STMicroelectronics!☆ Thanks a lot, STMicroelectronics!☆ Thanks a lot, STMicroelectronics!☆ Thanks a lot, STMicroelectronics!
15. How to run application? #WindowsHow to run application? #WindowsHow to run application? #WindowsHow to run application? #WindowsHow to run application? #Windows
☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable
☆ Open cygwin terminal, kick "st-util":☆ Open cygwin terminal, kick "st-util":☆ Open cygwin terminal, kick "st-util":☆ Open cygwin terminal, kick "st-util":☆ Open cygwin terminal, kick "st-util":
$�(cd�/usr/local/lib�&&�st-util)$�(cd�/usr/local/lib�&&�st-util)$�(cd�/usr/local/lib�&&�st-util)$�(cd�/usr/local/lib�&&�st-util)$�(cd�/usr/local/lib�&&�st-util)
☆ Open another cygwin terminal, and dowload
application into the board:
☆ Open another cygwin terminal, and dowload
application into the board:
☆ Open another cygwin terminal, and dowload
application into the board:
☆ Open another cygwin terminal, and dowload
application into the board:
☆ Open another cygwin terminal, and dowload
application into the board:
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
16. How to run application? #WindowsHow to run application? #WindowsHow to run application? #WindowsHow to run application? #WindowsHow to run application? #Windows
☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:
(gdb)�c(gdb)�c(gdb)�c(gdb)�c(gdb)�c
☆ Open serial console using TeraTerm with baud
rate 38400
☆ Open serial console using TeraTerm with baud
rate 38400
☆ Open serial console using TeraTerm with baud
rate 38400
☆ Open serial console using TeraTerm with baud
rate 38400
☆ Open serial console using TeraTerm with baud
rate 38400
☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board
17. How to run application? #MacOSHow to run application? #MacOSHow to run application? #MacOSHow to run application? #MacOSHow to run application? #MacOS
☆ Connect the board to your Mac using USB cable☆ Connect the board to your Mac using USB cable☆ Connect the board to your Mac using USB cable☆ Connect the board to your Mac using USB cable☆ Connect the board to your Mac using USB cable
☆ Kick "st-util":☆ Kick "st-util":☆ Kick "st-util":☆ Kick "st-util":☆ Kick "st-util":
$�st-util$�st-util$�st-util$�st-util$�st-util
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
18. How to run application? #MacOSHow to run application? #MacOSHow to run application? #MacOSHow to run application? #MacOSHow to run application? #MacOS
☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:
(gdb)�c(gdb)�c(gdb)�c(gdb)�c(gdb)�c
☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:
$�picocom�-b�38400�/dev/tty.usbmodem1423$�picocom�-b�38400�/dev/tty.usbmodem1423$�picocom�-b�38400�/dev/tty.usbmodem1423$�picocom�-b�38400�/dev/tty.usbmodem1423$�picocom�-b�38400�/dev/tty.usbmodem1423
☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board
19. How to run application? #LinuxHow to run application? #LinuxHow to run application? #LinuxHow to run application? #LinuxHow to run application? #Linux
☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable☆ Connect the board to your PC using USB cable
☆ Kick "st-util":☆ Kick "st-util":☆ Kick "st-util":☆ Kick "st-util":☆ Kick "st-util":
$�sudo�st-util$�sudo�st-util$�sudo�st-util$�sudo�st-util$�sudo�st-util
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
☆ Open another terminal, and download
application into the board:
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�gdbwrite
20. How to run application? #LinuxHow to run application? #LinuxHow to run application? #LinuxHow to run application? #LinuxHow to run application? #Linux
☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:☆ Continue application from GDB prompt:
(gdb)�c(gdb)�c(gdb)�c(gdb)�c(gdb)�c
☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:☆ Open another terminal, and open serial console:
$�picocom�-b�38400�/dev/ttyACM0$�picocom�-b�38400�/dev/ttyACM0$�picocom�-b�38400�/dev/ttyACM0$�picocom�-b�38400�/dev/ttyACM0$�picocom�-b�38400�/dev/ttyACM0
☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board☆ Push "USER" button on the board
21. Do you see test log of ChibiOS?Do you see test log of ChibiOS?Do you see test log of ChibiOS?Do you see test log of ChibiOS?Do you see test log of ChibiOS?
☆ You will see following log on serial console:☆ You will see following log on serial console:☆ You will see following log on serial console:☆ You will see following log on serial console:☆ You will see following log on serial console:
***�ChibiOS/RT�test�suite
***
***�Kernel:�������3.1.5
***�Compiled:�����Jan�15�2017�-�20:38:01
***�Compiler:�����GCC�4.8.4�20140725�(release)�[ARM/embedded-4_8-branch�
revision�213147]
***�Architecture:�ARMv6-M
***�Core�Variant:�Cortex-M0
***�Port�Info:����Preemption�through�NMI
***�Platform:�����STM32F091xC�Entry�Level�Access�Line�devices
***�Test�Board:���STMicroelectronics�NUCLEO-F091RC
***�ChibiOS/RT�test�suite
***
***�Kernel:�������3.1.5
***�Compiled:�����Jan�15�2017�-�20:38:01
***�Compiler:�����GCC�4.8.4�20140725�(release)�[ARM/embedded-4_8-branch�
revision�213147]
***�Architecture:�ARMv6-M
***�Core�Variant:�Cortex-M0
***�Port�Info:����Preemption�through�NMI
***�Platform:�����STM32F091xC�Entry�Level�Access�Line�devices
***�Test�Board:���STMicroelectronics�NUCLEO-F091RC
***�ChibiOS/RT�test�suite
***
***�Kernel:�������3.1.5
***�Compiled:�����Jan�15�2017�-�20:38:01
***�Compiler:�����GCC�4.8.4�20140725�(release)�[ARM/embedded-4_8-branch�
revision�213147]
***�Architecture:�ARMv6-M
***�Core�Variant:�Cortex-M0
***�Port�Info:����Preemption�through�NMI
***�Platform:�����STM32F091xC�Entry�Level�Access�Line�devices
***�Test�Board:���STMicroelectronics�NUCLEO-F091RC
***�ChibiOS/RT�test�suite
***
***�Kernel:�������3.1.5
***�Compiled:�����Jan�15�2017�-�20:38:01
***�Compiler:�����GCC�4.8.4�20140725�(release)�[ARM/embedded-4_8-branch�
revision�213147]
***�Architecture:�ARMv6-M
***�Core�Variant:�Cortex-M0
***�Port�Info:����Preemption�through�NMI
***�Platform:�����STM32F091xC�Entry�Level�Access�Line�devices
***�Test�Board:���STMicroelectronics�NUCLEO-F091RC
***�ChibiOS/RT�test�suite
***
***�Kernel:�������3.1.5
***�Compiled:�����Jan�15�2017�-�20:38:01
***�Compiler:�����GCC�4.8.4�20140725�(release)�[ARM/embedded-4_8-branch�
revision�213147]
***�Architecture:�ARMv6-M
***�Core�Variant:�Cortex-M0
***�Port�Info:����Preemption�through�NMI
***�Platform:�����STM32F091xC�Entry�Level�Access�Line�devices
***�Test�Board:���STMicroelectronics�NUCLEO-F091RC
23. What's VeriFast?What's VeriFast?What's VeriFast?What's VeriFast?What's VeriFast?
☆ https://github.com/verifast/verifast☆ https://github.com/verifast/verifast☆ https://github.com/verifast/verifast☆ https://github.com/verifast/verifast☆ https://github.com/verifast/verifast
☆ A verifier for single-threaded and multithreaded
C language programs annotated with
preconditions and postconditions written in
separation logic.
☆ A verifier for single-threaded and multithreaded
C language programs annotated with
preconditions and postconditions written in
separation logic.
☆ A verifier for single-threaded and multithreaded
C language programs annotated with
preconditions and postconditions written in
separation logic.
☆ A verifier for single-threaded and multithreaded
C language programs annotated with
preconditions and postconditions written in
separation logic.
☆ A verifier for single-threaded and multithreaded
C language programs annotated with
preconditions and postconditions written in
separation logic.
☆ VeriFast is easy to use with the graphical IDE.☆ VeriFast is easy to use with the graphical IDE.☆ VeriFast is easy to use with the graphical IDE.☆ VeriFast is easy to use with the graphical IDE.☆ VeriFast is easy to use with the graphical IDE.
24. How to verify C code using VeriFast?How to verify C code using VeriFast?How to verify C code using VeriFast?How to verify C code using VeriFast?How to verify C code using VeriFast?
Please read VeriFast Tutorial:Please read VeriFast Tutorial:Please read VeriFast Tutorial:Please read VeriFast Tutorial:Please read VeriFast Tutorial:
☆ English:☆ English:☆ English:☆ English:☆ English:
https://people.cs.kuleuven.be/~bart.jacobs/verifast/tutorial.pdfhttps://people.cs.kuleuven.be/~bart.jacobs/verifast/tutorial.pdfhttps://people.cs.kuleuven.be/~bart.jacobs/verifast/tutorial.pdfhttps://people.cs.kuleuven.be/~bart.jacobs/verifast/tutorial.pdfhttps://people.cs.kuleuven.be/~bart.jacobs/verifast/tutorial.pdf
☆ Japanese:☆ Japanese:☆ Japanese:☆ Japanese:☆ Japanese:
https://github.com/jverifast-ug/translate/blob/master/Manual/Tutorial/
Tutorial.md
https://github.com/jverifast-ug/translate/blob/master/Manual/Tutorial/
Tutorial.md
https://github.com/jverifast-ug/translate/blob/master/Manual/Tutorial/
Tutorial.md
https://github.com/jverifast-ug/translate/blob/master/Manual/Tutorial/
Tutorial.md
https://github.com/jverifast-ug/translate/blob/master/Manual/Tutorial/
Tutorial.md
25. How to verify application?How to verify application?How to verify application?How to verify application?How to verify application?
Simply kick GNU make on your terminal:Simply kick GNU make on your terminal:Simply kick GNU make on your terminal:Simply kick GNU make on your terminal:Simply kick GNU make on your terminal:
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�vfide
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�vfide
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�vfide
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�vfide
$�cd�chibios-verifast/verifast_demo/STM32/RT-STM32F091RC-NUCLEO
$�make�vfide
26. What should be verified on ChibiOS?What should be verified on ChibiOS?What should be verified on ChibiOS?What should be verified on ChibiOS?What should be verified on ChibiOS?
☆ ChibiOS has own system states☆ ChibiOS has own system states☆ ChibiOS has own system states☆ ChibiOS has own system states☆ ChibiOS has own system states
27. The state chart means...The state chart means...The state chart means...The state chart means...The state chart means...
☆ Application start at "Init" state☆ Application start at "Init" state☆ Application start at "Init" state☆ Application start at "Init" state☆ Application start at "Init" state
☆ Change into "HALInited" state calling halInit()☆ Change into "HALInited" state calling halInit()☆ Change into "HALInited" state calling halInit()☆ Change into "HALInited" state calling halInit()☆ Change into "HALInited" state calling halInit()
☆ Change into "Thread" state calling chSysInit()☆ Change into "Thread" state calling chSysInit()☆ Change into "Thread" state calling chSysInit()☆ Change into "Thread" state calling chSysInit()☆ Change into "Thread" state calling chSysInit()
☆ You can call some ChibiOS API on "Thread" state☆ You can call some ChibiOS API on "Thread" state☆ You can call some ChibiOS API on "Thread" state☆ You can call some ChibiOS API on "Thread" state☆ You can call some ChibiOS API on "Thread" state
But run-time error is caused by violation. We would
like to capture it on verification using VeriFast.
But run-time error is caused by violation. We would
like to capture it on verification using VeriFast.
But run-time error is caused by violation. We would
like to capture it on verification using VeriFast.
But run-time error is caused by violation. We would
like to capture it on verification using VeriFast.
But run-time error is caused by violation. We would
like to capture it on verification using VeriFast.
31. Then you will see error on verificationThen you will see error on verificationThen you will see error on verificationThen you will see error on verificationThen you will see error on verification
32. HomeworkHomeworkHomeworkHomeworkHomework
☆ Verify ChibiOS/RT thread blinking LED☆ Verify ChibiOS/RT thread blinking LED☆ Verify ChibiOS/RT thread blinking LED☆ Verify ChibiOS/RT thread blinking LED☆ Verify ChibiOS/RT thread blinking LED
☆ Verify chEvtBroadcastI() which can be call from
I-Locked or S-Locked state
☆ Verify chEvtBroadcastI() which can be call from
I-Locked or S-Locked state
☆ Verify chEvtBroadcastI() which can be call from
I-Locked or S-Locked state
☆ Verify chEvtBroadcastI() which can be call from
I-Locked or S-Locked state
☆ Verify chEvtBroadcastI() which can be call from
I-Locked or S-Locked state
http://chibios.sourceforge.net/html/
group__events.html#ga0c3fcdef2ba14d8b6b6da5aa4113f18b
http://chibios.sourceforge.net/html/
group__events.html#ga0c3fcdef2ba14d8b6b6da5aa4113f18b
http://chibios.sourceforge.net/html/
group__events.html#ga0c3fcdef2ba14d8b6b6da5aa4113f18b
http://chibios.sourceforge.net/html/
group__events.html#ga0c3fcdef2ba14d8b6b6da5aa4113f18b
http://chibios.sourceforge.net/html/
group__events.html#ga0c3fcdef2ba14d8b6b6da5aa4113f18b
☆ Verify following more complex application:☆ Verify following more complex application:☆ Verify following more complex application:☆ Verify following more complex application:☆ Verify following more complex application:
chibios-verifast/ChibiOS_16.1.6/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-
FATFS-USB
chibios-verifast/ChibiOS_16.1.6/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-
FATFS-USB
chibios-verifast/ChibiOS_16.1.6/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-
FATFS-USB
chibios-verifast/ChibiOS_16.1.6/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-
FATFS-USB
chibios-verifast/ChibiOS_16.1.6/demos/STM32/RT-STM32F746G-DISCOVERY-LWIP-
FATFS-USB
33. Special thanksSpecial thanksSpecial thanksSpecial thanksSpecial thanks
☆ STMicroelectronics provides STM32 boards.☆ STMicroelectronics provides STM32 boards.☆ STMicroelectronics provides STM32 boards.☆ STMicroelectronics provides STM32 boards.☆ STMicroelectronics provides STM32 boards.
☆ Eiwa System Management, Inc. provides this
meeting room.
☆ Eiwa System Management, Inc. provides this
meeting room.
☆ Eiwa System Management, Inc. provides this
meeting room.
☆ Eiwa System Management, Inc. provides this
meeting room.
☆ Eiwa System Management, Inc. provides this
meeting room.
☆ @ruicc supports around MacOS environment.☆ @ruicc supports around MacOS environment.☆ @ruicc supports around MacOS environment.☆ @ruicc supports around MacOS environment.☆ @ruicc supports around MacOS environment.
☆ @eldesh supports around Windows
environment, and gives advice usage of VeriFast.
☆ @eldesh supports around Windows
environment, and gives advice usage of VeriFast.
☆ @eldesh supports around Windows
environment, and gives advice usage of VeriFast.
☆ @eldesh supports around Windows
environment, and gives advice usage of VeriFast.
☆ @eldesh supports around Windows
environment, and gives advice usage of VeriFast.