Port OpenLTE to libbladeRF 2.x

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
spina
Posts: 2
Joined: Tue Sep 18, 2018 7:46 am

Port OpenLTE to libbladeRF 2.x

Post by spina »

I'm trying to port http://openlte.sourceforge.net/, which has not been updated since July 1017, to libbladeRF 2.x.

I've achieved to fix the compilation errors related to the channels and directions API changes with patch bellow:

Code: Select all

diff --git a/LTE_fdd_enodeb/src/LTE_fdd_enb_radio.cc b/LTE_fdd_enodeb/src/LTE_fdd_enb_radio.cc
index 7e03e08..9f1a011 100755
--- a/LTE_fdd_enodeb/src/LTE_fdd_enb_radio.cc
+++ b/LTE_fdd_enodeb/src/LTE_fdd_enb_radio.cc
@@ -822,7 +822,7 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_radio_bladerf::setup(uint32 idx,
         buffer_size = 1024;
     }
     status = bladerf_sync_config(bladerf,
-                                 BLADERF_MODULE_TX,
+                                BLADERF_TX_X1,
                                  BLADERF_FORMAT_SC16_Q11_META,
                                  BLADERF_NUM_BUFFERS,
                                  buffer_size,
@@ -842,7 +842,7 @@ LTE_FDD_ENB_ERROR_ENUM LTE_fdd_enb_radio_bladerf::setup(uint32 idx,
 
     // Setup sync RX
     status = bladerf_sync_config(bladerf,
-                                 BLADERF_MODULE_RX,
+                                BLADERF_RX_X1,
                                  BLADERF_FORMAT_SC16_Q11_META,
                                  BLADERF_NUM_BUFFERS,
                                  buffer_size,
@@ -974,7 +974,7 @@ void LTE_fdd_enb_radio_bladerf::receive(LTE_FDD_ENB_RADIO_PARAMS_STRUCT *radio_p
     if(radio_params->init_needed)
     {
         // Assume RX_timestamp and TX_timestamp difference is 0
-        bladerf_get_timestamp(bladerf, BLADERF_MODULE_RX, (uint64_t*)&rx_ts);
+        bladerf_get_timestamp(bladerf, BLADERF_RX, (uint64_t*)&rx_ts);
         next_tx_ts            = rx_ts + radio_params->samp_rate; // 1 second to make sure everything is setup
         metadata_rx.flags     = 0;
         metadata_rx.timestamp = next_tx_ts - (radio_params->N_samps_per_subfr*2); // Retard RX by 2 subframes
But before actually trying to run it, I'd like to know whether there are obvious other concerns that I miss, and that may hurt the hardware (a bladeRF x40) : for e.g. I've seen the gains API has also changed quite a bit.

I think this might even relate to your current work to port YateBTS and OpenUMTS to libbladeRF 2.x.
But, while I've searched Yate(BTS) SVN repositories, and the libbladeRF Git repository, I couldn't find any helpful commit. I'm trying to go on my own, but, since you're working on a couple of transceivers (AFAIK YateBTS and OpenUMTS), I thought you may have drafted some guidelines to help porting old implementations to libbladeRF 2.x: would you mind sharing such a README ?

BTW, is the YateBTS port doing good ? Do you have any idea when the first related commits will happen ?

Thanks for your help.

Kind regards,
spina
User avatar
rtucker
Posts: 77
Joined: Sun Jan 25, 2015 10:38 am

Re: Port OpenLTE to libbladeRF 2.x

Post by rtucker »

Greetings,

If you haven't yet, check out the libbladeRF 2.x release notes, which documents the API changes from 1.x to 2.x:

https://www.nuand.com/bladeRF-doc/libbl ... 2_0_0.html

The authoritative version of this is in the source tree at: https://github.com/Nuand/bladeRF/blob/m ... es_2_0.dox

If you have any suggestions for things we missed in that doc, please let us know!
Rey Tucker (she/her)
Systems Engineer, Nuand LLC
Rochester, NY, USA

#WontBeErased
spina
Posts: 2
Joined: Tue Sep 18, 2018 7:46 am

Re: Port OpenLTE to libbladeRF 2.x

Post by spina »

Thank you, this release note is indeed the document I was looking for: found it once, but shamefully lost the pointer.
A quick read confirms my changes to the calls to functions bladerf_sync_config() and bladerf_get_timestamp(), but also shows there are a few other areas of the OpenLTE transceiver I may actually need to fix (for e.g. to use the improved gains API in libbladeRF 2.x).

The release note is well written, and covers a lot of things: I'll read it more carefully, and see where I can go from there.
I'll bump this thread if I have any question, or any useful feedback.

Thanks a lot for your help.

Kind regards,
spina.
thomas3mt
Posts: 1
Joined: Tue Oct 23, 2018 2:19 am

Re: Port OpenLTE to libbladeRF 2.x

Post by thomas3mt »

Hi,

I have attempted to apply your patch Spina and also modify the build system to use mbedtls based on a patch from Shinjo Park here https://sourceforge.net/p/openlte/mailm ... /35039389/

I managed to build and run everything, but it does not seem to work. Application runs, but there is a issue starting by issuing "start" inside openLTE. There is a error. When issuing one more "start" the application says already started. The board does not start blinking, so my guess the problem is opening the device properly.

My patch can be applied on the current git head by issuing "git apply work.patch.txt"

If anyone wants to contribute with anything, Im more than willing to try modifications on my computer/bladerf.

best regards
Thomas
Post Reply