Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Uboot nios2 on a custom board

Altera_Forum
Honored Contributor II
921 Views

Hi,  

 

we are developing a custom board using a max10 device based on the 10m50 design. I am trying to get uboot up on this board but im kind of stuck.  

 

The documentation im following is this one: 

http://www.alterawiki.com/wiki/dasuboot 

 

I have already successfully loaded a linux on this same board and I am able to see the output on the uart. I would like to do the same thing using uboot.  

 

So, I cloned the uboot repo: 

git://git.denx.de/u-boot.git 

 

I've modified the dts from the 10m50 and default config to match my board, then compiled the project. I've tried both generating a hex file and putting it on the qspi and using the nios2-download -g u-boot. I dont see anything on the output and I would really appreciate if someone could point me out to some debug steps or some documentation I could read.  

 

I've tried using both the jtag_uart and the altera_uart.  

 

any help is very much appreciated. 

 

David
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
155 Views

Hi, 

 

 

--- Quote Start ---  

 

 

we are developing a custom board using a max10 device based on the 10m50 design. I am trying to get uboot up on this board but im kind of stuck.  

 

The documentation im following is this one: 

http://www.alterawiki.com/wiki/dasuboot 

 

I have already successfully loaded a linux on this same board and I am able to see the output on the uart. I would like to do the same thing using uboot.  

 

So, I cloned the uboot repo: 

git://git.denx.de/u-boot.git 

 

I've modified the dts from the 10m50 and default config to match my board, then compiled the project. I've tried both generating a hex file and putting it on the qspi and using the nios2-download -g u-boot. I dont see anything on the output and I would really appreciate if someone could point me out to some debug steps or some documentation I could read.  

 

I've tried using both the jtag_uart and the altera_uart.  

 

 

--- Quote End ---  

 

 

Nios2-download requires an elf format file. After the verify check and execution from its entry point, nios2-download will exit, so you need to monitor the output with nios2-terminal etc. The method introduced in the wiki is to send the binary file using the nios2-gdb loader functionality, after executing debug stub program by nios2-gdb-server. In either method, an appropriate terminal is necessary on your PC to communicate with the nios2 side. 

 

Kazu
Altera_Forum
Honored Contributor II
155 Views

 

--- Quote Start ---  

Hi, 

 

 

 

Nios2-download requires an elf format file. After the verify check and execution from its entry point, nios2-download will exit, so you need to monitor the output with nios2-terminal etc. The method introduced in the wiki is to send the binary file using the nios2-gdb loader functionality, after executing debug stub program by nios2-gdb-server. In either method, an appropriate terminal is necessary on your PC to communicate with the nios2 side. 

 

Kazu 

--- Quote End ---  

 

 

Thank you for your reply.  

 

I understand what you mean, and I am using the elf formatted file with the both nios2-terminal and and the terminal opened. I dont think that printing on the screen is the problem. Im gonna copy below an email that I just sent to the nios2 mail list: 

 

We are developing a custom board that has the hardware very similar to the the Max10 Neek (https://www.altera.com/products/boards_and_kits/dev-kits/partners/max-10-neek.html). It differs in a few things (like qspi / ram size).  

 

 

Im trying to get uboot up on this board but i had no success so far. My first question to this list would be: Did anyone already try running uboot on this neek board? Does it work ?  

 

 

Im using the default u-boot from denx.de (http://denx.de/) branch u-boot-2016.09.y.  

 

 

I tried the same approach with the linux kernel (vmlinux) and i can send the kernel directly to it using the nios2-download program. 

 

 

I did the necessary modifications pointed out by the doc/README.nios2 but my board is hanging here: 

 

GNU gdb (GDB) 7.10.50.20150827-cvs 

Copyright (C) 2015 Free Software Foundation, Inc. 

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it. 

There is NO WARRANTY, to the extent permitted by law. Type show copying 

and show warranty for details. 

This GDB was configured as --host=x86_64-pc-linux-gnu --target=nios2-elf. 

Type show configuration for configuration details. 

For bug reporting instructions, please see: 

<http://www.altera.com/mysupport>. 

Find the GDB manual and other documentation resources online at: 

<http://www.gnu.org/software/gdb/documentation/>. 

For help, type help. 

Type apropos word to search for commands related to word... 

Reading symbols from u-boot...done. 

(gdb) target remote localhost:2345 

Remote debugging using localhost:2345 

0xd7fab0dc in bootstage_error (id=BOOTSTAGE_ID_NEED_RESET) at include/bootstage.h:358 

358show_boot_progress(-id); 

(gdb) backtrace  

# 0 0xd7fab0dc in bootstage_error (id=BOOTSTAGE_ID_NEED_RESET) at include/bootstage.h:358 

# 1 hang () at lib/hang.c:28 

# 2 0xd7f8bcf4 in board_init_f (boot_flags=<optimized out>) at common/board_f.c:1076 

# 3 0xd7f800e4 in _reloc () at arch/nios2/cpu/start.S:134 

(gdb)  

 

 

 

 

So the board is getting stuck on initialization, which explains why I dont see anything on the terminal. Now my problem is: Why am i getting stuck there? Im not sure if im missing a config, or if I should edit some linker script to make uboot point to another place in memory. Im looking for some documentation on this and / or some brief explanation of how can I move forward with this debug problem that im facing.  

 

Thanks !  

 

David
Reply