<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pascal &#8211; EXPERTGIG</title>
	<atom:link href="https://expertgig.jp/tag/pascal/feed/" rel="self" type="application/rss+xml" />
	<link>https://expertgig.jp</link>
	<description>工場IoT に特化したシステム開発</description>
	<lastBuildDate>Mon, 06 Apr 2026 04:38:20 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Raspi Zero 2W ベアメタル開発 02 (環境構築～Hello表示編)</title>
		<link>https://expertgig.jp/2025/06/07/raspi-zero-2w-%e3%83%99%e3%82%a2%e3%83%a1%e3%82%bf%e3%83%ab%e9%96%8b%e7%99%ba-02-%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89%ef%bd%9ehello%e8%a1%a8%e7%a4%ba%e7%b7%a8/</link>
					<comments>https://expertgig.jp/2025/06/07/raspi-zero-2w-%e3%83%99%e3%82%a2%e3%83%a1%e3%82%bf%e3%83%ab%e9%96%8b%e7%99%ba-02-%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89%ef%bd%9ehello%e8%a1%a8%e7%a4%ba%e7%b7%a8/#respond</comments>
		
		<dc:creator><![CDATA[Ariyuki Tano]]></dc:creator>
		<pubDate>Fri, 06 Jun 2025 15:08:10 +0000</pubDate>
				<category><![CDATA[IoT関連]]></category>
		<category><![CDATA[マイコン]]></category>
		<category><![CDATA[情報発信基地]]></category>
		<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Lazarus]]></category>
		<category><![CDATA[MZ-80]]></category>
		<category><![CDATA[Pascal]]></category>
		<category><![CDATA[Raspi Zero 2W]]></category>
		<category><![CDATA[Ultibo]]></category>
		<category><![CDATA[Z80]]></category>
		<category><![CDATA[エミュレータ]]></category>
		<guid isPermaLink="false">https://expertgig.jp/?p=6035</guid>

					<description><![CDATA[さて、意を決してから、右往左往して、ようやくHDMI 接続したモニタに文字を表示できましたので、そこまでの手順を手短に解説します。 Ultibo Core のダウンロード Lazarus IDE と統合された Ultib [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>さて、意を決してから、右往左往して、ようやくHDMI 接続したモニタに文字を表示できましたので、そこまでの手順を手短に解説します。</p>



<h2 class="wp-block-heading">Ultibo Core のダウンロード</h2>



<p>Lazarus IDE と統合された Ultibo は下記よりダウンロードします。</p>



<p>/<a href="https://ultibo.org/download/">https://ultibo.org/download/</a></p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="788" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1024x788.png" alt="" class="wp-image-6036" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1024x788.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-300x231.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-768x591.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1536x1182.png 1536w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image.png 2008w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>2025/6/6 時点では、Ultibo-Core-2.6.049-Beetroot.exe が最新ですので、これをダウンロード。<br><br>もしくは、GitHub からもダウンロードできます。必要に応じて古いバージョンのダウンロードもできます。<br></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="787" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1-1024x787.png" alt="" class="wp-image-6037" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1-1024x787.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1-300x231.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1-768x590.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1-1536x1181.png 1536w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-1.png 2014w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>こちらだと、少しサイズの大きい Ultibo-Core-2.6.049-Beetroot-Main.exe というのもあります。</p>



<p>私は、何か不足してもいやなので、こちらからダウンロードしました。</p>



<h2 class="wp-block-heading">インストール</h2>



<p>ダウンロードしたファイルを実行するとインストールが始まります。インストールディレクトリの指定などもできますが、とりあえずデフォルトのまま次へ次へと進みインストール。数分でインストールが完了します。</p>



<p>インストールが完了すると、C:\Ultibo\Core というフォルダができています。</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" width="1024" height="842" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-2-1024x842.png" alt="" class="wp-image-6038" style="width:455px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-2-1024x842.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-2-300x247.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-2-768x632.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-2.png 1075w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>C:\Ultibo\Core の下にこんなフォルダとファイルができていればとりあえずインストール成功かと思います。</p>



<h2 class="wp-block-heading">Lazarus (Ultibo Edition) を起動</h2>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="339" height="353" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-3.png" alt="" class="wp-image-6039" style="width:204px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-3.png 339w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-3-288x300.png 288w" sizes="(max-width: 339px) 100vw, 339px" /></figure>



<p>Lazarus IDE (Ultibo Edition) を起動します。</p>



<p>初回の起動はFPC (free pascal ) のパスなどを設定する画面が表示されますが、デフォルトで設定されているので、開発環境のWindow のモードを選択するだけで良いでしょう。Windowモードは、Classic だと 昔風にそれぞれのウィンドが独立している形になっていて、今風だと、最近のDelphi風に1つのWindowにメニュー、プロジェクトインスペクタ、ソースエディタ、コードエクスプローラなどがドッキングされた感じになります。特に深い思い入れがなければ、今風のほうが良いでしょう。</p>



<p></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="690" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-4-1024x690.png" alt="" class="wp-image-6040" style="width:567px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-4-1024x690.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-4-300x202.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-4-768x518.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-4-1536x1035.png 1536w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-4-2048x1380.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>これは今風の場合。</p>



<h2 class="wp-block-heading">プロジェクトの作成</h2>



<p>メニューの[ファイル]→[新規] で下の画面が開きます。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="605" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-5-1024x605.png" alt="" class="wp-image-6041" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-5-1024x605.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-5-300x177.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-5-768x453.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-5.png 1128w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>今回は、Raspi Zero 2W をターゲットにしますので、これを選んで[OK] ボタンでプロジェクトが作成されます。</p>



<h2 class="wp-block-heading">プロジェクトオプションの設定</h2>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="524" height="634" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-6.png" alt="" class="wp-image-6042" style="width:237px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-6.png 524w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-6-248x300.png 248w" sizes="(max-width: 524px) 100vw, 524px" /></figure>



<p>[プロジェクト] → [プロジェクトオプション] で下の画面が開きます。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="679" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-7-1024x679.png" alt="" class="wp-image-6043" style="width:683px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-7-1024x679.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-7-300x199.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-7-768x509.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-7.png 1208w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>[コンパイラオプション] → [設定と対象] で、対称プラットフォームは、上記画面のように設定してください。</p>



<p>ARMV7A 、RPIZERO2W がポイントです。設定したら[OK]ボタンで画面を閉じます。</p>



<h2 class="wp-block-heading">Hello world サンプルプログラムの作成</h2>



<pre class="wp-block-code"><code class="">program HelloPi;<br><br>uses<br>  RaspberryPi3, // ← ここが機種名<br>  GlobalConst, GlobalTypes,<br>  Platform, Console, SysUtils;<br><br>var<br>  Console1: TWindowHandle;<br><br>begin<br>  Console1 := ConsoleWindowCreate(ConsoleDeviceGetDefault, 0, True);<br><br>  if Console1 &lt;&gt; -1 then<br>  begin<br>    ConsoleWindowWriteLn(Console1, 'Hello from Ultibo on Pi Zero 2 W!');<br>  end;<br><br>  while True do Sleep(1000);<br>end.<br></code></pre>



<p>最初は何も考えずに、初期表示されているソースを消して、上記コードをペタッと貼り付けましょう!</p>



<h2 class="wp-block-heading">プロジェクトの保存</h2>



<p>まず最初にソースを保存してみましょうか。</p>



<p>Pascal は、ソースの先頭に書いた名前とファイル名が一致しないといけないので、 program hellopi; としたので、ファイルに名前を付けて保存で、 hellopi.lpr として保存してください。</p>



<p>とりあえず今は、このファイルしかないので、メニューの [プロジェクト] → [名前を付けてプロジェクト保存] で保存しても同じ結果かなと思います。 </p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="513" height="624" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-8.png" alt="" class="wp-image-6044" style="width:216px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-8.png 513w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-8-247x300.png 247w" sizes="(max-width: 513px) 100vw, 513px" /></figure>



<p>Pascal はこの他 unit というファイルもありまして、この後開発していく中で unit に分けて、uses で宣言して使うことになると思います。</p>



<h2 class="wp-block-heading">構築 (コンパイル + img出力)</h2>



<p>さていよいよ、コンパイルです。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="387" height="229" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-10.png" alt="" class="wp-image-6046" style="width:194px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-10.png 387w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-10-300x178.png 300w" sizes="(max-width: 387px) 100vw, 387px" /></figure>



<p>[構築] でコンパイルと Raspi 用の img ファイルができあがります。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="104" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-11-1024x104.png" alt="" class="wp-image-6047" style="width:601px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-11-1024x104.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-11-300x31.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-11-768x78.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-11.png 1061w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>こんな風に表示されたら、コンパイルは成功です。</p>



<p>出力先のフォルダ内をみてみましょう。</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="164" height="254" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-12.png" alt="" class="wp-image-6048" style="width:112px;height:auto"/></figure>



<p>このように出力されていれば成功かと思います。</p>



<h2 class="wp-block-heading">SDカードに書き込む</h2>



<p>先ほど生成された kernel7.img がこのプログラムの本体です。まずはこれをSDカードにコピーしましょう。</p>



<p>次に、 C:\Ultibo\Core\firmware\RPi3 のフォルダにある下の3つのファイルをSDカードにコピーします。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="389" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-13-1024x389.png" alt="" class="wp-image-6049" style="width:474px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-13-1024x389.png 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-13-300x114.png 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-13-768x291.png 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/image-13.png 1041w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>結果、SDカードの中身は、下のようになります。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="200" height="191" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/image-14.png" alt="" class="wp-image-6050"/></figure>



<h2 class="wp-block-heading">Raspi Zero に差して実行!</h2>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="576" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235558-1024x576.jpg" alt="" class="wp-image-6051" style="width:355px;height:auto" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235558-1024x576.jpg 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235558-300x169.jpg 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235558-768x432.jpg 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235558-1536x864.jpg 1536w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235558-2048x1153.jpg 2048w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235558-800x450.jpg 800w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>micro SD-CARD を Raspi に差して、HDMIケーブルとモニタを繋いで、電源コードを差し込めば、すぐに起動します。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="576" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235603-1024x576.jpg" alt="" class="wp-image-6052" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235603-1024x576.jpg 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235603-300x169.jpg 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235603-768x432.jpg 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235603-1536x864.jpg 1536w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235603-2048x1152.jpg 2048w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235603-800x450.jpg 800w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="576" src="https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235607-1024x576.jpg" alt="" class="wp-image-6053" srcset="https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235607-1024x576.jpg 1024w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235607-300x169.jpg 300w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235607-768x432.jpg 768w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235607-1536x864.jpg 1536w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235607-2048x1153.jpg 2048w, https://expertgig.jp/wp/wp-content/uploads/2025/06/IMG_20250606_235607-800x450.jpg 800w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>さすがに、OS無しは起動が速い!</p>



<p>とりあえず、起動までできたので、次からはさっそくDelphi で書いた MZ-80K2 のエミュを移植したいと思います。</p>



<p>うん? まてよ。まだUSBキーボードのテストをしていなかった。こちらが先かな。</p>



<p>ということで、今回はここまで。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://expertgig.jp/2025/06/07/raspi-zero-2w-%e3%83%99%e3%82%a2%e3%83%a1%e3%82%bf%e3%83%ab%e9%96%8b%e7%99%ba-02-%e7%92%b0%e5%a2%83%e6%a7%8b%e7%af%89%ef%bd%9ehello%e8%a1%a8%e7%a4%ba%e7%b7%a8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
