{"id":1001,"date":"2022-07-22T10:02:37","date_gmt":"2022-07-22T10:02:37","guid":{"rendered":"https:\/\/vegaprocessors.in\/blog\/?p=1001"},"modified":"2023-09-12T04:52:49","modified_gmt":"2023-09-12T04:52:49","slug":"w25q32-spi-flash-with-aries-v2-board","status":"publish","type":"post","link":"https:\/\/vegaprocessors.in\/blog\/w25q32-spi-flash-with-aries-v2-board\/","title":{"rendered":"W25Q32 SPI flash with ARIES V2 Board"},"content":{"rendered":"\n<p>In this tutorial, we will see how we can interface <strong>W25Q32 flash<\/strong> with ARIES V2 board using <strong>SPI protocol<\/strong>. SPI Flash memories provide a storage solution for systems with limited space, pins and power. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">W25Q32 SPI flash<\/h2>\n\n\n\n<p><strong>W25Q32 Flash<\/strong> is 32M Bit Flash memory which operate on a single 2.7V to 3.6V power supply with current consumption as low as 5mA active and 1\u03bcA for power-down. The flash is organized into 16,384 programmable pages of 256-bytes each. Up to 256 bytes can be programmed at a time using the Page Program instructions. Pages can be erased in groups of 16 (sector erase), groups of 128 (32KB block erase), groups of 256 (64KB block erase) or the entire chip (chip erase). The W25Q32 has 1024 erasable sectors and 64 erasable blocks. The small 4KB sectors allow for greater flexibility in applications that require data and parameter storage.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/W25Q32-Large-Capacity-FLASH-Storage-Module-SPI-Interface.jpg\" alt=\"\" class=\"wp-image-1002\" style=\"width:216px;height:212px\" width=\"216\" height=\"212\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/W25Q32-Large-Capacity-FLASH-Storage-Module-SPI-Interface.jpg 457w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/W25Q32-Large-Capacity-FLASH-Storage-Module-SPI-Interface-300x294.jpg 300w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Circuit Diagram<\/h2>\n\n\n\n<p>The W25Q32 has six pins: Vcc, DO,DI,CS,CLK and GND. (<a href=\"https:\/\/www.elinux.org\/images\/f\/f5\/Winbond-w25q32.pdf\">Refer W25Q32 datasheet<\/a>).<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><strong>W25Q32 SPI Flash<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\"><strong>THEJAS SOC<\/strong><\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">Vcc<\/td><td class=\"has-text-align-left\" data-align=\"left\">3.3V<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">CS<\/td><td class=\"has-text-align-left\" data-align=\"left\">SS0<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">DO<\/td><td class=\"has-text-align-left\" data-align=\"left\">MISO0<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">GND<\/td><td class=\"has-text-align-left\" data-align=\"left\">GND<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">CLK<\/td><td class=\"has-text-align-left\" data-align=\"left\">SCLK0<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">DI<\/td><td class=\"has-text-align-left\" data-align=\"left\">MOSI0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Make connections as listed in the above table. Use the diagram given below as reference. Now, for powering up the ARIES v2 board via USB port of a Laptop\/Desktop\/PC and burning the code into the ARIES v2 board, we have to use a micro USB type B to USB type A cable. The cable should be connected to <strong>UART0<\/strong> port of the ARIES v2 board, and the Laptop\/Desktop\/PC should be pre-installed with VEGA SDK and Toolchain.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"993\" height=\"560\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-from-2022-07-20-12-29-38.png\" alt=\"\" class=\"wp-image-1814\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-from-2022-07-20-12-29-38.png 993w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-from-2022-07-20-12-29-38-300x169.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2022\/07\/Screenshot-from-2022-07-20-12-29-38-768x433.png 768w\" sizes=\"auto, (max-width: 993px) 100vw, 993px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Procedure<\/h2>\n\n\n\n<p>After setting up the toolchain and SDK path environments, clean the executable using <strong>make clean<\/strong> command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>cd vega-sdk\/examples\/spi\/w25q32_spi_flash<\/strong><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>make clean<\/strong><\/code><\/pre>\n\n\n\n<p>Build the example program for <strong>W25Q32 Flash<\/strong> by using <strong>make<\/strong> command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>make <\/strong><\/code><\/pre>\n\n\n\n<p>Before transferring the built program to board, ensure that you have connected the UART0 connector of the board to the PC.<\/p>\n\n\n\n<p>Open a new terminal, execute the following command <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo minicom aries<\/strong><\/code><\/pre>\n\n\n\n<p>Now you can see the minicom terminal opened and the board UART terminal is ready.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"689\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-13.png\" alt=\"\" class=\"wp-image-643\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-13.png 820w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-13-300x252.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/05\/minicom-13-768x645.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/figure>\n\n\n\n<p>Use <strong>CTRL+A S<\/strong> to enter file sending menu and select <strong>xmodem<\/strong> by pressing <strong>Enter<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-4.png\" alt=\"\" class=\"wp-image-1004\" style=\"width:764px;height:178px\" width=\"764\" height=\"178\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-4.png 615w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-4-300x70.png 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/figure>\n\n\n\n<p>In the next window, with <strong>space bar<\/strong> select the <strong>w25q32_demo<\/strong>.<strong>bin<\/strong> file to be transferred, by pressing <strong>Enter<\/strong>, transfer process starts.<\/p>\n\n\n\n<p>Wait until the process is completed. The screen should display how much data has been transferred.<\/p>\n\n\n\n<p>After completing transfer the Program will start to execute.<\/p>\n\n\n\n<p>The example program erases the first 256 locations of the FLASH and reads the same location. After erasing, data 00 to 0xFF is written to the same 256 location and reads back the same location. The read data is displayed on minicom UART terminal.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"770\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-5-1024x770.png\" alt=\"\" class=\"wp-image-1005\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-5-1024x770.png 1024w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-5-300x226.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-5-768x578.png 768w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2021\/07\/image-5.png 1198w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will see how we can interface W25Q32 flash with ARIES V2 board using SPI protocol. SPI Flash memories provide a storage solution for systems with limited space, pins and power. W25Q32 SPI flash W25Q32 Flash is 32M Bit Flash memory which operate on a single 2.7V to 3.6V power supply with [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,20,15,18,14,1],"tags":[75,76,7,67,77,26,31,24],"class_list":["post-1001","post","type-post","status-publish","format-standard","hentry","category-application-development","category-general","category-getting-started","category-ide","category-tutorials","category-uncategorized","tag-aries-v2-board","tag-c-dac","tag-cdac","tag-spi","tag-thejas-32","tag-thejas-64","tag-thejas32","tag-vegaprocessor"],"_links":{"self":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/1001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/comments?post=1001"}],"version-history":[{"count":11,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/1001\/revisions"}],"predecessor-version":[{"id":3236,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/1001\/revisions\/3236"}],"wp:attachment":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/media?parent=1001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/categories?post=1001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/tags?post=1001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}