「AKI-H8/3069FでuClinuxを動作させる方法(中編)」の版間の差分

📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)

ページの作成:「== 概要 == AKI-H8ボード/3069Fの動作確認では、H8上で動作するファームウェアを書き込み、マザーボード上のLEDやLCDの動作確認…」
 
124行目: 124行目:
<br><br>
<br><br>


== uClinuxカーネルのロード ==
== AKI-H8/3069FにIPアドレスを割り当てる ==
AKI-H8/3069Fにも静的IPアドレスを割り当てる必要がある。<br>
H8のFlash ROMに書き込んだRed Bootは、初期設定では、DHCPのクライアント機能を実行するように設定されている。<br>
つまり、Linux PCをDHCPサーバにする必要がある。<br>
<br>
DHCPサーバを構築することが面倒な場合、Red Bootのfconfig -iコマンドで静的IPアドレスを直接割り当てる。<br>
静的IPアドレスを割り当てた後、AKI-H8/3069Fの電源を再接続する、または、リセットボタンを押下してRed Bootを再起動する。<br>
<br>
以下に、DHCPサーバの構築を記載する。<br>
+**Warning** FLASH configuration checksum error or invalid key
Use 'fconfig -i' to [re]initialize database
DP83902A - eeprom ESA: 00:02:cb:01:86:c2                            '''AKI-H8/3069FのMACアドレス'''
... waiting for BOOTP information
Ethernet eth0: MAC address 00:02:cb:01:86:c2
Can't get BOOTP info for device!
RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 14:54:02, Dec 21 2006
Platform: Akizuki H8/3068 Network micom (H8/300H)
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
RAM: 0x00400000-0x005f4000, [0x00400000-0x005e1000] available
FLASH: 0x00000000 - 0x80000, 8 blocks of 0x00010000 bytes each.
RedBoot>
<br>
Red Bootの起動後、シリアル通信を使用してシェル上から以下のコマンドを実行する。<br>
以下のように、サーバとなるLinux PCのIPアドレスを入力する。<br>
RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)?      '''yを入力'''
Run script at boot: false                                    '''falseを入力'''
Use BOOTP for network configuration: true                    '''trueを入力'''
Default server IP address: 192.168.1.10                      '''tftpサーバ(Linux PC)のIPアドレスを入力'''
GDB connection port: 9000
Force console for special debug messages: false
linux boot command:
Network debug at boot time: false
Default network device: dp83902a_eth0
Update RedBoot non-volatile configuration - continue (y/n)?  '''yを入力'''
... Erase from 0x00070000-0x00080000: .
... Program from 0x005e4000-0x005f4000 at 0x00070000: .
RedBoot>
<br>
DHCPサーバを構築するのが面倒な場合は、以下のように、Red Bootのfconfig -iコマンドで静的IPアドレスを直接割り当てる。<br>
RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)?      '''yを入力'''
Run script at boot: false                                    '''falseを入力'''
Use BOOTP for network configuration: false                    '''falseを入力'''
Gateway IP address: 192.168.1.1                              '''適当なGatewayのIPアドレスを入力'''
Local IP address: 192.168.1.11                                '''AKI-H8/3069FのIPアドレスを入力'''
Local IP address mask: 255.255.255.0                          '''ネットマスクを入力'''
Default server IP address: 192.168.1.10                      '''tftpサーバ(Linux PC)のアドレスを入力'''
GDB connection port: 9000                                    '''9000を入力'''
Force console for special debug messages: false              '''falseを入力'''
linux boot command:
Network debug at boot time: false                            '''falseを入力'''
Default network device: dp83902a_eth0
Update RedBoot non-volatile configuration - continue (y/n)?  '''yを入力'''
... Erase from 0x00070000-0x00080000: .
... Program from 0x005e4000-0x005f4000 at 0x00070000: .
RedBoot>
<br>
次に、Linux PCにDHCPサーバを構築する。以下のように、/etc/dhcpd.confファイルを編集する。<br>
ここで、00:02:cb:01:86:c2はAKI-H8/3069FのMACアドレスである。(Red Bootの起動時に出力されるので、その値を記述する)<br>
# /etc/dhcpd.confファイル
ddns-update-style ad-hoc;
allow bootp;
subnet 192.168.0.0 netmask 255.255.255.0
{
    host AKI3069F.koudo.net
    {
      hardware Ethernet 00:02:cb:01:86:c2;
      fixed-address 192.168.0.2;
    }
}
<br>
次に、DHCPサーバのサービスを起動する。<br>
sudo systemctl start dhcpd
sudo systemctl enable dhcpd
<br>
再度、AKI-H8/3069Fを再起動して、以下のようにIPアドレスが割り当てられていれば、DHCPサーバは正常に動作している。<br>
+DP83902A - eeprom ESA: 00:02:cb:01:86:c2
Ethernet eth0: MAC address 00:02:cb:01:86:c2
IP: 192.168.1.11/255.255.255.0, Gateway: 0.0.0.0                    '''AKI-H8/3069FのIPアドレス'''
Default server: 192.168.1.10                                        '''tftpサーバ(Linux PC)のIPアドレス'''
RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version UNKNOWN - built 14:54:02, Dec 21 2006
Platform: Akizuki H8/3068 Network micom (H8/300H)
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
RAM: 0x00400000-0x005f4000, [0x00400000-0x005e1000] available
FLASH: 0x00000000 - 0x80000, 8 blocks of 0x00010000 bytes each.
RedBoot>
<br>
Linux PCからAKI-H8/3069Fへのネットワーク接続を確認するため、以下のコマンドを実行する。<br>
ネットワーク接続が正常ならば、以下のように出力される。<br>
# 入力
ping 192.168.1.11
<br>
# 出力
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=14.9 ms
64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=2.84 ms
64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=4.22 ms
--- 192.168.0.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 2.842/7.345/14.970/5.421 ms
<br>
もし、ネットワーク接続できない場合は、LANケーブル(クロスケーブル)の接続やDHCPの設定ファイルを確認したり、<br>
fconfig -iコマンドで設定したサーバやAKI-H8/3069FのIPアドレスが正しいか確認する。<br>
<br><br>