ContributionsMost RecentMost LikesSolutionsRe: Can't find DE1-SoC_Computer system configuration for ARM? Hello Yoshiaki, Thank you for your response. I thought that the hardware (FPGA, .qsys) configuration of ARM-based computers and NIOS-II-based computers should be different. However, it seems that the hardware configuration for both computers is the same but the only operating principle and register maps which are related to the memory are different. Now it is clear to me. If it is not the big deal for asking the question, may I ask where can I find the HPS-FPGA bridge offset(0xC0000000) of the memory components in the .qsys file? (.qsys file only shows that the base address of on-chip SRAM is 08000000, but it should be C8000000 to be used in ARM-based computers. Surely the information is shown in the document that you've attached but I just want to know where can I find the information in the hardware configuration) 🙂 Thank you! Can't find DE1-SoC_Computer system configuration for ARM? Hello, I'm trying to build a DE1-SoC Computer system from a university program. I've installed the university program and checked there are two documents of the computer which is based on ARM and the computer which is based on NIOS II. However, the system configuration (Quartus project, .qsys files) seems to be only based on NIOS II (The register map of the system is identical to the register map introduced by the document of the doc_Nios). Can I find the system configuration which is for the ARM core? Or, is the hardware configuration is same for both ARM and NIOS II? If so, how can be the address map of both systems differs from each other? Thank you! SolvedMemory Access from both HPS and FPGA Hello, I'm quite new to embedded programming so please excuse me if the question is quite simple and unrefined. I'm trying to build a system with HPS, containing memory. Especially, the system targets to read the data from the SD card, write the data to temporary memory, and send the data in a serial manner to GPIO extension port (JP1). At first, since I'm not familiar with the embedded system, I've tried to use the demonstration from the university program (DE1-SoC_Computer) and configured my system as follows: The operation I've intended is as follows: ① Send the data to the board (or give a command to a terminal to read the data from SD card) ② The data transfers to the ARM core through the interface and the bridge between HPS-FPGA ③ Transferred data is stored to DDR3 DRAM, which is located at HPS side ④ Give a command to a terminal to send the data to GPIO port ⑤ The command is also transferred through a bridge ⑥ The data is read from DDR3 DRAM ⑦ The read data is transferred to GPIO port However, I found that ④-⑤-⑥-⑦ takes at least 500ns and thus limits the data rate at the GPIO port. (especially, alt_write_word function takes 500ns) So now I want to revise the system as follows: The operation I want is as follows: ① Send the data to the board (or give a command to a terminal to read the data from SD card) ② The data transfers to the ARM core through the interface and the bridge between HPS-FPGA ③ Transferred data is stored to SDRAM, which is located at FPGA ④ Give a command through PIO, to fetch the data from SDRAM to FIFO (or on-chip SRAM?) ⑤ The data is fetched from SDRAM to FIFO ⑥ The fetched data is transferred to GPIO port From the above situation, I have the following questions: 1. Is the revised system configuration is practical to be implemented? (i.e. can we build a system like the later figure using the DE1-SoC?) 2. May I improve the data rate with the revised configuration of the system? 3. I'm currently stuck at the ⑤ since I don't know how to access the data to SDRAM from the FPGA side, which data bus is currently connected to multiple Avalog-MM masters at NIOS II and AXI master at HPS. I'm trying to add a DMA controller at the system configuration and connect the read_master to the data bus, but I'm not sure about the desired operation. Are there any demos or examples that I can refer to? I'm sorry for the unrefined questions and information since I'm even not sure that I'm asking an appropriate question. If you need any additional information on the configurations above, please let me know. Thank you! Re: ALTERA function fails after execution at C program I think I found the error source and fixed it. The main reason was the malfunction of the clock source at the FPGA. In the attached .qsys file, almost all FPGA components are based on the output clock of the PLL, which reference clock is provided by PIN_AF14. However, I found that this clock source is not working. I revised the system configuration to take a clock source from PIN_K14, not from PIN_AF14. Thus, everything works well. The logs are as follows: root@DE1_SoC:~> ./memtool FFD0501C 1 Reading 0x1 count starting at address 0xFFD0501C 0xFFD0501C: 00000000 root@DE1_SoC:~> ./memtool FF200000 1 Reading 0x1 count starting at address 0xFF200000 0xFF200000: 000003FF (This result is intended) I'm sorry for making this thread to be too long since I'm not familiar with the embedded system, including FPGA. And again, I really appreciate your time and effort on this issue. Thank you!! Re: ALTERA function fails after execution at C program Hello Yoshiaki, Thank you for the answer. Using the latest Linux Ubuntu Desktop (v1.0, 2016-12-28) from Terasic resource center, U-boot fails with the following logs. Booting log: U-Boot SPL 2013.01.01 (Oct 12 2016 - 10:38:03) BOARD : Altera SOCFPGA Cyclone V Board CLOCK: EOSC1 clock 25000 KHz CLOCK: EOSC2 clock 25000 KHz CLOCK: F2S_SDR_REF clock 0 KHz CLOCK: F2S_PER_REF clock 0 KHz CLOCK: MPU clock 925 MHz CLOCK: DDR clock 400 MHz CLOCK: UART clock 100000 KHz CLOCK: MMC clock 50000 KHz CLOCK: QSPI clock 3613 KHz RESET: COLD INFO : Watchdog enabled SDRAM: Initializing MMR registers SDRAM: Calibrating PHY SEQ.C: Preparing to start memory calibration SEQ.C: CALIBRATION PASSED SDRAM: 1024 MiB ALTERA DWMMC: 0 U-Boot 2013.01.01 (Oct 12 2016 - 10:40:34) CPU : Altera SOCFPGA Platform BOARD : Altera SOCFPGA Cyclone V Board I2C: ready DRAM: 1 GiB MMC: ALTERA DWMMC: 0 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Skipped ethaddr assignment due to invalid EMAC address in EEPROM Net: mii0 Warning: failed to set MAC address Hit any key to stop autoboot: 0 reading u-boot.scr 200 bytes read in 4 ms (48.8 KiB/s) ## Executing script at 02000000 reading soc_system.rbf 7007184 bytes read in 327 ms (20.4 MiB/s) ## Starting application at 0x3FF795A4 ... ## Application terminated, rc = 0x0 reading zImage 5538512 bytes read in 257 ms (20.6 MiB/s) reading socfpga.dtb 31245 bytes read in 6 ms (5 MiB/s) ## Flattened Device Tree blob at 00000100 Booting using the fdt blob at 0x00000100 reserving fdt memory region: addr=0 size=1000 Loading Device Tree to 03ff5000, end 03fffa0c ... OK Starting kernel ... In addition, 32bit read of the register also fails with the logs as follows: logs: U-Boot SPL 2013.01.01 (Oct 12 2016 - 10:38:03) BOARD : Altera SOCFPGA Cyclone V Board CLOCK: EOSC1 clock 25000 KHz CLOCK: EOSC2 clock 25000 KHz CLOCK: F2S_SDR_REF clock 0 KHz CLOCK: F2S_PER_REF clock 0 KHz CLOCK: MPU clock 925 MHz CLOCK: DDR clock 400 MHz CLOCK: UART clock 100000 KHz CLOCK: MMC clock 50000 KHz CLOCK: QSPI clock 3613 KHz RESET: COLD INFO : Watchdog enabled SDRAM: Initializing MMR registers SDRAM: Calibrating PHY SEQ.C: Preparing to start memory calibration SEQ.C: CALIBRATION PASSED SDRAM: 1024 MiB ALTERA DWMMC: 0 U-Boot 2013.01.01 (Oct 12 2016 - 10:40:34) CPU : Altera SOCFPGA Platform BOARD : Altera SOCFPGA Cyclone V Board I2C: ready DRAM: 1 GiB MMC: ALTERA DWMMC: 0 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Skipped ethaddr assignment due to invalid EMAC address in EEPROM Net: mii0 Warning: failed to set MAC address Hit any key to stop autoboot: 0 SOCFPGA_CYCLONE5 # fatload mmc 0:1 $fpgadata soc_system.rbf; reading soc_system.rbf 7007204 bytes read in 361 ms (18.5 MiB/s) SOCFPGA_CYCLONE5 # fpga load 0 $fpgadata $filesize; SOCFPGA_CYCLONE5 # run bridge_enable_handoff; ## Starting application at 0x3FF795A4 ... ## Application terminated, rc = 0x0 SOCFPGA_CYCLONE5 # run mmcload; reading zImage 5676720 bytes read in 286 ms (18.9 MiB/s) reading socfpga.dtb 31245 bytes read in 8 ms (3.7 MiB/s) SOCFPGA_CYCLONE5 # md FFD0501C 1 ffd0501c: 00000000 .... SOCFPGA_CYCLONE5 # md FF200000 1 ff200000: (freezes) I really appreciate your time and effort on this thread. Thank you! Re: ALTERA function fails after execution at C program Hello Yoshiaki, Sorry for the wrong logs for accessing the data register. I've checked the value at the register which corresponds to the HPS-FPGA bridge changes properly while U-Boot, and the logs are as follows: commands and logs U-Boot SPL 2013.01.01 (Oct 12 2016 - 10:38:03) BOARD : Altera SOCFPGA Cyclone V Board CLOCK: EOSC1 clock 25000 KHz CLOCK: EOSC2 clock 25000 KHz CLOCK: F2S_SDR_REF clock 0 KHz CLOCK: F2S_PER_REF clock 0 KHz CLOCK: MPU clock 925 MHz CLOCK: DDR clock 400 MHz CLOCK: UART clock 100000 KHz CLOCK: MMC clock 50000 KHz CLOCK: QSPI clock 3613 KHz RESET: WARM INFO : Watchdog enabled SDRAM: Initializing MMR registers SDRAM: Calibrating PHY SEQ.C: Preparing to start memory calibration SEQ.C: CALIBRATION PASSED SDRAM: 1024 MiB ALTERA DWMMC: 0 U-Boot 2013.01.01 (Oct 12 2016 - 10:40:34) CPU : Altera SOCFPGA Platform BOARD : Altera SOCFPGA Cyclone V Board I2C: ready DRAM: 1 GiB MMC: ALTERA DWMMC: 0 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Skipped ethaddr assignment due to invalid EMAC address in EEPROM Net: mii0 Warning: failed to set MAC address Hit any key to stop autoboot: 0 SOCFPGA_CYCLONE5 # fatload mmc 0:1 $fpgadata soc_system.rbf; reading soc_system.rbf 7007204 bytes read in 358 ms (18.7 MiB/s) SOCFPGA_CYCLONE5 # fpga load 0 $fpgadata $filesize; SOCFPGA_CYCLONE5 # md FFD0501C 1 ffd0501c: 00000007 .... SOCFPGA_CYCLONE5 # run bridge_enable_handoff; ## Starting application at 0x3FF795A4 ... ## Application terminated, rc = 0x0 SOCFPGA_CYCLONE5 # md FFD0501C 1 ffd0501c: 00000000 .... SOCFPGA_CYCLONE5 # run mmcload; reading zImage 5676720 bytes read in 286 ms (18.9 MiB/s) reading socfpga.dtb 31245 bytes read in 8 ms (3.7 MiB/s) SOCFPGA_CYCLONE5 # run mmcboot; ## Flattened Device Tree blob at 00000100 Booting using the fdt blob at 0x00000100 reserving fdt memory region: addr=0 size=1000 Loading Device Tree to 03ff5000, end 03fffa0c ... OK Starting kernel ... In addition, .qsys file is compressed to .7z file and attached this reply, so please find it. It is based on the project "DE1-SoC_Computer " which is provided by Altera University Program. The .rbf file is based on the attached .qsys file, .dtb file is based on the Terasic Ubuntu image and zImage is provided by releases.rocketboards.org. I've tried to use all files from Terasic Ubuntu image, but in this case, I couldn't boot the device. For your information, .dtb file and zImage file are also attached to this reply. Thank you for your devotion!! Re: ALTERA function fails after execution at C program For your information, In addition, md command failure log is different between the following u-boot command: command run bridge_enable_handoff; log ## Starting application at 0x3FF795A4 ... ## Application terminated, rc = 0x0 before the command, md fails as follows: command md.b FF200000 1 log ff200000:data abort MAYBE you should read doc/README.arm-unaligned-accesses pc : [<3ff95052>] lr : [<3ff95027>] sp : 3ff355b0 ip : 0000001c fp : 00000002 r10: ff200000 r9 : ff200000 r8 : 3ff35f60 r7 : 00000000 r6 : 00000001 r5 : 00000001 r4 : 00000001 r3 : ff200000 r2 : c0000000 r1 : 3ff355bc r0 : 00000009 Flags: Nzcv IRQs on FIQs off Mode SVC_32 Resetting CPU ... resetting ... U-Boot SPL 2013.01.01 (Oct 12 2016 - 10:38:03) BOARD : Altera SOCFPGA Cyclone V Board CLOCK: EOSC1 clock 25000 KHz CLOCK: EOSC2 clock 25000 KHz (...reboots automatically) after the command, md fails as follows: command md.b FF200000 1 log ff200000: (freezes) Thank you! Re: U-Boot Failure using Terasic Ubuntu Image Hello Yoshiaki! Thank you for the prompt answer. I've tried to replace DTB file from GHRD and I think it worked for me to boot the device. Also, replacing zImage file from GHRD also worked. However, although the device has been booted successfully, I cannot run any program using Altera function. I've opened an individual thread for this issue a few days ago, so I would not ask you for the aforementioned issue here. I'm still confused why the DTB file from the reference image (https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&No=836&PartNo=4) is wrong. For this, is there any method to check if the DTB file is "proper"? (I don't think DTB and zImage are related to each other, but DTB and .rbf file are related together) Re: ALTERA function fails after execution at C program Hello Yoshiaki, Thank you again for your suggestion. I've checked the register at the address 0xffd0501c and at the address FF200000 and got the result as follows: Booting log U-Boot 2013.01.01 (Oct 12 2016 - 10:40:34) CPU : Altera SOCFPGA Platform BOARD : Altera SOCFPGA Cyclone V Board I2C: ready DRAM: 1 GiB MMC: ALTERA DWMMC: 0 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Skipped ethaddr assignment due to invalid EMAC address in EEPROM Net: mii0 Warning: failed to set MAC address Hit any key to stop autoboot: 0 SOCFPGA_CYCLONE5 # md.w FFD05020 2 ffd05020: 0000 0000 .... SOCFPGA_CYCLONE5 # md.w FF200000 1 ff200000: (freeze) As far as I know, if the last 3 bit is low (0), the bridges are enabled. I've also checked that if FPGA itself is not working properly through operating the FPGA in active-serial mode, but I found that the operation of the FPGA is not the issue. Please let me know if there is any other method to debug this error. I appreciate your time and effort. Thank you! Re: ALTERA function fails after execution at C program Hello Yoshiaki, Thank you for your prompt response and the suggestion! I've tried to use memtool from the above link but failed to cross-compile it since my cross-compile environment doesn't have autoconfigure 😞 So I used another source code from the site below to compile memtool: https://gist.github.com/mike0/2910170 Unfortunately, the read/write operation from/to certain registers (especially, FPGA-related registers) fail. TChat is, the terminal does not respond to any commands like case the above. I tried following commands (1 word = 32 bit): #1 memtool FF001000 1 (read 1 word from 0xFF001000) Reading 0x1 count starting at address 0xFF001000 0xFF001000: 00000000 #2 memtool FF200000 2 (read 2 words from 0xFF200000, while 0xFF200000 means LEDR) Reading 0x3 count starting at address 0xFF000000 (freezes) #3 memtool FF200020=16 (write 32bit word 16 to 0xFF200020, while 0xFF200020 means 7-segment displays register) Writing 32-bit value 0x16 to address 0xFF200020 (freezes) #4 memtool FFFEC600 3 (read 3 words from 0xFFFEC600, while 0xFFFEC600 means ARM A9 Private Timer) Reading 0x3 count starting at address 0xFFFEC600 0xFFFEC600: 00234934 00165135 00000005 #5 memtool FFFEC600 3 (read 3 words again from 0xFFFEC600) Reading 0x3 count starting at address 0xFFFEC600 0xFFFEC600: 00234934 00138EB5 00000005 The addresses of the registers are based on DE1-SoC_Computer_ARM.pdf From the above result, should I suppose the FPGA hardware malfunction? + More logs using memtool #6 memtool FFD0501C 3 (read 3 words from 0xFFD0501C, while 0xFFD0501C means FPGA Bridge) Reading 0x3 count starting at address 0xFFD0501C [ 68.718423] 8<--- cut here --- [ 68.725699] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f0c024 [ 68.733491] pgd = 64d55855 [ 68.736193] [b6f0c024] *pgd=3ffb8831 Bus error (core dumped) #7 memtool C0000000 1 (read 1 words from 0xC0000000, while 0xC0000000 means SDRAM) Reading 0x1 count starting at address 0xC0000000 (freezes)