{"id":32,"date":"2025-05-24T21:48:45","date_gmt":"2025-05-24T21:48:45","guid":{"rendered":"https:\/\/blog.ganji.dev\/?p=32"},"modified":"2025-05-24T21:48:45","modified_gmt":"2025-05-24T21:48:45","slug":"how-to-run-rtems-blinky-on-stm32f4","status":"publish","type":"post","link":"https:\/\/blog.ganji.dev\/?p=32","title":{"rendered":"How to run RTEMS Blinky on STM32F4"},"content":{"rendered":"\n<p>In this post, I want to share with you my experience in running RTEMS 7.0 on my STM32F4(something) board.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step1: Building the BSP<\/h2>\n\n\n\n<p>You need to obtain the bsp source code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git clone https:\/\/gitlab.rtems.org\/rtems\/tools\/rtems-source-builder.git rsb\n$ cd rsb\/rtems<\/code><\/pre>\n\n\n\n<p>Then choose an installation prefix (see the <a href=\"https:\/\/docs.rtems.org\/docs\/main\/user\/start\/prefixes.html\">official docs<\/a>). The STM32 is using Arm architecture, so we need to find that in the list of build sets and then: (In my case it&#8217;s 7\/rtems-arm.bset)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ..\/source-builder\/sb-set-builder --prefix=$HOME\/arm 7\/rtems-arm.bset<\/code><\/pre>\n\n\n\n<p>Now you should see the success output.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step2: Building the App<\/h2>\n\n\n\n<p>We can use the <code>rtems-examples<\/code> repo to build a simple blinky app into the board.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git clone https:\/\/gitlab.rtems.org\/rtems\/rtos\/rtems-examples\n$ cd rtems-examples\/led\/delay<\/code><\/pre>\n\n\n\n<p>Finally, download and configure waf, according to your target:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl https:\/\/waf.io\/waf-2.0.19 > waf\n$ chmod +x waf\n$ git init\n$ git submodule add https:\/\/gitlab.rtems.org\/rtems\/tools\/rtems_waf.git rtems_waf\n$ .\/waf configure --prefix=$HOME\/arm --rtems-bsps=arm\/stm32f4\n$ .\/waf <\/code><\/pre>\n\n\n\n<p>After running waf, you should see the <code>'build-arm-rtems7-stm32f4' finished successfully<\/code> message.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step3: Program into the board<\/h2>\n\n\n\n<p>I use <a href=\"https:\/\/www.st.com\/en\/development-tools\/stm32cubeprog.html\">CubeProgrammer<\/a> to program the app into the board. First, we need to convert it to bin:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ arm-rtems7-objcopy -O binary build\/arm-rtems7-stm32f4\/delay.exe app.bin<\/code><\/pre>\n\n\n\n<p>And finally, select the <code>app.bin<\/code> in the CubeProgrammer and start the app!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"893\" height=\"336\" src=\"https:\/\/blog.ganji.dev\/wp-content\/uploads\/2025\/05\/Screenshot_20250524_153535.png\" alt=\"\" class=\"wp-image-41\" srcset=\"https:\/\/blog.ganji.dev\/wp-content\/uploads\/2025\/05\/Screenshot_20250524_153535.png 893w, https:\/\/blog.ganji.dev\/wp-content\/uploads\/2025\/05\/Screenshot_20250524_153535-300x113.png 300w, https:\/\/blog.ganji.dev\/wp-content\/uploads\/2025\/05\/Screenshot_20250524_153535-768x289.png 768w\" sizes=\"auto, (max-width: 893px) 100vw, 893px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I want to share with you my experience in running RTEMS 7.0 on my STM32F4(something) board. Step1: Building the BSP You need to obtain the bsp source code: Then choose an installation prefix (see the official docs). The STM32 is using Arm architecture, so we need to find that in the list [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-gsoc"],"_links":{"self":[{"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32"}],"version-history":[{"count":10,"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":43,"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=\/wp\/v2\/posts\/32\/revisions\/43"}],"wp:attachment":[{"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ganji.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}