sdr_transceiver_hpsdr C-Programm mod

Software von Pavel Demin, HPSDR für den Red Pitaya
Benutzeravatar
Uli DF5SF
Offline
Beiträge: 106
Registriert: Do Mär 31, 2016 6:32 pm

Re: sdr_transceiver_hpsdr C-Programm mod

Beitrag von Uli DF5SF » Fr Mär 23, 2018 11:15 pm


Hallo,

Debuggen findet hauptsächlich im Kopf statt.
Dafür setze ich im Source-Code an "entscheidenden Stellen" den Befehl fprintf(stderr,......). Hiermit kann man sich Kommentare und Inhalt von Variablen anzeigen lassen.
Wenn es ganz schwierig wird lenke ich diese Ausgabe in eine Datei um 2>>.
Da ich unter Linux nicht ausdrucken kann, wird diese Datei mit FTP auf Windows übertragen und von dort gedruckt. Klinkt "amateurhaft", aber es funktioniert.
73 de Uli, DF5SF

Benutzeravatar
Werner B
Offline
Beiträge: 44
Registriert: Sa Okt 28, 2017 2:59 pm

Re: sdr_transceiver_hpsdr C-Programm mod

Beitrag von Werner B » So Mär 25, 2018 8:12 am


Hallo zusammen
auf diese Art finde ich es zu mühsam...

@Pavel
“Read the docs” keeps misleading me.
This time installing the (SDK) development machine unwillingly destroyed the existing C/C++ ARM ECLIPSE IDE finally both were not working.
RP seems to be in love with FPGAs.
For now I don’t care if that is “Field”, “Factory” or “Not at all” programmable. If it was a bunch of hard wired TTL chips doing the DDC and DUC job, fine.

73 Werner

Benutzeravatar
Werner B
Offline
Beiträge: 44
Registriert: Sa Okt 28, 2017 2:59 pm

Re: sdr_transceiver_hpsdr C-Programm mod

Beitrag von Werner B » Sa Mär 31, 2018 9:26 am


Is it possible to compile the “sdr-transceiver-hpsdr” UDP server ( and subsets of its code ) on my VMbox and for the VMbox ?
I have tried “Make” and of cause it does not invoke the cross compiler tool chain on a x86_64 machine.

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
does not work at all.
arm-linux-gnueabihf-gcc -static -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard -D_GNU_SOURCE -lm –lpthread sdr-transceiver-hpsdr.c -o sdr-transceiver-hpsdr
will do some, with some missing arithmetic …
Both would not be usable binaries for local debug and simulation.

gcc -static -O3 -D_GNU_SOURCE sdr-transceiver-hpsdr.c -o sdr-transceiver-hpsdr -lm –lpthread

gcc: error: –lpthread: Datei oder Verzeichnis nicht gefunden
gcc -static -O3 -D_GNU_SOURCE –lm –lpthread sdr-transceiver-hpsdr.c -o sdr-transceiver-hpsdr
a longs list
sdr-transceiver-hpsdr.c: In function ‘icom_write’:
sdr-transceiver-hpsdr.c:334:22: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
if(uart_fd >= 0) write(uart_fd, buffer, 10);
^
/tmp/cckSHPSb.o: In Funktion `calc_log_lookup':
sdr-transceiver-hpsdr.c:(.text+0x16b5): Nicht definierter Verweis auf `log10'
/tmp/cckSHPSb.o: In Funktion `process_ep2'
sdr-transceiver-hpsdr.c:(.text+0x20aa): Nicht definierter Verweis auf `trunc'

/tmp/cckSHPSb.o: In Funktion `main':
sdr-transceiver-hpsdr.c:(.text.startup+0xa0a): Nicht definierter Verweis auf `cos'

sdr-transceiver-hpsdr.c:(.text.startup+0xb07): Nicht definierter Verweis auf `floor'
sdr-transceiver-hpsdr.c:(.text.startup+0xcf6): Nicht definierter Verweis auf `pthread_attr_init'
sdr-transceiver-hpsdr.c:(.text.startup+0xd08): Nicht definierter Verweis auf `pthread_attr_setinheritsched' ….


With Netbeans and Eclipse building for LINUX x86_64 is always stuck with “datagram” ?!? More or less the same error
UDP_DATAGRAM_CQ.png
and a number of subsequent errors ?
UDP_DATAGRAM2_CQ.png
“mmsghdr” should be a structure of “msghdr”s + size defined in “socket.h” ?
They are called datagrams but … where is “datagram” defined ?
Why isn’t “datagram” interpreted ?
I only would like to try and test a few minor changes to the I²C interfaces…
lets say a different approach.

73 Werner

Benutzeravatar
dl1ycf
Offline
Beiträge: 10
Registriert: Mo Jul 02, 2018 9:37 am

Re: sdr_transceiver_hpsdr C-Programm mod

Beitrag von dl1ycf » Mi Dez 05, 2018 4:36 pm


Well, all this is somehow mixed. The definite fact is: if you ONLY want to modify sdr-transceiver-hpsdr.c, you just copy this file on the RedPitaya and compile it there with

gcc -O2 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard sdr-transceiver-hpsdr sdr-transceiver-hpsdr.c -static -lm -lpthread

This is all you need to play around with HPSDR protocols etc., that is, as long as you do not need to modify the FPGA bitstream.

I followed this for properly implementing a TCP connection (rather than UDP), and the debugging is with printf to stderr and watching the screen.

Yours, DL1YCF

Benutzeravatar
DK5QH
Offline
Beiträge: 14
Registriert: Mo Dez 04, 2017 8:56 pm

Re: sdr_transceiver_hpsdr C-Programm mod

Beitrag von DK5QH » Sa Dez 29, 2018 12:47 pm


The discussion on this topic is very helpful.
Since the development of the HAMlab software in my view is not progressing and keeps no longer pace with the standard development, I deal in detail with differences in the software versions. While building the development environments, I'm still undecided about LINUX for the RP board.
@Pavel :
You recommend PSoC Creator from Cypress or MPLAB X from Microchip. Although they come with many nice features for the chips of each manufacturer (not needed for this purpose), I find in both tools just the ability to compile for CORTEX-M. For RP CORTEX-A9 (ie with floating point support) is needed. How did you handle that?

Benutzeravatar
pavel
Offline
Beiträge: 73
Registriert: Sa Mär 05, 2016 10:52 am

Re: sdr_transceiver_hpsdr C-Programm mod

Beitrag von pavel » Mo Dez 31, 2018 1:45 am


You recommend PSoC Creator from Cypress or MPLAB X from Microchip. Although they come with many nice features for the chips of each manufacturer (not needed for this purpose), I find in both tools just the ability to compile for CORTEX-M. For RP CORTEX-A9 (ie with floating point support) is needed. How did you handle that?
I mentioned PSoC Creator or MPLAB X only as an example of good IDEs. I don't use them for my Red Pitaya projects. So, I apologize for the misleading off-topic comment that I posted earlier.

For my Red Pitaya projects, I just use a good editor (like vi, Notepad++, ...) and the command line tools.

Antworten