sdr_transceiver_hpsdr C-Programm mod

Software von Pavel Demin, HPSDR für den Red Pitaya
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 19 Mär 2018, 12:04

Hallo,
gibt es irgendeine probate Möglichkeit den C-Code “sdr_transceiver_hpsdr“ zu ändern ?
Ich habe nun >> 100 Stunden lang versucht irgendeine IDE, SDK, (nenn es wie du willst) zum Laufen zu bekommen.
Google glüht noch …
Alle Anleitungen münden in ein heilloses Durcheinander.
Möglicherweise könnte ich nun die FPGA verhunzen, das will ich aber nicht.

Mit ECLIPSE komme ich noch am weitesten.
Ich kann das ändern und kompilieren, kann den RedPitaya einbinden, kann es jedoch nicht debuggen.
„Could not determine GDB version using command: /opt/Xilinx/SDK/2017.2/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/runtest –version Unexpected output format: ERROR: unable to find expect in the PATH“

Für Vivado wird immer das FPGA Design erklärt ?
Schließlich habe ich HLS „entdeckt“, im „richtigen“ Programm kann ich es aber nicht kompilieren
und somit auch nicht simulieren ( was mir am liebsten wäre )
Einige "includes" werden nicht aufgelöst ? Der "cross Compiler" geht ?
Ich kenne mich ein wenig mit IDEs(SDK) aus, IAR, KEIL, AVR Studio(VisualStudio), finde meinen Weg.
Ich frage mich was die Leute bei Vivado rauchen, so ein Sch.. G(U)I ohne User. :evil: 30GB bullshiut

Hat / kennt jemand eine funktionierende Lösung ?
Meinetwegen auch gerne WINDOWS , damit hatte ich aber die ärgsten Probleme.
OS spezifisch …

ORACLE Virtual Box
Version 5.2.8 r121009 (Qt5.6.2)

LINUX UNBUNTU 16.04

Eclipse IDE for C/C++ Developers
Version: Oxygen.2 Release (4.7.2)

Xilinx Vivado 2017.2 HL,HLS und SDK :evil:

Wozu ?
Ich möchte zurück auf den kleinsten gemeinsamen Nenner.
Ich möchte auf den EP2 des METIS Protokoll aufsetzen.
Bis hier wäre alles gleich und somit wäre es auch Wurst welches SDR PC Programm benutzt wird.
Was der RedPitaya nicht selbst verwirklicht sollte die angeschlossene Hardware sich selbst decodieren.

Grüße
Werner
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 19 Mär 2018, 16:10

Hello Werner,

If you just want to compile sdr-transceiver-hpsdr.c, then you don't need Xilinx Vivado. Any ARM toolchain based on GCC and supporting the arm-linux-gnueabihf target should be OK. The compilation command is

Code: Alles auswählen

arm-linux-gnueabihf-gcc -static -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -D_GNU_SOURCE sdr-transceiver-hpsdr.c -o sdr-transceiver-hpsdr -lm -lpthread


It's also possible to compile sdr-transceiver-hpsdr.c directly on Red Pitaya. Depending on the SD card that you're using, the GCC compiler can be installed with one of the following commands:

Best regards,

Pavel
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 19 Mär 2018, 16:19

If you have Windows 10, then here is an article explaining how to install the arm-linux-gnueabi toolchain using the Linux sub-system for Windows:

http://work.eswarprakash.com/2016/12/10 ... windows-10

Just replace 'apt-get install gcc-arm-linux-gnueabi' with 'apt-get install gcc-arm-linux-gnueabihf'. The last two letters ('hf') are important.
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 19 Mär 2018, 16:25

Hello Pavel,

I am not a native C-person, but might get around with some help from a good IDE.
With TTY “gedit” and a command line “gcc” I will be lost. Disastrous trial and error …
I cannot imagine the C-part of the coding is always done like that and I wonder why none of the guidance leads to anything functional.

I have got the strange feeling, some things can be seen UDP on the C&C at EP2 but they just don’t get passed out the Red Pitaya the right way …
Now it is hard to trace and impossible to debug :O(
I am also missing the heart beat of the round robbing at EP2.
My system is HAMLAB alike, used both worlds and needs to know if openHPSDR is powered or off, up and running or down.


Best regards
Werner
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 19 Mär 2018, 16:29

Ups that is simultanious...
I came across this hardware floating versus software.
Hundreds of hits at google, all leading to a dead end with no answers finally.
At one point cross compiling failed with *hf, can’t remember which constellation.
File not found …
Just found it, some sources ECLIPSE is doing that :
/lib/ld-linux-armhf.so.3: No such file or Directory
Just putting it there raises new errors ..

I will check out your link, but I only got WINDOWS 7 prof 64bit.
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 20 Mär 2018, 08:27

I will check out your link, but I only got WINDOWS 7 prof 64bit.


The solution from the link requires Windows 10.

In your first post, you mentioned that you have Ubuntu 16.04. Under Ubuntu 16.04, you can install the required compiler with the following command:

Code: Alles auswählen

sudo apt-get install gcc-arm-linux-gnueabihf
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 20 Mär 2018, 11:38

Hello Pavel,
thank you very much.
Strange it doesn’t work like this on my side ( again )
I found some instructions last night
nur_so.png
that do seem to make some sense for Eclipse ? It needs all steps ?!?
Eclipse.png
But it is ( I'm) missing a number of declarations ?
And I am not really sure what it is doing, the includes do not look right.
It will show ARM for new, empty projects ( vanishing as soon ... )

I had thought someone, somewhere pops up :
“ Here is a copy of my ECLIPSE, KEIL, IAR, VisualStudio etc. project, template, export etc.” ready to roll.
May be a Xilinx thing with a few hundred pages on how to easily import it again :O)

Is all that can be done with it a blinky LED, letter by letter on a command line ?
And does it take a FPGA to make it blink ?

It all seems to be a waste of time.

Best regards
Werner
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 20 Mär 2018, 13:27

Hello Werner,

I have an impression that you've chosen the most difficult way to build my code.

I've just checked that under Ubuntu 16.04, sdr-transceiver-hpsdr.c builds with just two commands:

Code: Alles auswählen

sudo apt-get install gcc-arm-linux-gnueabihf libc-dev-armhf-cross
arm-linux-gnueabihf-gcc -static -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -D_GNU_SOURCE sdr-transceiver-hpsdr.c -o sdr-transceiver-hpsdr -lm -lpthread


All the required include files are in libc-dev-armhf-cross. Since I forgot about it when writing my previous comment, maybe this package is still missing on your system.

Best regards,

Pavel
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 20 Mär 2018, 13:50

Some more thoughts...

Since you mentioned debugging in your first post, I think that the most efficient would be to debug the code when it's running on Red Pitaya.

Both Eclipse and NetBeans support remote compilation and debugging via SSH. Here are the links to the documentation:

https://help.eclipse.org/kepler/index.j ... oject.html
https://netbeans.org/kb/docs/cnd/remote ... orial.html
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 20 Mär 2018, 17:42

War_schon_IDE_cq.png
it all seems to be there.
Weiter_cq.png
It still doesn't built any usefull "bin"

Some defines / declares are bugging it ?
Some options are "wrong" ?
I don't know anymore.

Connecting Red Pitaya / remote file System does not seem to be a problem though.
May be it even would debug ....
Remote_System_cq.png
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 20 Mär 2018, 18:12

All the highlighted problems on your screenshot are Eclipse related. These aren't problem with the code. The correct compilation command is in my previous post. I think that the solution is to just carefully follow the Eclipse documentation. The following links point to the relevant chapters:

Creating a simple application:
https://help.eclipse.org/kepler/index.j ... _basic.htm

Building a project:
https://help.eclipse.org/kepler/index.j ... _build.htm
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 21 Mär 2018, 15:32

Hello Pavel,

… GNU autoconf, configure and make scripts for GNU compiler, binutils and eglibc are extremely large and complex software.
Unlike normal software development, it is almost always impossible to decipher any useful information from printed error messages.
Nobody in the world except elite GNU developers understands them.
If something does wrong, go Google for it. Probably someone already saw that particular problem. In any case, trying to handle it entirely by yourself is just waste of time.
Because the entire thing is very fragile and it's very easy to break something in the course, it's very important to perform all actions on the virtual machine(s) and take snapshots after each major success. Otherwise you'll have to restart this Rube Goldbergy each from the scratch.
Only few will go all the way to the end, and everyone of those people will have strong personal qualities of perseverance and total neglection of failures. Impatient and emotional character types should …

I've got some from the link … there is a piece of hardware.
The hardest part is done in the FPGA, thanks to Pavel.
I could imagine a number of things to be done with the rest of it.
Unfortunately it would be a quantum leap and I am not going for.
Some 40 years ago I used to toggle binaries in d-i-g-i-t-a-l PDP8. Yes, I was happy when we got a punched tape reader …
But I m not going to develop and debug with an egg and a tooth pick on a Red Pitaya..
It simply isn’t spread and supported like Arduinos, Discoveries, Raspberries and name it ... Where you setup an IDE in two or three mouse clicks.
I will just leave it alone.

Best Regards
Werner

P.S. yes, it doesn't do "Hello World" either.
But I can do it from a TTY console ...
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 21 Mär 2018, 18:38

It simply isn’t spread and supported like Arduinos, Discoveries, Raspberries and name it ...


One more idea. If you can find the Raspberry Pi instructions that work for you, then I'd suggest to follow these instructions to install the IDE and the compiler. Red Pitaya has the same CPU as Raspberry Pi and the same toolchain works for both Red Pitaya and Raspberry Pi.
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 22 Mär 2018, 07:13

Hello Pavel,
I can leave some question marks. But I don’t think I know what I’m talking about anymore.

Years ago I’ve been playing with STM32F407VGT6-Mikrocontroller ARM Cortex®-M4 and ST-Link to xyz IDE.
Latest Raspberry is Cortex-A53 ?
For WINDOWS all free cross compilers I can find are bare metall and ARMv8-M (Hard FP) latest.

We are up to ARM-9 hardware floating point ?
They say there is for LINUX ? But it seems to be a rumor away from the command line Interpreter ?

There must be one inside Vivado but I am just too stupid for HLS or should it be SDK ?
I even cannot really figure the purpose of their three programs ?

All I can see and find is :
/lib/ld-linux-armhf.so.3: No such file or directory.
With no solution ?
May be just the *hf is the point where it all crashes about ?

Best regards
Werner
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 22 Mär 2018, 08:41

Latest Raspberry is Cortex-A53 ?


Yes, the Raspberry 3 CPU is ARMv8-A/Cortex-A53 and it's backwards compatible with ARMv7-A/Cortex-A7.

The Raspberry 2 CPU is ARMv7-A/Cortex-A7.

The Red Pitaya CPU is ARMv7-A/Cortex-A9.

ARMv7-A/Cortex-A7 and ARMv7-A/Cortex-A9 are very similar CPUs and the tools that work for Raspberry 2 should also work for Red Pitaya.

/lib/ld-linux-armhf.so.3: No such file or directory.


From your description it's not clear what command generates this error message.

I've just checked that I don't have /lib/ld-linux-armhf.so.3 on my development machine.

The instructions for installing the development machine can be found at
http://pavel-demin.github.io/red-pitaya ... t-machine/

There must be one inside Vivado but I am just too stupid for HLS or should it be SDK ?
I even cannot really figure the purpose of their three programs ?


Vivado is for programming the FPGA using Verilog and VHDL.

HLS is for programming the FPGA using C and C++.

SDK is for programming the CPU using C and C++.
Uli DF5SF
Beiträge: 106
Registriert: 31 Mär 2016, 18:32

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Uli DF5SF » 22 Mär 2018, 14:49

Hello Werner,
your first question was, how to change the C-code:

Werner B hat geschrieben:Hallo,
gibt es irgendeine probate Möglichkeit den C-Code “sdr_transceiver_hpsdr“ zu ändern ?


I have the following simple solution. It is working here since several weeks:

On Windows you need FTP-client with SFTP-protocol (e.g. filezilla), SSH-client (e.g. putty) and an ASCII-editor (e.g. notepad++)

On RedPitaya I have RedPitaya GNU/Linux Ecosystem V0.97 Build 560 with Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-xilinx armv71). Last update 03.01.2018.

Now connect to RedPitaya with SSH, change to directory /opt/redpitaya/www/apps/sdr_transceiver_hpsdr and the following command:
# rw

Now connect with FTP-Client (SFTP-Protocol) to RedPitaya. Change to directory /opt/redpitaya/www/apps/sdr_transceiver_hpsdr
Among other files you see Makefile and sdr-transceiver-hpsdr.c Download the C-file and make your changes. After that upload the file.

After this you can compile with following commands:
# make clean
# make
# ro

Restart RedPitaya and you have your new version. That's it. I hope it helps ....
73 de Uli, DF5SF
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 23 Mär 2018, 05:14

Hello Pavel, Hello Uli.

Thank you Uli. I think there must be better ways. What you do and describe is the traditional trial and error.
Which isn’t what I am used to and what I am looking for. I should have asked better.
A good IDE ( EDT, SDK etc) will make life a lot easier. Coding can be fun.
More efficient, less time consuming, less error prone is what I expect from a 300Euro single board computer in 2018.
When you read the RP docs you might get the impression there is.

It doesn’t clearly say here is what you will need for FPGA design.
This is where I took the wrong turn ? I didn’t know that all of this hustle is useless for what I want to do.
The SDK is mentioned to be added and it is only a few percent of the whole 30 GB bundle.
The second best disaster has been the Vivado installation.
It does not install the promised program icon, short cuts, etc. Repeatedly on my side and according to google on many other user’s end as well.
Most end up with not knowing how and what to start ( under LINUX only ?).

A very busy thread in their forum is about just launching one of their programs. I.e. SDK.
See a three page thread on how to lauch it :O( There is a large community that wonders what and how to start at all.
https://forums.xilinx.com/t5/Embedded-Development-Tools/Vivado-2016-1-SDK-launch-problem/td-p/693615
Typical confusing Xilinx stuff.

(**** Picture greeting from Eclipse ***)
Then you will be surprised to end up in yet another ECLIPSE installation.
It comes unnoticed and in disguise named as a Xilinx SDK.
You probably should not have two gods at a time ?

(**** Screen shot of ECLIPSE II alias EDT (SDK) Vivado ****)
It doesn’t mean ECLIPSE II is working yet, but it isn’t dummy dead as ECLIPSE I in the end…
I wish I had tested ECLIPSE I before installing ECLIPSE II.

73 Werner
somehow I cannot add any files or pictures anymore.
pavel
Beiträge: 71
Registriert: 05 Mär 2016, 10:52

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon pavel » 23 Mär 2018, 08:39

A good IDE (EDT, SDK etc) will make life a lot easier. Coding can be fun.


I'm afraid that your expectations are too optimistic. In an ideal world there could be an ideal IDE that makes life easier. Unfortunately, it's very often not the case in our real world.

Every so often, I test various IDEs trying to find a perfect one. From my experience, everything based on Eclipse is overcomplicated, counterintuitive and with badly designed user interface. The only one that was really fun to use was PSoC Creator from Cypress. MPLAB X from Microchip is also good but less fun than PSoC Creator. For all the other platforms, a good editor (like vi, Notepad++, ...) and the command line tools are in my opinion the only usable solution.
Werner B
Beiträge: 44
Registriert: 28 Okt 2017, 14:59

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon Werner B » 23 Mär 2018, 11:12

I agree on ECLIPSE.
But RP recommends Vivado SDK which is ECLIPSE in the bitter end.
I am very disappointed, left in the rain with setting up ECLIPSE myself.
RP does not give a prebuilt “Hello World!” example, ready to roll, fixing the ECLIPSE SDK for me ?
Hardware, board, OS …
Benutzeravatar
DH1AKF
Beiträge: 75
Registriert: 29 Feb 2016, 18:30

Re: sdr_transceiver_hpsdr C-Programm mod

Beitragvon DH1AKF » 23 Mär 2018, 19:03

Hallo Werner,
den Hinweisen von Uli, DF5SF kann ich vollkommen zustimmen: Genau so entwickle ich die Software für den "DiscoRedTRX" (eine PC- unabhängige Lösung mit STM32F7Discovery) weiter.
Sicher wäre ein Echtzeit- Debugger wünschenswert, aber für dynamische Prozesse muss man sich schon selbst etwas einfallen lassen.
Interessant wäre zu wissen, wie Detlev (DL4AOI) dieses Problem angepackt hat.
73, Wolfgang

Zurück zu „Pavel HPSDR“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast