Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

most likely problem with devicetree, but why?

Altera_Forum
Honored Contributor II
1,075 Views

Hello all, 

 

I have a project wherein the FPGA communicates directly with SDRAM. To enable this i need to run a few commands during boot. namely: 

>setenv fpga2sdram_handoff 0x111 

>run bridge_enable_handoff 

>saveenv 

>boot 

 

I need to get these commands automated in the process, program the right rbf file and boot the linux kernel. I can always get 1 to work, but never everything at the same time. 

I normally follow the steps in the following guides: 

https://rocketboards.org/foswiki/documentation/ws2linuxkernelintroductionforalterasocdeviceslab1preloader 

Short example of the steps i'd take 

1) compile the entire project 

2) using bsp-editor create a preloader 

3) make a u-boot (i have done this in several ways, i have also tried using the u-boot supplied in the GSRD) 

4) make a bootscript, in this bootscript i point to the right .rbf file and reserve some memory for the software running on the hps. I do this by adding "mem=800M" to the line "setenv mmcboot 'setenv bootargs console=ttyS0,115200 root=${mmcroot} rw rootwait; bootz ${loadaddr} - ${fdtaddr}';" 

5) run the mkimage command on the boot.script to make it readable for the bootproces 

6) make the kernel, again I have used different methods and i have also tried using the version supplied with the GSRD. 

7) generate the device tree. mostly i use the sopc2dts command, followed by the dtc command to turn the dts into a dtb. as illustrated here: https://rocketboards.org/foswiki/view/documentation/gsrd131devicetreegenerator 

8) place everything on the sd-card, using the dd command or something similar. 

 

After I have done all this, the bridges are correctly set, memory is allocated, the rbf is programmed but the whole process is stuck at "starting kernel" 

I have gotten the kernel to work once, but then all other features like ethernet, usb, fpga, ...were disabled and obviously that is not supposed to happen. 

I already took a look at this thread (https://alteraforum.com/forum/showthread.php?t=52303&highlight=starting+kernel) but it didn't offer much help. 

 

The major problem here is: there are just so many guides on each individual step, taking very different approaches. I have tried many and most of them fail because of dead links or because i'm not using exactly the right linux distro (using centOS7 and ubuntu 16.04 LTS, or just SoCEDS on windows 10) or because some repositories are not available anymore, or ... or ...  

But my case is so simple! compared to the GSRD i have just added 1 custom IP component and enabled the FPGA-SDRAM bridges. Why am I having so much trouble with this? 

 

 

 

Thanks for the time and help!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
326 Views

Hi, 

 

Supported operating system is one of the important criteria, and you may need to be specific to a SOCEDS version for your usage. 

 

I believe this example below can help you more. 

 

https://www.altera.com/content/dam/altera-www/global/en_us/others/support/examples/soc/cv_fpga_to_hps_bridge_design_example_readme.txt 

 

 

Regards, 

CloseCL 

(This message was posted on behalf of Intel Corporation)
0 Kudos
Altera_Forum
Honored Contributor II
326 Views

Hello,  

 

I managed to solve this issue simply by creating a new system, starting from the Atlas-SoC SD-image instead of the DE0-nano-SoC image. So using Angstrom instead of Poky. 

Should there be anyone out there facing the same issues: I strongly recommend using Angstrom instead of Yocto/Poky, because it is much more beginner-friendly.
0 Kudos
Reply