Re-build Application issue

Applications, development tools, FPGA, C, WEB
Post Reply
irain04
Posts: 12
Joined: Wed Jul 22, 2015 1:33 pm

Re-build Application issue

Post by irain04 » Tue Sep 12, 2017 3:12 am

Hi all,

I made an application based on the scope+gen application. It works fine with old system which is v.0.91. We have just upgraded the new OS to v0.97 recently and I found that applications cannot be compatible with the new OS.
I read some topics about making controllerhf.so because my application was built with arm-linux-gnueabi-gcc before. I compiled the application again with arm-linux-gnueabihf-gcc. Here are the two Makefiles that I used.
1. Makefile at the main folder:

Code: Select all

APP=$(notdir $(CURDIR:%/=%))

# Versioning system
BUILD_NUMBER ?= 0
REVISION ?= devbuild
VER:=$(shell cat info/info.json | grep version | sed -e 's/.*:\ *\"//' | sed -e 's/-.*//')

INSTALL_DIR ?= .

CONTROLLERHF = controllerhf.so
ZIP = ../../$(APP)-$(VER)-$(BUILD_NUMBER)-$(REVISION).zip

CFLAGS += -DVERSION=$(VER)-$(BUILD_NUMBER) -DREVISION=$(REVISION)
export CFLAGS

all: $(CONTROLLERHF)

$(CONTROLLERHF):
	$(MAKE) -C src

$(ZIP): $(CONTROLLERHF)
	-$(RM) target -rf
	mkdir -p target/$(APP)
	cp -r $(CONTROLLERHF) fpga.conf info index.html target/$(APP)
	sed -i target/$(APP)/info/info.json -e 's/REVISION/$(REVISION)/'
	sed -i target/$(APP)/info/info.json -e 's/BUILD_NUMBER/$(BUILD_NUMBER)/'
	cd target; zip -r ../$(ZIP) *
	$(RM) target -rf

install: $(ZIP)
	unzip $(ZIP) -d $(INSTALL_DIR)/www/apps

clean:
	$(MAKE) -C src clean
	-$(RM) target -rf
	-$(RM) *.so
2. Makefile in src/Makefile:

Code: Select all

CC=$(CROSS_COMPILE)gcc
RM=rm

OBJECTS=main.o fpga.o worker.o calib.o fpga_awg.o generate.o fpga_pid.o pid.o

INCLUDE =  -I$(INSTALL_DIR)/include
INCLUDE += -I$(INSTALL_DIR)/include/api2
INCLUDE += -I$(INSTALL_DIR)/include/apiApp
INCLUDE += -I$(INSTALL_DIR)/rp_sdk
INCLUDE += -I$(INSTALL_DIR)/rp_sdk/libjson

LIBS = -L$(INSTALL_DIR)/lib
LIBS += -L$(INSTALL_DIR)/rp_sdk
LDFLAGS+= -Wl,--whole-archive,--no-as-needed
LDFLAGS+= -lcryptopp -lrpapp -lrp -lrp_sdk
LDFLAGS+= -Wl,--no-whole-archive

CFLAGS+= -Wall -Werror -g -fPIC $(INCLUDE)
LDFLAGS=-shared $(LIBS)

CONTROLLER = ../controllerhf.so

all: $(CONTROLLER)

$(CONTROLLER): $(OBJECTS)
	$(CC) -o $(CONTROLLER) $(OBJECTS) $(CFLAGS) $(LDFLAGS)

clean:
	-$(RM) -f $(OBJECTS)
I found that the application cannot be loaded and I checked the debug.log file in /var/log/redpitaya_nginx/debug.log.
Here is the error message:

Code: Select all

Loading application: '/opt/redpitaya/www/apps/pid+gen/controllerhf.so'
Cannot resolve 'ws_set_params_interval' function.
Cannot resolve 'ws_set_signals_interval' function.
Cannot resolve 'ws_get_params_interval' function.
Cannot resolve 'ws_get_signals_interval' function.
Cannot resolve 'ws_set_params' function.
Cannot resolve 'ws_get_params' function.
Cannot resolve 'ws_set_signals' function.
Cannot resolve 'ws_get_signals' function.
Cannot resolve 'verify_app_license' function.
Cannot resolve 'ws_gzip' function.
Loading scope (with gen+pid extensions) version 0.91-0-devbuild.
Application loaded succesfully!
2017/09/11 05:18:45 [alert] 1501#0: *31 the http output chain is empty, client: 10.165.71.226, server: , request: "GET /bazaar?start=pid+gen^@HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
2017/09/11 05:18:45 [alert] 1501#0: *32 the http output chain is empty, client: 10.165.71.226, server: , request: "POST /data HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
nginx: worker process: symbol lookup error: /opt/redpitaya/www/apps/pid+gen/controllerhf.so: undefined symbol: rp_osc_adc_sign
2017/09/11 05:18:45 [error] 1510#0: *34 Application not loaded, client: 10.165.71.226, server: , request: "GET /data?_=1505107125382 HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
2017/09/11 05:18:45 [alert] 1510#0: *34 the http output chain is empty, client: 10.165.71.226, server: , request: "GET /data?_=1505107125382 HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
Calling application: stop
I found some inline functions in src/worker.c file so I changed "inline" to "static" as a recommendation from Nils Roos in other topics and this fixed the symbol lookup errors.
However, the application doesn't work as it functioned before and the following error messages still happen:

Code: Select all

Loading specific FPGA from: '/opt/redpitaya/fpga/red_pitaya_top.bit'
sh: 1: /opt/redpitaya/www/apps/pid+gen/fpga.sh: not found
Problem running /opt/redpitaya/www/apps/pid+gen/fpga.sh
Loading application: '/opt/redpitaya/www/apps/pid+gen/controllerhf.so'
Cannot resolve 'ws_set_params_interval' function.
Cannot resolve 'ws_set_signals_interval' function.
Cannot resolve 'ws_get_params_interval' function.
Cannot resolve 'ws_get_signals_interval' function.
Cannot resolve 'ws_set_params' function.
Cannot resolve 'ws_get_params' function.
Cannot resolve 'ws_set_signals' function.
Cannot resolve 'ws_get_signals' function.
Cannot resolve 'verify_app_license' function.
Cannot resolve 'ws_gzip' function.
Loading scope (with gen+pid extensions) version 0.91-0-devbuild.
Application loaded succesfully!
2017/09/11 05:28:58 [alert] 1672#0: *62 the http output chain is empty, client: 10.165.71.226, server: , request: "GET /bazaar?start=pid+gen^@HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
2017/09/11 05:28:58 [alert] 1672#0: *63 the http output chain is empty, client: 10.165.71.226, server: , request: "POST /data HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
2017/09/11 05:28:58 [alert] 1672#0: *64 the http output chain is empty, client: 10.165.71.226, server: , request: "GET /data?_=1505107738030 HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
2017/09/11 05:28:58 [alert] 1672#0: *65 the http output chain is empty, client: 10.165.71.226, server: , request: "GET /data?_=1505107738031 HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/pid+gen/?type=run"
I tried to search for solutions but it seems an issue of lua and nginx. I don't know exactly what this is.
Does anyone face the same problem? Any comments are appreciated . Thank you.

irain04
Posts: 12
Joined: Wed Jul 22, 2015 1:33 pm

Re: Re-build Application issue

Post by irain04 » Thu Sep 14, 2017 10:10 am

Update:

I have just updated new OS v0.98. I'm not sure if this is an issue but it seems the scpi manager and network manager have some warnings:

Code: Select all

Calling application: apps
stop_ws_server()
/opt/redpitaya/www/apps/network_manager/controllerhf.so does not exist.
stop_ws_server()
Cannot resolve 'ws_set_params_interval' function.
Cannot resolve 'ws_set_signals_interval' function.
Cannot resolve 'ws_get_params_interval' function.
Cannot resolve 'ws_get_signals_interval' function.
Cannot resolve 'ws_set_params' function.
Cannot resolve 'ws_get_params' function.
Cannot resolve 'ws_set_signals' function.
Cannot resolve 'ws_get_signals' function.
Cannot resolve 'ws_gzip' function.
stop_ws_server()
stop_ws_server()
stop_ws_server()
/opt/redpitaya/www/apps/updater/controllerhf.so does not exist.
stop_ws_server()
/opt/redpitaya/www/apps/scpi_manager/controllerhf.so does not exist.
Cannot resolve 'ws_set_params_interval' function.
Cannot resolve 'ws_set_signals_interval' function.
Cannot resolve 'ws_get_params_interval' function.
Cannot resolve 'ws_get_signals_interval' function.
Cannot resolve 'ws_set_params' function.
Cannot resolve 'ws_get_params' function.
Cannot resolve 'ws_set_signals' function.
Cannot resolve 'ws_get_signals' function.
Cannot resolve 'ws_gzip' function.
stop_ws_server()
2017/09/14 09:05:08 [alert] 1596#0: *213 the http output chain is empty, client: 10.165.71.226, server: , request: "GET /bazaar?apps=^@_=1505379908622 HTTP/1.1", host: "rp-f017ed.local", referrer: "http://rp-f017ed.local/"

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 23 guests