{"id":7713,"date":"2022-04-09T09:10:36","date_gmt":"2022-04-09T07:10:36","guid":{"rendered":"https:\/\/playembedded.org\/?p=7713"},"modified":"2024-02-04T13:05:49","modified_gmt":"2024-02-04T12:05:49","slug":"getting-started-chibios-sdp-k1","status":"publish","type":"post","link":"https:\/\/playembedded.org\/blog\/getting-started-chibios-sdp-k1\/","title":{"rendered":"Getting started with ChibiOS using the SDP-K1"},"content":{"rendered":"<p>In this article, we will delve into the world of <a href=\"http:\/\/www.chibios.org\" data-type=\"URL\" data-id=\"www.chibios.org\">ChibiOS<\/a> and explore how to take the first steps with the open-source project using the <a href=\"https:\/\/www.analog.com\/en\/design-center\/evaluation-hardware-and-software\/evaluation-boards-kits\/sdp-k1.html\">Analog Devices EVAL-SDP-CK1Z<\/a>, also known as the SDP-K1 controller board. ChibiOS is a comprehensive open-source project that centers around <a href=\"https:\/\/www.chibios.org\/dokuwiki\/doku.php?id=chibios:products:rt:start\" data-type=\"URL\" data-id=\"https:\/\/www.chibios.org\/dokuwiki\/doku.php?id=chibios:products:rt:start\">ChibiOS\/RT<\/a>, a Real-Time Operating System (RTOS) that provides a wide range of utilities for implementing various applications, and  <a href=\"https:\/\/www.chibios.org\/dokuwiki\/doku.php?id=chibios:products:hal:start\">ChibiOS\/HAL<\/a>, a set of device drivers that enable the use of multiple MCU peripherals, such as GPIO, UART, SPI, and I2C.<\/p>\n\n\n\n<p>Learning how to use ChibiOS is incredibly beneficial, as it allows for the implementation of a diverse range of applications, from simple educational projects to commercial products. Additionally, ChibiOS\/HAL excels in making the application independent of the MCU in use. This means that it is possible to port an application from one development board to another in just a matter of minutes.<\/p>\n\n\n\n<p>The choice of the SDP-K1 controller board was mainly driven by the combination of a well-designed STM32F469 microcontroller and the ADI 120-pin connector that allows for interfacing with hundreds of Analog Devices evaluation boards.<\/p>\n\n\n\n<p>For those new to the world of microcontrollers, our article <a href=\"https:\/\/playembedded.org\/microcontrollers-101\">Microcontroller 101<\/a> will provide answers to common questions such as &ldquo;what is a microcontroller,&rdquo; &ldquo;why use one,&rdquo; and &ldquo;how do they work&rdquo;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading level_1\" id=\"1_Hardware_documentation\">Hardware documentation<\/h2>\n\n\n\n<p>Since we&rsquo;ll be working with this board extensively, it&rsquo;s important to gather all the necessary documentation for both the board and microcontroller and keep it easily accessible. Here are the documents typically needed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <a rel=\"noreferrer noopener\" href=\"https:\/\/www.st.com\/resource\/en\/datasheet\/stm32f469ni.pdf\" target=\"_blank\">datasheet <\/a>and <a href=\"https:\/\/www.st.com\/resource\/en\/reference_manual\/rm0386-stm32f469xx-and-stm32f479xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf\">reference manual<\/a> for the microcontroller being used (STM32F469NI)<\/li>\n\n\n\n<li>The <a href=\"https:\/\/www.analog.com\/media\/en\/technical-documentation\/eval-board-schematic\/eval-sdp-ck1z-rev-e-schematic.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Schematic of the SDP-K1 Rev E<\/a> board<\/li>\n\n\n\n<li>Additionally, a useful reference is the drawing we created that maps out each pin of the Arduino Connector on the SDP-K1 to the corresponding GPIO of the STM32F469.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"1024\" src=\"https:\/\/playembedded.org\/wp-content\/uploads\/2023\/03\/EVAL-SDP-K1-Pinout-935x1024.png\" alt=\"\" class=\"wp-image-8853\" srcset=\"https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2023\/03\/EVAL-SDP-K1-Pinout-935x1024.png 935w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2023\/03\/EVAL-SDP-K1-Pinout-274x300.png 274w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2023\/03\/EVAL-SDP-K1-Pinout-137x150.png 137w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2023\/03\/EVAL-SDP-K1-Pinout-1200x1314.png 1200w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2023\/03\/EVAL-SDP-K1-Pinout.png 1284w\" sizes=\"auto, (max-width: 935px) 100vw, 935px\"><figcaption class=\"wp-element-caption\">The Pinout map of the Analog Devices EVAL-SDP-CKZ1 (SDP-K1)<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading level_1\" id=\"2_Setting_up_the_toolchain\">Setting up the toolchain<\/h2>\n\n\n\n<p>The initial step in getting started with ChibiOS is setting up the toolchain. There are two options available for this: <a href=\"https:\/\/playembedded.org\/assembling-chibistudio-from-scratch\/\" data-type=\"post\" data-id=\"6896\">assemble your toolchain from scratch<\/a> by downloading and configuring each component individually or download ChibiStudio, a preassembled toolchain in a single zip file. To do so:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Get the last release of ChibiStudio from the&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/www.chibios.org\/dokuwiki\/doku.php?id=chibios:products:chibistudio:start\" target=\"_blank\">Official page of ChibiStudio<\/a><\/li>\n\n\n\n<li>Extract the files under&nbsp;<strong>C:\\<\/strong>&nbsp;using 7zip<\/li>\n\n\n\n<li>Copy the link &ldquo;Chibi Studio GCC x.x&rdquo; on the desktop and use it to launch the toolchain.<\/li>\n<\/ol>\n\n\n\n<p>For more detailed instructions or troubleshooting assistance, refer to the guide on<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/playembedded.org\/how-to-setup-chibistudio\/\" data-type=\"post\" data-id=\"7151\">How to setup ChibiStudio<\/a><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading level_2\" id=\"3_First_flash_and_run\">First flash and run<\/h3>\n\n\n\n<p>Upon the initial launch of ChibiStudio, the toolchain will appear as shown in the image.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1389\" height=\"935\" src=\"https:\/\/playembedded.org\/wp-content\/uploads\/2022\/04\/ChibiStudio-First-Launch.png\" alt=\"\" class=\"wp-image-10252\" srcset=\"https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/ChibiStudio-First-Launch.png 1389w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/ChibiStudio-First-Launch-300x202.png 300w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/ChibiStudio-First-Launch-1024x689.png 1024w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/ChibiStudio-First-Launch-150x101.png 150w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/ChibiStudio-First-Launch-1200x808.png 1200w\" sizes=\"auto, (max-width: 1389px) 100vw, 1389px\"><figcaption class=\"wp-element-caption\">A screenshot of ChibiStudio at the first launch<\/figcaption><\/figure>\n<\/div>\n\n\n<p>The title bar in the image indicates that the version of ChibiStudio being used is 2022-01, the version of ChibiOS is 21.11.x and the active workspace is &ldquo;Workspace User.&rdquo; One of the first tasks that may be desired is to import a project for the SDP-K1, which can be found at <em>C:\\ChibiStudio\\chibios2111\\demos\\STM32\\RT-STM32F469I-EVAL-SDP-CK1Z<\/em>. Instructions on how to import the project can be found (<a href=\"https:\/\/playembedded.org\/how-to-import-a-project\/\" data-type=\"post\" data-id=\"7382\">here<\/a>).<\/p>\n\n\n\n<p>A few remarks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ChibiStudio offers various versions of ChibiOS and allows users to switch between them. <\/li>\n\n\n\n<li>The current workspace is using ChibiOS 21.11.x, and projects should be selected from the folder <em>C:\\ChibiStudio\\chibios2111<\/em>. <\/li>\n\n\n\n<li>The demos folder, located at <em>C:\\ChibiStudio\\chibiosxxx\\demos<\/em>, contains a variety of demos for different microcontrollers and boards. <\/li>\n\n\n\n<li>The name <strong>RT-STM32F469I-EVAL-SDP-CK1Z<\/strong> indicates that the demo uses ChibiOS\\RT configured for the <strong>STM32F469I<\/strong> microcontroller on the <strong>EVAL-SDP-CK1Z<\/strong> board.<\/li>\n<\/ul>\n\n\n\n<p>After importing the project, you must build it, then flash the firmware to the SDP-K1 and run it. The steps to do this are outlined in the following How-tos:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><a href=\"https:\/\/playembedded.org\/how-to-build-a-project\/\" data-type=\"post\" data-id=\"7372\">How to build a project in ChibiStudio<\/a><br><a href=\"https:\/\/playembedded.org\/flash-run\/\" data-type=\"post\" data-id=\"7302\">How to Flash &amp; Run a project in ChibiStudio<\/a><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading level_1\" id=\"4_Verifying_the_success_of_ChibiStudio_s_setup\">Verifying the success of ChibiStudio&rsquo;s setup<\/h2>\n\n\n\n<p>The default demo for the SDP-K1 demo performs two tasks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>blink the board LEDs following a specific sequence<\/li>\n\n\n\n<li>launch the test suite if the pin A0 of the SKD-K1 is grounded and output the results on the CMSIS-DAP serial<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading level_2\" id=\"5_LED_blinker\">LED blinker<\/h3>\n\n\n\n<p>The most effective way to confirm that the setup has been completed successfully is to flash and run the firmware, resume the execution, and ensure that the board&rsquo;s LEDs blink in the sequence shown in the accompanying video.<\/p>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video height=\"602\" style=\"aspect-ratio: 770 \/ 602;\" width=\"770\" autoplay loop muted preload=\"auto\" src=\"https:\/\/playembedded.org\/wp-content\/uploads\/2022\/04\/SDP-K1-blinking.mp4\"><\/video><figcaption class=\"wp-element-caption\">A video of the main ChibiOS demo running on the SDP-K1<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading level_2\" id=\"6_Test_suite\">Test suite<\/h3>\n\n\n\n<p>The ChibiOS Test Suite runs tests related to the operating system and displays the results on the CMSIS-DAP serial port. It can be used to verify that the operating system functions correctly on the board or to confirm that the correct firmware has been loaded onto it.<\/p>\n\n\n\n<p>To view the output of the Test Suite, the CMSIS-DAP serial port must be identified. Note that Windows assigns the serial port and it may change if the board is connected to a different USB hub. It&rsquo;s recommended to check the assigned serial port for the DAP. To do so, open the Device Manager and navigate to the Ports (COM &amp; LPT) section. Check the list when the SDP-K1 is connected and disconnected to identify the COM port assigned to the CMSIS DAP.<\/p>\n\n\n\n<figure class=\"wp-block-jetpack-image-compare\"><div class=\"juxtapose\" data-mode=\"horizontal\"><img loading=\"lazy\" decoding=\"async\" id=\"8332\" src=\"https:\/\/i0.wp.com\/playembedded.org\/wp-content\/uploads\/2023\/01\/Device-Manager-without-SDP-K1-PE.png?ssl=1\" alt=\"\" width=\"782\" height=\"572\" class=\"image-compare__image-before\"><img loading=\"lazy\" decoding=\"async\" id=\"8331\" src=\"https:\/\/i1.wp.com\/playembedded.org\/wp-content\/uploads\/2023\/01\/Device-Manager-with-SDP-K1-PE.png?ssl=1\" alt=\"\" width=\"783\" height=\"573\" class=\"image-compare__image-after\"><\/div><figcaption>Comparison of the Device Manager between when the SDP-K1 is not connected and when it is connected<\/figcaption><\/figure>\n\n\n\n<p>At this point, from the debug perspective of ChibiStudio, we have to open the Terminal. To do so:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Click on the Terminal tab and click on the Open Terminal button<\/li>\n\n\n\n<li>Choose the Serial Terminal<\/li>\n\n\n\n<li>Configure it for using the CMSIS DAP COM port, 38400, 8-bit, no parity 1 Stop bit<\/li>\n\n\n\n<li>Choose ok<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"949\" src=\"https:\/\/playembedded.org\/wp-content\/uploads\/2022\/04\/Launching-the-Serial-Terminal-PE-1024x949.png\" alt=\"\" class=\"wp-image-8334\" srcset=\"https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/Launching-the-Serial-Terminal-PE-1024x949.png 1024w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/Launching-the-Serial-Terminal-PE-300x278.png 300w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/Launching-the-Serial-Terminal-PE-150x139.png 150w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/Launching-the-Serial-Terminal-PE.png 1124w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><figcaption class=\"wp-element-caption\">How to start the terminal in ChibiStudio<\/figcaption><\/figure>\n<\/div>\n\n\n<p>At this point with a jumper cable short A0 to GND for more than half a second and you will see the output of the Test Suite in the terminal window.<\/p>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-autoplay=\"true\" data-delay=\"3\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"600\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-7832\" data-id=\"7832\" src=\"https:\/\/playembedded.org\/wp-content\/uploads\/2022\/04\/SDP-K1-A0-to-GND.jpg\" srcset=\"https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/SDP-K1-A0-to-GND.jpg 450w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/SDP-K1-A0-to-GND-225x300.jpg 225w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/SDP-K1-A0-to-GND-113x150.jpg 113w\" sizes=\"(max-width: 450px) 100vw, 450px\"><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Shorting the Arduino A0 pin to ground<\/figcaption><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"585\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-7833\" data-id=\"7833\" src=\"https:\/\/playembedded.org\/wp-content\/uploads\/2022\/04\/Test-suite-SDP-K1.png\" srcset=\"https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/Test-suite-SDP-K1.png 712w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/Test-suite-SDP-K1-300x246.png 300w, https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/Test-suite-SDP-K1-150x123.png 150w\" sizes=\"(max-width: 712px) 100vw, 712px\"><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Screenshot of the ChibiOS Test Suite running on the SDP-K1<\/figcaption><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading level_1\" id=\"7_Next_steps\">Next steps<\/h2>\n\n\n\n<p>In conclusion, it is recommended not to alter the default project as it can be used as a template in the future. A useful next step would be to <a href=\"https:\/\/playembedded.org\/how-to-duplicate-a-project\/\" data-type=\"post\" data-id=\"7315\">duplicate the initial project<\/a> and experiment with modifying the LED blinking thread to observe the effects on blink timing.<\/p>\n\n\n\n<p>Familiarizing oneself with the ChibiStudio reading <a href=\"https:\/\/playembedded.org\/chibistudio-overview\/\" data-type=\"post\" data-id=\"7580\">ChibiStudio Overview<\/a> can also be beneficial. If you want to skip this overview then the suggested next article will be <a href=\"https:\/\/playembedded.org\/mastering-multithreading-with-chibios-a-beginners-guide\/\" data-type=\"post\" data-id=\"8342\">Mastering multithreading with ChibiOS: a beginner&rsquo;s guide<\/a> where the default demo will be analyzed in detail.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Unlock the power of ChibiOS with the versatile SDP-K1 controller board. Learn to implement a wide range of applications with ease.<\/p>\n","protected":false},"author":3,"featured_media":7853,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1223],"tags":[1293,1302],"coauthors":[241],"class_list":["post-7713","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-getting-started","tag-1293","tag-toolchain","azure"],"views":9218,"jetpack_featured_media_url":"https:\/\/playembedded.org\/blog\/wp-content\/uploads\/2022\/04\/SDP-K1-ChibiOS.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/posts\/7713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/comments?post=7713"}],"version-history":[{"count":0,"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/posts\/7713\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/media\/7853"}],"wp:attachment":[{"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/media?parent=7713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/categories?post=7713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/tags?post=7713"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/playembedded.org\/blog\/wp-json\/wp\/v2\/coauthors?post=7713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}