What about the Nios2?

Discussions related to embedded firmware, driver, and user mode application software development
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

What about the Nios2?

Post by erik »

Hello,

I try to get the Nios2 work but there are not any information about that.

What I have done so far is to create the fsk_bridge project. I have not test it but in general it should be working.
So the only complete c-project for the Nios2 is the fsk_bridge?

What is the Nios2 doing in the hostet revision?
I created a revision based on the hostet myself without compiling an c-code an the bladeRF-cli is still working.
I thought the Nios2 is for configuring some peripherial devices like the Si5338.

My next point is to try to create a c-project. I will use the fsk_bridge as a reference.
My only goal is to configure the bladeRF by using the Nios2. I have inserted the lms and the Si5338 code so far.

I will let you know if I have reached anything
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Ok I have figured out that the lms_spi_controller is the source running on the nios.

I get the code in eclipse but how can I debug when I have created my own code?
At the Moment the greatest problem is that i can not include any file to the project. Eclipse do not find it neither the stdio.h.
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Hello and thank you for the quick answer,

I get the project to Eclipse by "Import" --> "General" --> "Existing Projects into Workspace" and the navigate to the lms_spi_controller bsp.
The only reason for using Eclipse is the hope to have the chance to debug maybe over usb or jtag. Without debugging it would be nearly impossible for me to build a running project.
Maybe I have to spend some time to get familiar with cmake (and forget debugging?). For beginners its much easier to use a gui, sorry.

But let me explain me main goal to ensure I'm on the right way.
I want to control the bladeRF from the nios and the fpga. Some signal processing and the whole configuration.

I have seen there are functions for setting registers in the lms and the si5338.
So I should be able to set up all things I have to.
Is that right or is there an easier way. Maybe like using the functions provided by lms.h and si5338.h?
That would be great but in my opinion it is not easy or impossible to get this running on the nios. Please correct me if this if wrong.

So when I have set up the registers I can send Signals using the fpga. Therefor I have to shift the valid signal and offer some I Q data. right?

At last for your information I'm now using the hosted revision. I think it is more common and better supported.

I'm very sorry about so much questions I try to get as much information as I can but it is all scattered around this forum, github and readmes.

Greetings,

Erik
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Hello,

is there someone who can get a working nios2 project for eclipse?
I try for 3 days without any success.

So I'am not able to develop anything.
The "Getting Started with the Graphical User Interface" is not really helpful.
I think i can try to generate a new project but I do not want to do all by myself from the ground.
To import the existing project would be very great.

Please describe if you know how I can get this.

THX

Erik
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Wow thank you very much this is great.

This will be realy helpfull. But at first I have to order a new byteblaster my old one is the "byteblaster" not "byteblaster II" and it is not support by quartus 2.
I will try the one you mentioned (Terasic Blaster) the Altera is too expensive.

Is there a way to load the code to the nios2 without byteblaster?
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

I belive the eBay programmer is good for nothing. Will geht the terasic blaster.

THX for your help.
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Hello,

I have an additional question.
Is there a list of the commands the nios is receiving?

I try to implement somewhat like the cli but in the nios.
So I think i only have to know the uart commands to the corresponding commands of the cli.
I could get the commands by debugging and try every cli command but maybe there is allready a list.

Greetings,

Erik
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Thank you for your request.

I had a look to your branch some days ago but I wasnt sure if I can use the code I this state. Yesterday my byteblaster is arrived. I will install it now and than take a further peek to your branch and test the new development.
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Hello,

I have a problem with the new code. I cant run the build_bladerf.sh skript. Becaus of that:

2015.06.08.16:31:00 Info: No custom instruction connections, skipping transform
Exception in thread "main" java.lang.NullPointerException
at com.altera.sopcmodel.transforms.avalon.Domain.getSymmetryCheckerForPoint(Domain.java:308)
at com.altera.sopcmodel.transforms.avalon.Domain.isSymmetric(Domain.java:284)
at com.altera.sopcmodel.transforms.avalon.InitialInterconnectTransform.checkValidDomain(InitialInterconnectTransform.java:108)
at com.altera.sopcmodel.transforms.avalon.InitialInterconnectTransform.doExecute(InitialInterconnectTransform.java:83)
at com.altera.sopcmodel.transforms.SopcTransformStep.execute(SopcTransformStep.java:66)
at com.altera.sopcmodel.transforms.SopcTransformList.doExecute(SopcTransformList.java:112)
at com.altera.sopcmodel.transforms.SopcTransformStep.execute(SopcTransformStep.java:66)
at com.altera.sopcmodel.transforms.mm.MMTransform.doExecute(MMTransform.java:112)
at com.altera.sopcmodel.transforms.SopcTransformStep.execute(SopcTransformStep.java:66)
at com.altera.sopcmodel.transforms.SopcTransformList.doExecute(SopcTransformList.java:112)
at com.altera.sopcmodel.transforms.SopcTransformStep.execute(SopcTransformStep.java:66)
at com.altera.sopcmodel.transforms.avalon.AvalonTransform.doExecute(AvalonTransform.java:48)
at com.altera.sopcmodel.transforms.SopcTransformStep.execute(SopcTransformStep.java:66)
at com.altera.sopcmodel.ensemble.EnsembleUtils.doTransform(EnsembleUtils.java:1332)
at com.altera.sopc.generator.EnsembleGenerationFileSet2.attemptTransform(EnsembleGenerationFileSet2.java:90)
at com.altera.sopc.generator.EnsembleGenerationFileSet2.generate(EnsembleGenerationFileSet2.java:51)
at com.altera.sopc.generator.FileSet2.generate(FileSet2.java:134)
at com.altera.sopc.generator.Sellafield.generate(Sellafield.java:381)
at com.altera.sopcmodel.sbtools.sbgenerate.SbGenerate.act(SbGenerate.java:622)
at com.altera.utilities.AltCmdLineToolBase.runTheTool(AltCmdLineToolBase.java:640)
at com.altera.sopcmodel.sbtools.sbgenerate.SbGenerate.main(SbGenerate.java:1106)

In an older version of your branch maybe from within the last 3 weeks I can run the skript but not run the cli after loading the image because of that:

adminhtw@adminrechner:~$ bladeRF-cli -i -v verbose
[VERBOSE @ libusb.c:515] Using libusb version: 1.0.17.10830
[VERBOSE @ libusb.c:406] Found a bladeRF (idx=0)
[VERBOSE @ libusb.c:458] USB port reset succeeded for bladeRF adcb3b86c8749988eefcf733b81c1912
[VERBOSE @ usb.c:284] Changing to USB alt setting 0
[VERBOSE @ usb.c:284] Changing to USB alt setting 1
[DEBUG @ usb.c:201] Failed to read FPGA version[0]: Operation timed out
Failed to open device (first available): Operation timed out

Is there a way to solve one of these problems.

Thank you

Erik


edit:

The second failure i mentioned is not because of the new code.
It also is present with old versions. When you had attached the usb blaster and had a debug session you are not able to launch the cli after that.

So it seams that it is not possible to load the code to the nios using the usb blaster and than use the cli to check the configs which are done by the nios code.
I have to run the build_bladerf.sh skript every time.

Further there is an error because of the new fpga version.:

[INFO @ version_compat.c:110] FPGA version (v0.2.0) is newer than entries in libbladeRF's compatibility table. Please update libbladeRF if problems arise.
Failed to open device (first available): Operation timed out

How i can update the libbladeRF by myself?

THX Erik
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Good morning,

the first problem was that I not used Quartus II 15 I think.
But now Ihave changed to 15 nothing works any more.

When quartus is analysing the files from the hosted rev the following failure appears.: Error (12074): File /home/adminhtw/bladeRF-dev-nios_refactor/hdl/quartus/work/db/hosted.cmp.rdb is not a recognized design file type
When I start the compilation quartus hangs in analysis and synthesis. And it says "Sorry! The Quartus II software quit unexpectedly." With the following failure.
(The build_bladerf.sh throws the same failure!)

Info (286031): Timing-Driven Synthesis is running on partition "Top"

*** Fatal Error: Illegal Instruction
Module: quartus_map
Stack Trace:
0xbe5e9: MLS_NETLIST::factor_node_recursively(std::vector<std::vector<SGATE_OTERM_INV_PAIR, MEM_STL_ALLOCATOR<SGATE_OTERM_INV_PAIR> >, MEM_STL_ALLOCATOR<std::vector<SGATE_OTERM_INV_PAIR, MEM_STL_ALLOCATOR<SGATE_OTERM_INV_PAIR> > > > const&, CDB_SGATE_COMB*, bool) + 0xc99 (synth_mls)
0xea819: MLS_NETLIST::resynthesize_node(CDB_SGATE_COMB*, int*, int*, MLS_RESYNTHESIZE_CONFIG&, MLS_COLLAPSE_CACHE&, MLS_FFC&, std::vector<CDB_SGATE_OTERM*, MEM_STL_ALLOCATOR<CDB_SGATE_OTERM*> >&, std::vector<CDB_SGATE_NODE*, MEM_STL_ALLOCATOR<CDB_SGATE_NODE*> >&) + 0xc79 (synth_mls)
0xed37b: MLS_NETLIST::resynthesize_nodes(bool, bool, bool) + 0x61b (synth_mls)
0xf50bd: MLS_NETLIST::call_named_function(std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> > const&, std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> > const&, std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> > const&) + 0x10ad (synth_mls)
0x105eff: MLS_INTERFACE::call_named_function(char const*, char const*, char const*) + 0x6f (synth_mls)
0x16e5e3: RTL_SCRIPT::call_named_function(char const*, char const*, char const*, int, int, int) + 0x723 (synth_opt)
0x1711d2: RTL_SCRIPT::process_script(CDB_SGATE_NETLIST*, CDB_SGATE_HIERARCHY*, BASEX_ELABORATE_INFO*, CMP_FACADE*, RTL_SCRIPT_ENUM, char const* (*) [3], int, RTL_SCRIPT_STEP*, RTL_SCRIPT_STEP*) + 0x7b2 (synth_opt)
0x1889e6: opt_process_netlist_scripted(CMP_FACADE*, CDB_SGATE_HIERARCHY*, BASEX_ELABORATE_INFO*, RTL_SCRIPT_ENUM, bool) + 0x376 (synth_opt)
0x51620: RTL_ROOT::process_sgate_netlist(CMP_FACADE*, CDB_SGATE_HIERARCHY*, BASEX_ELABORATE_INFO*, RTL_PASS_ENUM) + 0x558 (synth_opt)
0x18147f: SGN_SYNTHESIS::high_level_synthesis() + 0x16f (synth_sgn)
0x182188: SGN_SYNTHESIS::process_current_stage() + 0x148 (synth_sgn)
0x19153a: SGN_EXTRACTOR::synthesize_partition(unsigned long) + 0x41a (synth_sgn)
0x191fb4: SGN_EXTRACTOR::synthesis() + 0x1d4 (synth_sgn)
0x1a49b8: SGN_EXTRACTOR::synthesis_and_post_processing() + 0x1a8 (synth_sgn)
0x1a52c2: sgn_qic_full(CMP_FACADE*, std::vector<std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> >, MEM_STL_ALLOCATOR<std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> > > >&, std::vector<double, MEM_STL_ALLOCATOR<double> >&) + 0x262 (synth_sgn)
0x248c8: qsyn_execute_sgn(CMP_FACADE*, std::vector<std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> >, MEM_STL_ALLOCATOR<std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> > > >&, std::basic_string<char, std::char_traits<char>, MEM_STL_ALLOCATOR<char> > const&, THR_NAMED_PIPE*, THR_NAMED_PIPE*) + 0x158 (quartus_map)
0x43cb9: QSYN_FRAMEWORK::execute_core(THR_NAMED_PIPE*, THR_NAMED_PIPE*) + 0x1e9 (quartus_map)
0x476ba: QSYN_FRAMEWORK::execute() + 0xbca (quartus_map)
0x2008c: qexe_standard_main(QEXE_FRAMEWORK*, QEXE_OPTION_DEFINITION const**, int, char const**) + 0x872 (comp_qexe)
0x3c458: qsyn_main(int, char const**) + 0x1e8 (quartus_map)
0x49ef0: msg_main_thread(void*) + 0x10 (ccl_msg)
0x5d4c: thr_final_wrapper + 0xc (ccl_thr)
0x49fa5: msg_thread_wrapper(void* (*)(void*), void*) + 0x5b (ccl_msg)
0x6ab3b: mem_thread_wrapper(void* (*)(void*), void*) + 0x9b (quartus_map)
0x8def: err_thread_wrapper(void* (*)(void*), void*) + 0x27 (ccl_err)
0x6112: thr_thread_wrapper + 0x15 (ccl_thr)
0x4bee2: msg_exe_main(int, char const**, int (*)(int, char const**)) + 0xa3 (ccl_msg)
0x21ec5: __libc_start_main + 0xf5 (c.so.6)


End-trace

Result: ERROR: Error(s) found while running an executable. See report file(s) for error message(s). Message log indicates which executable was run last.

ERROR: Analysis & Synthesis Failed
Info (23030): Evaluation of Tcl script ../build.tcl was successful
Info: Quartus II 64-Bit Shell was successful. 0 errors, 52 warnings
Info: Peak virtual memory: 745 megabytes
Info: Processing ended: Thu Jun 11 10:20:55 2015
Info: Elapsed time: 00:04:24
Info: Total CPU time (on all processors): 00:04:27


And the usb_blaster is not longer accessible from eclips to debug. In "Debug Configurations" I can not see the debugger when browse for it. (thats also in quartus 13.1 the problem after installing 15) I will check the devrules again.
But I can see it in quartus.


Im sorry for asking here again but I hope the reason is at least one problem and not a lot. Maybe you had to figure out some of these problems by yourself.

Have a nice day, ;)

Erik
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: What about the Nios2?

Post by bpadalino »

Unfortunately we didn't need to figure out those problems.

Can you successfully create any design at all, or is it just the bladeRF one that is killing you?

If you do the ATSC TX image instead of hosted, does it still crash?

How much memory are you using? What host OS? How much free space on your hard drive?

Brian
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Hello,

I have tested and it seams like I cant create any design with Quartus II 15 but the 13.1 still works but not with the newest code. May this is because of incompatibility and the reason to switch to Quartus II 15.

I am using:

Ubuntu 14.04 64-Bit
3GB RAM
Intel® Pentium(R) D CPU 2.66GHz × 2
Gallium 0.4 on AMD CEDAR
1TB HDD almost free

Because of the last line before "End-trace" in my last post I think the problem hangs on a library. I try to install the right libc.
Maybe I have to uninstall the tons of i386 libs I had to install for the use of Quartus II 13.1. but I will try it first without that because I would go crazy :lol: .

In the worst case I will switch to Windows maybe this will figure out all problems and easily all is running. But it would also take some time so it would be better to get linux running again I think.
I will report when it works.

Greetings,

Erik

edit:

I can now use Quartus 13.1 again :). Will try to get 15 working next week.
bpadalino
Posts: 303
Joined: Mon Mar 04, 2013 4:53 pm

Re: What about the Nios2?

Post by bpadalino »

We've tested here successfully with Ubuntu 14.10 and 15.04.

It sounds like it may just be a library compatibility issue on Quartus' part?

Keep us posted with your status and good luck.

Brian
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Hello again,

at first I have to tell that all hardware and software is running now.
Quartus is still not running on the workstation I used before but now I have a new notebook and it runs.
Further the USB cable was broken. Thats the reason fore the failures.

The last weeks I have developed a VHDL block and at next I will try to get it up and running on the bladeRF.
I'm able to set the gains and the bandwidth by setting up registers of the lms.
I further need to set up the XB200, the samplerate and the frequency.
I have seen on an other thread here that I can use the lms_set_precalculated_frequency() function to set the frequency I want.
But thats my old problem in understanding what about "struct bladerf *dev".
I am not a software developer so maybe someone can explain what I have to do.
As far as I can understand it is the device handler but isn't it only in use if I want to access the bladeRF from the host?
It seams that there are all functions I need but all of them uses the device handler so it will be a great help to know how I have to use it inside the nios.

Thanks,

Erik
erik
Posts: 17
Joined: Mon May 18, 2015 12:35 am

Re: What about the Nios2?

Post by erik »

Hello,

I have figured out that I have just to type 0 for the device handler.
Now i can set up all things from inside the NIOS but can't attatch the xb200 and can't enable tx and rx.
Maybe there is such an easy way like using lms_set_precalculated_frequency() for setting up the frequency.
If so than please let me know.

My goal is to set up the bladeRF completely from the NIOS.
I have only one configuration to set.

Currently I'm using the cli to attach the xb200 and start tx an rx by configuring a file for both one to read from and one to write to. Inside the fpga I throw away the samples from host and use my own sine-generator on tx side and on the rx side I get my signal directly from the lms and ignore the rest is following. (using the hosted rev)
Further I have to use the cli still to set the frequency even if I'm able to set it up by NIOS but it appears an error.
I think this error is because the bladeRF trys to retune in this case.

Thanks for your answer,

Erik
Post Reply