embeded/FPGA - ALTERA2026. 4. 28. 21:19

메뉴얼과는 다르게 hps가 먼저 붙고 FPGA가 나중에 붙도록 수정되어 있다

[링크 : https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=886]

 

 

하라는대로 

CD(?) 내의 아래 경로에 sof 파일을 5CSEMA5 에 굽고

DE1-SoC_v.5.1.3_HWrevF.revG_SystemCD\Demonstrations\FPGA\my_first_fpga

 

전원을 껐다 켜주니

리눅스도 켜지고, 7seg 에서 숫자도 잘 돌아간다.

 

근데 이미지가 좀 잘못되었나.. (저에 멀 구었는지 기억이..)

starting kernel 에서 안넘어가네 -_-

 

+

메뉴얼을 보니 잘못된 이미지로 한 듯. 이전에 멀 구웠는지 까먹었는데

lxde 였던것 같기도 한데. MSEL을 다르게 설정하지 않아서 정상적으로 안켜진듯

3. Set the MSEL[4:0] on your DE1-SoC to 00000

 

아래 링크는 2026.04.28 까진 살아있음

[링크 : http://www.terasic.com/downloads/cd-rom/de1-soc/linux_BSP/DE1_SoC_SD.zip]

 

U-Boot SPL 2013.01.01 (Nov 04 2013 - 19:51:38)
BOARD : Altera SOCFPGA Cyclone V Board
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
ALTERA DWMMC: 0


U-Boot 2013.01.01 (Oct 24 2013 - 17:40:22)

CPU   : Altera SOCFPGA Platform
BOARD : Altera SOCFPGA Cyclone V Board
DRAM:  1 GiB
MMC:   ALTERA DWMMC: 0
In:    serial
Out:   serial
Err:   serial
Net:   mii0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0
reading u-boot.scr
** Unable to read file u-boot.scr **
Optional boot script not found. Continuing to boot normally
reading zImage
3809104 bytes read in 1283 ms (2.8 MiB/s)
reading socfpga.dtb
17119 bytes read in 13 ms (1.3 MiB/s)
fpgaintf
ffd08028: 00000000    ....
fpga2sdram
ffc25080: 00000000    ....
axibridge
ffd0501c: 00000000    ....
## Flattened Device Tree blob at 00000100
   Booting using the fdt blob at 0x00000100
   Loading Device Tree to 03ff8000, end 03fff2de ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpuset
Linux version 3.12.0-00307-g507abb4-dirty (root@matthew) (gcc version 4.6.3 (Sou             rcery CodeBench Lite 2012.03-57) ) #2 SMP Mon Jan 6 19:54:56 CST 2014
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Altera SOCFPGA, model: Altera SOCFPGA Cyclone V
Memory policy: ECC disabled, Data cache writealloc
PERCPU: Embedded 8 pages/cpu @80fd1000 s11328 r8192 d13248 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 1031484K/1048576K available (5637K kernel code, 253K rwdata, 1424K rodat             a, 343K init, 256K bss, 17092K reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
    lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x80008000 - 0x806ed828   (7063 kB)
      .init : 0x806ee000 - 0x80743c40   ( 344 kB)
      .data : 0x80744000 - 0x807834f0   ( 254 kB)
       .bss : 0x807834f0 - 0x807c355c   ( 257 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:16 nr_irqs:16 16
sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949ms
Console: colour dummy device 80x30
Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
ftrace: allocating 17704 entries in 52 pages
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x8051f018 - 0x8051f070
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated.
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
NET: Registered protocol family 16
fpga bridge driver
DMA: preallocated 256 KiB pool for atomic coherent allocations
L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410030c9, AUX_CTRL 0x32460000, Cache size: 512 kB
syscon fffef000.l2-cache: regmap [mem 0xfffef000-0xfffeffff] registered
syscon ffd05000.rstmgr: regmap [mem 0xffd05000-0xffd05fff] registered
syscon ffc25000.sdrctl: regmap [mem 0xffc25000-0xffc25fff] registered
syscon ff800000.l3regs: regmap [mem 0xff800000-0xff800fff] registered
syscon ffd08000.sysmgr: regmap [mem 0xffd08000-0xffd0bfff] registered
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
altera_hps2fpga_bridge fpgabridge.2: fpga bridge [hps2fpga] registered as device              hps2fpga
altera_hps2fpga_bridge fpgabridge.2: init-val not specified
altera_hps2fpga_bridge fpgabridge.3: fpga bridge [lshps2fpga] registered as devi             ce lwhps2fpga
altera_hps2fpga_bridge fpgabridge.3: init-val not specified
altera_hps2fpga_bridge fpgabridge.4: fpga bridge [fpga2hps] registered as device              fpga2hps
altera_hps2fpga_bridge fpgabridge.4: init-val not specified
bio: create slab <bio-0> at 0
FPGA Mangager framework driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@l             inux.it>
PTP clock support registered
Switched to clocksource timer1
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
arm-pmu arm-pmu: PMU:CTI successfully enabled
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
NTFS driver 2.1.30 [Flags: R/W].
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 2014
io scheduler noop registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
ffc02000.serial0: ttyS0 at MMIO 0xffc02000 (irq = 194, base_baud = 6250000) is a              16550A
console [ttyS0] enabled
altera_fpga_manager ff706000.fpgamgr: fpga manager [Altera FPGA Manager] registe             red as minor 0
brd: module loaded
cadence-qspi ff705000.spi: DMA NOT enabled
cadence-qspi ff705000.spi: master is unqueued, this is deprecated
m25p80 spi2.0: unrecognized JEDEC id ffffff
cadence-qspi ff705000.spi: Cadence QSPI controller driver
dw_spi_mmio fff01000.spi: master is unqueued, this is deprecated
CAN device driver interface
c_can_platform ffc00000.d_can: invalid resource
c_can_platform ffc00000.d_can: control memory is not used for raminit
c_can_platform ffc00000.d_can: c_can_platform device registered (regs=c08e4000,              irq=163)
stmmac - user ID: 0x10, Synopsys ID: 0x37
 Ring mode enabled
 DMA HW capability register supported
 Enhanced/Alternate descriptors
        Enabled extended descriptors
 RX Checksum Offload Engine supported (type 2)
 TX Checksum insertion supported
 Enable RX Mitigation via HW Watchdog Timer
libphy: stmmac: probed
eth0: PHY ID 00221611 at 1 IRQ 0 (stmmac-0:01) active
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
Synopsys Designware Multimedia Card Interface Driver
dwmmc_socfpga ff704000.dwmmc0: Using internal DMA controller.
dwmmc_socfpga ff704000.dwmmc0: Version ID is 240a
dwmmc_socfpga ff704000.dwmmc0: DW MMC controller at irq 171, 32 bit host data wi             dth, 1024 deep fifo
mmc_host mmc0: Bus speed (slot 0) = 12500000Hz (slot req 400000Hz, actual 390625             HZ div = 16)
dwmmc_socfpga ff704000.dwmmc0: 1 slots initialized
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
dwmmc_socfpga ff704000.dwmmc0: data FIFO error (status=00000800)
mmc0: problem reading SD Status register.
mmc_host mmc0: Bus speed (slot 0) = 12500000Hz (slot req 12500000Hz, actual 1250             0000HZ div = 0)
mmc0: new high speed SDHC card at address 59b4
mmcblk0: mmc0:59b4       14.9 GiB
 mmcblk0: p1 p2 p3
dwc2 ffb40000.usb: DWC OTG Controller
dwc2 ffb40000.usb: new USB bus registered, assigned bus number 1
dwc2 ffb40000.usb: irq 160, io mem 0x00000000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: DWC OTG Controller
usb usb1: Manufacturer: Linux 3.12.0-00307-g507abb4-dirty dwc2_hsotg
usb usb1: SerialNumber: ffb40000.usb
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
oprofile: using arm/armv7-ca9
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
8021q: 802.1Q VLAN Support v1.8
Key type dns_resolver registered
ThumbEE CPU extension supported.
Registering SWP/SWPB emulation handler
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): recovery complete
EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 340K (806ee000 - 80743000)
usb 1-1: new high-speed USB device number 2 using dwc2
INIT: version 2.88 booting
usb 1-1: New USB device found, idVendor=0424, idProduct=2512
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 2 ports detected
Starting Bootlog daemon: bootlogd.
Configuring network interfaces... eth0: device MAC address 92:af:4f:06:84:db
udhcpc (v1.20.2) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
Starting portmap daemon...
Sat Sep 28 04:37:00 UTC 2013
INIT: Entering runlevel: 5
Starting OpenBSD Secure Shell server: sshd
done.
Starting syslogd/klogd: done
Starting Lighttpd Web Server: lighttpd.
Starting blinking LED server
Stopping Bootlog daemon: bootlogd.
libphy: stmmac-0:01 - Link is Up - 1000/Full
stmmac: Energy-Efficient Ethernet initialized

Poky 8.0 (Yocto Project 1.3 Reference Distro) 1.3
 ttyS0

socfpga login: root
root@socfpga:~# uname -a
Linux socfpga 3.12.0-00307-g507abb4-dirty #2 SMP Mon Jan 6 19:54:56 CST 2014 armv7l GNU/Linux
root@socfpga:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 92:af:4f:06:84:db
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:592 (592.0 B)
          Interrupt:152 Base address:0x8000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@socfpga:~# cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 0 (v7l)
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32             
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

processor       : 1
model name      : ARMv7 Processor rev 0 (v7l)
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32             
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

Hardware        : Altera SOCFPGA
Revision        : 0000
Serial          : 0000000000000000
root@socfpga:~# cat /proc/meminfo
MemTotal:        1031824 kB
MemFree:         1016496 kB
Buffers:             924 kB
Cached:             5220 kB
SwapCached:            0 kB
Active:             4316 kB
Inactive:           3028 kB
Active(anon):       1228 kB
Inactive(anon):       16 kB
Active(file):       3088 kB
Inactive(file):     3012 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 4 kB
Writeback:             0 kB
AnonPages:          1200 kB
Mapped:             1776 kB
Shmem:                44 kB
Slab:               5296 kB
SReclaimable:       1696 kB
SUnreclaim:         3600 kB
KernelStack:         368 kB
PageTables:          120 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      515912 kB
Committed_AS:      12020 kB
VmallocTotal:    1024000 kB
VmallocUsed:        1060 kB
VmallocChunk:    1018588 kB        
root@socfpga:~# free -h
             total         used         free       shared      buffers
Mem:       1031824        15396      1016428            0          924
-/+ buffers:              14472      1017352
Swap:            0            0            0
root@socfpga:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root              1007.9M    161.8M    794.9M  17% /
devtmpfs                503.7M      4.0K    503.6M   0% /dev
tmpfs                   503.8M     40.0K    503.8M   0% /var/volatile
tmpfs                   503.8M         0    503.8M   0% /media/ram
root@socfpga:~# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (rw,relatime,errors=continue,user_xattr,barrier=1,data=             ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=515740k,nr_inodes=128935,mode=7             55)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /var/volatile type tmpfs (rw,relatime)
tmpfs on /media/ram type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)

 

요즘 256MB 짜리 메모리 가지고 놀다가 1GB 보니 겁나 커보이네 -_ㅠ

망할 메모리 수급 이슈 ㅠㅠ

 

그나저나 RGB 모니터가 없어서

RGB -> HDMI 컨버터 + HDMI to USB 캡쳐 이용해서 보는데 먼가 나온다.

 

프레임 버퍼도 없는데 멀로 출력한거지?

root@socfpga:~# ls -al /dev/fb*
ls: /dev/fb*: No such file or directory
root@socfpga:~# ls -al /dev/video*
ls: /dev/video*: No such file or directory

 

root@socfpga:~# ps
  PID USER       VSZ STAT COMMAND
    1 root      1316 S    init [5]
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u4:0]
    7 root         0 SW   [migration/0]
    8 root         0 SW   [rcu_bh]
    9 root         0 SW   [rcu_sched]
   10 root         0 SW   [migration/1]
   11 root         0 SW   [ksoftirqd/1]
   12 root         0 SW   [kworker/1:0]
   13 root         0 SW<  [kworker/1:0H]
   14 root         0 SW<  [khelper]
   15 root         0 SW   [kdevtmpfs]
   16 root         0 SW<  [netns]
   17 root         0 SW<  [writeback]
   18 root         0 SW<  [bioset]
   19 root         0 SW<  [kblockd]
   20 root         0 SW   [khubd]
   21 root         0 SW<  [rpciod]
   22 root         0 SW   [kworker/1:1]
   23 root         0 SW   [khungtaskd]
   24 root         0 SW   [kswapd0]
   25 root         0 SW   [fsnotify_mark]
   26 root         0 SW<  [nfsiod]
   27 root         0 SW   [kworker/u4:1]
   32 root         0 SW<  [ff705000.spi]
   35 root         0 SW<  [fff01000.spi]
   40 root         0 SW<  [kpsmoused]
   41 root         0 SW   [kworker/0:1]
   42 root         0 SW<  [dw-mci-card]
   43 root         0 SW   [mmcqd/0]
   44 root         0 SW<  [dwc2]
   45 root         0 SW<  [deferwq]
   46 root         0 SW   [kjournald]
  129 daemon    1460 S    /sbin/portmap
  148 root      3592 S    /usr/sbin/sshd
  152 root      1660 S    /sbin/syslogd -n -O /var/log/messages
  155 root      1660 S    /sbin/klogd -n
  159 root      1964 S    /usr/sbin/lighttpd -f /etc/lighttpd.conf
  164 root     10628 S    /www/pages/cgi-bin/scroll_server
  179 root      2500 S    -sh
  180 root      1564 S    /sbin/getty 38400 tty1
  193 root      1948 R    ps

 

root@socfpga:~# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      129/portmap  
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      159/lighttpd 
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      148/sshd     
tcp6       0      0 :::22                   :::*                    LISTEN      148/sshd

 

80 번 포트가 있는데 해보니 에러가 나서

 lighttpd.conf 보고 해당 경로 가서 파일 목록 보고 입력하니 정상적으로 뜬다.

 

22번 포트가 열려 있으니 ssh도 ok

 

문서 보는데 이 설정이 멀 의미하는지 찾아봐야겠다

그냥(?) 리눅스 셋팅 LXDE 셋팅

 

밑면의 실크에 따르면

MSEL[0:2] 가 BOOTSEL

MSEL[3:4]는 CLOCKSEL 이다.

Posted by 구차니