Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alex037yang
OpenXG-RAN
Commits
1bde69c0
Commit
1bde69c0
authored
Dec 19, 2019
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix-clock-source' into integration-develop-nr-2019w51
parents
4143cb16
320e3f1f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
25 deletions
+40
-25
executables/nr-ru.c
executables/nr-ru.c
+3
-0
executables/nr-softmodem.c
executables/nr-softmodem.c
+0
-1
executables/nr-softmodem.h
executables/nr-softmodem.h
+0
-1
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+1
-1
executables/nr-uesoftmodem.h
executables/nr-uesoftmodem.h
+1
-1
targets/ARCH/COMMON/common_lib.h
targets/ARCH/COMMON/common_lib.h
+2
-0
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+32
-20
targets/RT/USER/lte-softmodem.h
targets/RT/USER/lte-softmodem.h
+1
-1
No files found.
executables/nr-ru.c
View file @
1bde69c0
...
...
@@ -2272,6 +2272,9 @@ void RCconfig_RU(void)
LOG_E
(
PHY
,
"Erroneous RU clock source in the provided configuration file: '%s'
\n
"
,
*
(
RUParamList
.
paramarray
[
j
][
RU_SDR_CLK_SRC
].
strptr
));
}
}
else
{
RC
.
ru
[
j
]
->
openair0_cfg
.
clock_source
=
unset
;
}
if
(
strcmp
(
*
(
RUParamList
.
paramarray
[
j
][
RU_LOCAL_RF_IDX
].
strptr
),
"yes"
)
==
0
)
{
if
(
!
(
config_isparamset
(
RUParamList
.
paramarray
[
j
],
RU_LOCAL_IF_NAME_IDX
))
)
{
...
...
executables/nr-softmodem.c
View file @
1bde69c0
...
...
@@ -106,7 +106,6 @@ int config_sync_var=-1;
#endif
volatile
int
oai_exit
=
0
;
static
clock_source_t
clock_source
=
internal
;
static
int
wait_for_sync
=
0
;
unsigned
int
mmapped_dma
=
0
;
...
...
executables/nr-softmodem.h
View file @
1bde69c0
...
...
@@ -23,7 +23,6 @@
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
...
...
executables/nr-uesoftmodem.c
View file @
1bde69c0
...
...
@@ -116,7 +116,7 @@ volatile int start_eNB = 0;
volatile
int
start_UE
=
0
;
volatile
int
oai_exit
=
0
;
static
clock_source_t
clock_source
=
internal
;
static
clock_source_t
clock_source
=
unset
;
int
single_thread_flag
=
1
;
static
double
snr_dB
=
20
;
...
...
executables/nr-uesoftmodem.h
View file @
1bde69c0
...
...
@@ -65,7 +65,7 @@
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
{"
external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, u
ptr:&clock_source, defintval:0, TYPE_INT, 0}, \
{"
clock-source", CONFIG_HLP_EXCCLK, 0, i
ptr:&clock_source, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
...
...
targets/ARCH/COMMON/common_lib.h
View file @
1bde69c0
...
...
@@ -135,6 +135,8 @@ typedef struct {
/*! \brief Clock source types */
typedef
enum
{
//! this means the paramter has not been set
unset
=-
1
,
//! This tells the underlying hardware to use the internal reference
internal
=
0
,
//! This tells the underlying hardware to use the external reference
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
1bde69c0
...
...
@@ -279,13 +279,16 @@ static int trx_usrp_start(openair0_device *device) {
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"DDR"
,
0x7f
,
0x7f
);
//set control register to ATR
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"CTRL"
,
0x7f
,
0x7f
);
//set
ATR register
//set
pins 4 (RX_TX_Switch) and 6 (Shutdown PA) to 1 when the radio is only receiving (ATR_RX)
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"ATR_RX"
,
(
1
<<
4
)
|
(
1
<<
6
),
0x7f
);
// set pin 5 (Shutdown LNA) to 1 when the radio is transmitting and receiveing (ATR_XX)
// (we use full duplex here, because our RX is on all the time - this might need to change later)
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"ATR_XX"
,
(
1
<<
5
),
0x7f
);
// init recv and send streaming
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_START_CONTINUOUS
);
LOG_I
(
HW
,
"Time in secs now: %llu
\n
"
,
s
->
usrp
->
get_time_now
().
to_ticks
(
s
->
sample_rate
));
LOG_I
(
HW
,
"Time in secs last pps: %llu
\n
"
,
s
->
usrp
->
get_time_last_pps
().
to_ticks
(
s
->
sample_rate
));
if
(
s
->
use_gps
==
1
||
device
->
openair0_cfg
[
0
].
time_source
==
external
)
{
s
->
wait_for_first_pps
=
1
;
cmd
.
time_spec
=
s
->
usrp
->
get_time_last_pps
()
+
uhd
::
time_spec_t
(
1.0
);
...
...
@@ -1007,25 +1010,34 @@ extern "C" {
s
->
usrp
=
uhd
::
usrp
::
multi_usrp
::
make
(
args
);
if
(
args
.
find
(
"clock_source"
)
==
std
::
string
::
npos
)
{
LOG_I
(
HW
,
"Using clock_source == '%d'
\n
"
,
openair0_cfg
[
0
].
clock_source
);
if
(
openair0_cfg
[
0
].
clock_source
==
internal
)
{
//in UHD 3.14 we could use
//s->usrp->set_sync_source("clock_source=internal","time_source=internal");
s
->
usrp
->
set_time_source
(
"internal"
);
s
->
usrp
->
set_clock_source
(
"internal"
);
}
else
if
(
openair0_cfg
[
0
].
clock_source
==
external
)
{
//s->usrp->set_sync_source("clock_source=external","time_source=external");
s
->
usrp
->
set_time_source
(
"external"
);
s
->
usrp
->
set_clock_source
(
"external"
);
}
else
if
(
openair0_cfg
[
0
].
clock_source
==
gpsdo
)
{
s
->
usrp
->
set_clock_source
(
"gpsdo"
);
s
->
usrp
->
set_time_source
(
"gpsdo"
);
}
}
else
{
LOG_W
(
HW
,
"clock_source already specified in device arguments! Ignoring command line parameter
\n
"
);
if
(
openair0_cfg
[
0
].
clock_source
==
internal
)
{
//in UHD 3.14 we could use
//s->usrp->set_sync_source("clock_source=internal","time_source=internal");
s
->
usrp
->
set_time_source
(
"internal"
);
s
->
usrp
->
set_clock_source
(
"internal"
);
LOG_D
(
HW
,
"Setting time and clock source to internal
\n
"
);
}
else
if
(
openair0_cfg
[
0
].
clock_source
==
external
)
{
//s->usrp->set_sync_source("clock_source=external","time_source=external");
s
->
usrp
->
set_time_source
(
"external"
);
s
->
usrp
->
set_clock_source
(
"external"
);
LOG_D
(
HW
,
"Setting time and clock source to external
\n
"
);
}
else
if
(
openair0_cfg
[
0
].
clock_source
==
gpsdo
)
{
s
->
usrp
->
set_clock_source
(
"gpsdo"
);
s
->
usrp
->
set_time_source
(
"gpsdo"
);
LOG_D
(
HW
,
"Setting time and clock source to gpsdo
\n
"
);
}
else
{
LOG_W
(
HW
,
"Clock source set neither in usrp_args nor on command line, using default!
\n
"
);
}
}
else
{
if
(
openair0_cfg
[
0
].
clock_source
!=
unset
)
{
LOG_W
(
HW
,
"Clock source set in both usrp_args and in clock_source, ingnoring the latter!
\n
"
);
}
}
if
(
s
->
usrp
->
get_clock_source
(
0
)
==
"gpsdo"
)
{
s
->
use_gps
=
1
;
...
...
targets/RT/USER/lte-softmodem.h
View file @
1bde69c0
...
...
@@ -146,7 +146,7 @@
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"clock
", CONFIG_HLP_CLK, 0, uptr:&clock_source, defintval:0, TYPE_UINT,
0}, \
{"clock
-source", CONFIG_HLP_CLK, 0, iptr:&clock_source, defintval:0, TYPE_INT,
0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0} \
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment