ptrkrysik / uhd

USRP Hardware Driver Repository
Other
6 stars 2 forks source link

UHD-4.4 branch doesn't compile in Ubuntu 22.04 #1

Closed jevkri closed 1 year ago

jevkri commented 1 year ago

Issue Description

The 4.4 branch doesn't compile. The 4.3 branch compiles successfully.

Setup Details

Ubuntu 22.04, g++11

Expected Behavior

Successful compilation

Actual Behaviour

[ 42%] Building CXX object lib/CMakeFiles/uhd.dir/usrp/x400/x400_radio_control.cpp.o In file included from /home/test1/sources/uhd/host/lib/usrp/x400/x400_radio_control.cpp:18: /home/test1/sources/uhd/host/lib/include/uhdlib/usrp/dboard/thinbx/thinbx_dboard.hpp: In member function ‘virtual uhd::usrp::x400::adc_self_cal_params_t uhd::usrp::thinbx::thinbx_dboard_impl::get_adc_self_cal_params(double)’: /home/test1/sources/uhd/host/lib/include/uhdlib/usrp/dboard/thinbx/thinbx_dboard.hpp:86:22: warning: unused parameter ‘tone_freq’ [-Wunused-parameter] 86 | const double tone_freq) override | ~~~^~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, from /usr/include/c++/11/bits/allocator.h:46, from /usr/include/c++/11/memory:64, from /home/test1/sources/uhd/host/include/uhd/features/discoverable_feature.hpp:11, from /home/test1/sources/uhd/host/include/uhd/features/adc_self_calibration_iface.hpp:10, from /home/test1/sources/uhd/host/lib/usrp/x400/adc_self_calibration.hpp:9, from /home/test1/sources/uhd/host/lib/usrp/x400/x400_radio_control.hpp:9, from /home/test1/sources/uhd/host/lib/usrp/x400/x400_radio_control.cpp:7: /usr/include/c++/11/ext/new_allocator.h: In instantiation of ‘void gnu_cxx::new_allocator<_Tp>::construct(_Up, _Args&& ...) [with _Up = uhd::usrp::thinbx::thinbx_dboard_impl; _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}; _Tp = uhd::usrp::thinbx::thinbx_dboard_impl]’: /usr/include/c++/11/bits/alloc_traits.h:516:17: required from ‘static void std::allocator_traits<std::allocator<_Tp1> >::construct(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, _Up, _Args&& ...) [with _Up = uhd::usrp::thinbx::thinbx_dboard_impl; _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}; _Tp = uhd::usrp::thinbx::thinbx_dboard_impl; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator]’ /usr/include/c++/11/bits/shared_ptr_base.h:519:39: required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}; _Tp = uhd::usrp::thinbx::thinbx_dboard_impl; _Alloc = std::allocator; gnu_cxx::_Lock_policy _Lp = gnu_cxx::_S_atomic]’ /usr/include/c++/11/bits/shared_ptr_base.h:650:16: required from ‘std::shared_count<_Lp>::shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = uhd::usrp::thinbx::thinbx_dboard_impl; _Alloc = std::allocator; _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}; gnu_cxx::_Lock_policy _Lp = gnu_cxx::_S_atomic]’ /usr/include/c++/11/bits/shared_ptr_base.h:1342:14: required from ‘std::shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator; _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}; _Tp = uhd::usrp::thinbx::thinbx_dboard_impl; gnu_cxx::_Lock_policy _Lp = gnu_cxx::_S_atomic]’ /usr/include/c++/11/bits/shared_ptr.h:409:59: required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator; _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}; _Tp = uhd::usrp::thinbx::thinbx_dboard_impl]’ /usr/include/c++/11/bits/shared_ptr.h:862:14: required from ‘std::shared_ptr<_Tp> std::allocate_shared(const _Alloc&, _Args&& ...) [with _Tp = uhd::usrp::thinbx::thinbx_dboard_impl; _Alloc = std::allocator; _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}]’ /usr/include/c++/11/bits/shared_ptr.h:878:39: required from ‘std::shared_ptr<_Tp> std::make_shared(_Args&& ...) [with _Tp = uhd::usrp::thinbx::thinbx_dboard_impl; _Args = {uhd::rfnoc::register_iface&, uhd::rfnoc::radio_control_impl::regmap::, uhd::rfnoc::x400_radio_control_impl::x400_radio_control_impl(uhd::rfnoc::noc_block_base::make_args_ptr)::<lambda(size_t)>, long unsigned int, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&}]’ /home/test1/sources/uhd/host/lib/usrp/x400/x400_radio_control.cpp:165:81: required from here /usr/include/c++/11/ext/new_allocator.h:162:11: error: invalid new-expression of abstract class type ‘uhd::usrp::thinbx::thinbx_dboard_impl’ 162 | { ::new((void *)p) _Up(std::forward<_Args>(args)...); } | ^~~~~~~~~~~~~~ In file included from /home/test1/sources/uhd/host/lib/usrp/x400/x400_radio_control.cpp:18: /home/test1/sources/uhd/host/lib/include/uhdlib/usrp/dboard/thinbx/thinbx_dboard.hpp:42:7: note: because the following virtual functions are pure within ‘uhd::usrp::thinbx::thinbx_dboard_impl’: 42 | class thinbx_dboard_impl : public uhd::usrp::x400::x400_dboard_iface | ^~~~~~ In file included from /home/test1/sources/uhd/host/lib/usrp/x400/adc_self_calibration.hpp:11, from /home/test1/sources/uhd/host/lib/usrp/x400/x400_radio_control.hpp:9, from /home/test1/sources/uhd/host/lib/usrp/x400/x400_radio_control.cpp:7: /home/test1/sources/uhd/host/lib/include/uhdlib/usrp/dboard/x400_dboard_iface.hpp:43:18: note: ‘virtual bool uhd::usrp::x400::x400_dboard_iface::select_adc_self_cal_gain(size_t)’ 43 | virtual bool select_adc_self_cal_gain(size_t chan) = 0; | ^~~~~~~~ make[2]: [lib/CMakeFiles/uhd.dir/build.make:3799: lib/CMakeFiles/uhd.dir/usrp/x400/x400_radio_control.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:1124: lib/CMakeFiles/uhd.dir/all] Error 2 make: *** [Makefile:166: all] Error 2

Steps to reproduce the problem

git checkout x411 mkdir host/build cd host/build cmake .. make

ptrkrysik commented 1 year ago

Thanks for reporting the issue! It should be solved now by f2901c62113 commit.

jevkri commented 1 year ago

Good day,

I have encountered another issue. After unzipping and flashing the image to the sdcard I can boot to uboot, not Linux kernel doesn't start. I show the log below.

Did you encounter this error before?

Thanks, Jevgenij

icocom v3.1

port is : /dev/ttyUSB1 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 stopbits are : 1 escape is : C-a local echo is : no noinit is : no noreset is : no hangup is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv -E imap is : omap is : emap is : crcrlf,delbs, logfile is : none initstring : none exit_after is : not set exit is : no

Type [C-a] [C-h] to see available commands Terminal ready

Debug uart enabled U-Boot SPL 2020.10 (Oct 08 2022 - 19:37:31 +0000) PMUFW:      v1.1 Loading new PMUFW cfg obj (2024 bytes) EL Level:   EL3 Multiboot:  0 Trying to boot from MMC2 spl: could not initialize mmc. error: -19 Trying to boot from MMC1 NOTICE: ATF running on XCZU28DR/silicon v4/RTL5.1 at 0xfffea000 NOTICE: BL31: Secure code at 0x60000000 NOTICE: BL31: Non secure code at 0x8000000 NOTICE: BL31: v2.0(release):xilinx-v2019.2 NOTICE: BL31: Built : 19:25:07, Oct 8 2022 U-Boot 2020.10 (Oct 08 2022 - 19:37:31 +0000) Model: PK USRP X411 Board: Xilinx ZynqMP DRAM: 4 GiB PMUFW:      v1.1 EL Level:   EL2 Chip ID:    zu28dr WDT: Not found! MMC: ***@***.***: 0 Loading Environment from MMC... OK In: ***@***.*** Out: ***@***.*** Err: ***@***.*** Bootmode: SD1_LSHFT_MODE ni,mb-eeprom eeprom contents invalid! -1 failed to read from ni,db0-eeprom: -19 failed to read from ni,db1-eeprom: -19 failed to read from ni,dioaux-eeprom: -19 failed to read from ni,clkaux-eeprom: -19 Error: MB EEPROM is uninitialized, using default values from environmentNet: ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 12, interface rgmii-id Warning: ***@***.*** (eth0) using random MAC address - 1e:7a:95:9d:32:49 eth0: ***@***.*** Autoboot in 5 seconds Enter 'noautoboot' to enter prompt without timeout Copying FIT from SD to RAM... 8476868 bytes read in 777 ms (10.4 MiB/s) ## Loading kernel from FIT Image at 02000000 ... Could not find configuration node ERROR: can't get kernel image! ZynqMP> mmcinfo Device: ***@***.*** Manufacturer ID: 56 OEM: 5344 Name: APPSD Bus Speed: 50000000 Mode: SD High Speed (50MHz) Rd Block Len: 512 SD version 3.0 High Capacity: Yes Capacity: 14.6 GiB Bus Width: 4-bit Erase Group Size: 512 Bytes ZynqMP> fatls mmc 0 231060 boot.bin 836728 u-boot.itb ________________________________ From: Piotr Krysik ***@***.***> Sent: Tuesday, May 23, 2023 10:02 AM To: ptrkrysik/uhd ***@***.***> Cc: Jevgenij KRIVOCHIZA ***@***.***>; Author ***@***.***> Subject: Re: [ptrkrysik/uhd] UHD-4.4 branch doesn't compile in Ubuntu 22.04 (Issue #1) Thanks for reporting the issue! It should be solved now by f2901c6 commit. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***>
ptrkrysik commented 1 year ago

I never tried to use this SD card image with ZCU111 that doesn't have EEPROM initialized for X411, so it might be recognized as X10.

You can try newer SD card image: https://chmura.ise.pw.edu.pl/index.php/s/2Fr2N8sSWwaCqGE

But here there might be the same issue.

jevkri commented 1 year ago

So I can use the standard zcu111 image to initialize the EEPROM first. Am I correct?

Thanks


From: Piotr Krysik @.> Sent: Thursday, May 25, 2023 2:49 PM To: ptrkrysik/uhd @.> Cc: Jevgenij KRIVOCHIZA @.>; Author @.> Subject: Re: [ptrkrysik/uhd] UHD-4.4 branch doesn't compile in Ubuntu 22.04 (Issue #1)

I never tried to use this SD card image with ZCU111 that doesn't have EEPROM initialized for X411, so it might be recognized as X10.

You can try newer SD card image: https://chmura.ise.pw.edu.pl/index.php/s/2Fr2N8sSWwaCqGE

But here there might be the same issue.

— Reply to this email directly, view it on GitHubhttps://github.com/ptrkrysik/uhd/issues/1#issuecomment-1562850883, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJKP7MWZQMKN7HY6OOZGAR3XH5IO3ANCNFSM6AAAAAAYKS3R6E. You are receiving this because you authored the thread.Message ID: @.***>

ptrkrysik commented 1 year ago

You need NI's x4xx linux for that, because you won't find eeprom utils needed to initialize ZCU111's EEPROM in petalinux.

For development I booted the board with use of JTAG+TFTP+NFS, so kernel loading process was different. It's possible then that current SD card image can't be booted on a ZCU111 that has wrong EEPROM. In that case something will have to changed in uboot.

ptrkrysik commented 1 year ago

After cleaning the EEPROM and booting from current SD card image it worked. So please download the image that I linked and check it.

jevkri commented 1 year ago

Ok, thank you. I will have another try with the board next week.

In the meantime I have managed to boot the default zcu111 image and move the eeprom tools to that system.

What is the normal size of the eeprom image I should expect after the backup?

Regards, Jevgenij

-------- Original message -------- From: Piotr Krysik @.> Date: 25/05/2023 18:18 (GMT+01:00) To: ptrkrysik/uhd @.> Cc: Jevgenij KRIVOCHIZA @.>, Author @.> Subject: Re: [ptrkrysik/uhd] UHD-4.4 branch doesn't compile in Ubuntu 22.04 (Issue #1)

After cleaning the EEPROM and booting from current SD card image it worked. So please download the image that I linked and check it.

— Reply to this email directly, view it on GitHubhttps://github.com/ptrkrysik/uhd/issues/1#issuecomment-1563176613, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJKP7MWI3FLZT6R445N3XVDXH6A5RANCNFSM6AAAAAAYKS3R6E. You are receiving this because you authored the thread.Message ID: @.***>

ptrkrysik commented 1 year ago

I get 1024 bytes, but for ZCU111 most of it is empty (contains 0xFF). All non-empty values are in the first 256 bytes.

In general there is not much in there. First 18 bytes contain serial number in ASCII (the same number as on a sticker that is on the board). Then on new boards there is MAC address. Near the end there is name of the board and one letter that might be board revision.

jevkri commented 1 year ago

I managed to read the eeprom using the default petalinux image. Everything is exactly how you described it and the size matches as well.

I will try to write the corrected eeprom and figure why your image doesn’t boot the kernel on my board.

Thanks a lot and sorry for the questions.

Jevgenij

From: Piotr Krysik @.> Sent: Thursday, May 25, 2023 21:32 To: ptrkrysik/uhd @.> Cc: Jevgenij KRIVOCHIZA @.>; Author @.> Subject: Re: [ptrkrysik/uhd] UHD-4.4 branch doesn't compile in Ubuntu 22.04 (Issue #1)

I get 1024 bytes, but for ZCU111 most of it is empty (contains 0xFF). All non-empty values are in the first 256 bytes.

In general there is not much in there. First 18 bytes contain serial number in ASCII (the same number as on a sticker that is on the board). Then on new boards there is MAC address. Near the end there is name of the board and one letter that might be board revision.

— Reply to this email directly, view it on GitHubhttps://github.com/ptrkrysik/uhd/issues/1#issuecomment-1563408810, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJKP7MSF4XELK35AGUOGVIDXH6XUNANCNFSM6AAAAAAYKS3R6E. You are receiving this because you authored the thread.Message ID: @.**@.>>

jevkri commented 1 year ago

Hi,

So the image only boots after flashing the eeprom. Probably the script to boot the kernel has some check but I didn't check.

I managed to flash the eeprom from the default petalinux and tested the UHD driver. Everything seems functioning well so far.

I am trying now to compile my own fpga from the source.

Thank you for you work and helpful guides.

Regards, Jevgenij

-------- Original message -------- From: Jevgenij KRIVOCHIZA @.> Date: 26/05/2023 09:47 (GMT+01:00) To: ptrkrysik/uhd @.>, ptrkrysik/uhd @.> Cc: Author @.> Subject: RE: [ptrkrysik/uhd] UHD-4.4 branch doesn't compile in Ubuntu 22.04 (Issue #1)

I managed to read the eeprom using the default petalinux image. Everything is exactly how you described it and the size matches as well.

I will try to write the corrected eeprom and figure why your image doesn’t boot the kernel on my board.

Thanks a lot and sorry for the questions.

Jevgenij

From: Piotr Krysik @.> Sent: Thursday, May 25, 2023 21:32 To: ptrkrysik/uhd @.> Cc: Jevgenij KRIVOCHIZA @.>; Author @.> Subject: Re: [ptrkrysik/uhd] UHD-4.4 branch doesn't compile in Ubuntu 22.04 (Issue #1)

I get 1024 bytes, but for ZCU111 most of it is empty (contains 0xFF). All non-empty values are in the first 256 bytes.

In general there is not much in there. First 18 bytes contain serial number in ASCII (the same number as on a sticker that is on the board). Then on new boards there is MAC address. Near the end there is name of the board and one letter that might be board revision.

— Reply to this email directly, view it on GitHubhttps://github.com/ptrkrysik/uhd/issues/1#issuecomment-1563408810, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJKP7MSF4XELK35AGUOGVIDXH6XUNANCNFSM6AAAAAAYKS3R6E. You are receiving this because you authored the thread.Message ID: @.**@.>>

ptrkrysik commented 1 year ago

I can't reproduce the issue on the recent SD card image and clean EEPROM. I don't know exactly why.

The line of code responsible for recognition of the board by u-boot based on contents of the EEPROM (mb_eeprom) is here:

https://github.com/ptrkrysik/meta-ettus/blob/a1ab2a5030fe3e5afcb4121db6c45d4909d30787/meta-titanium/recipes-bsp/u-boot/files/0001-x411-add-support-for-x411-a-ZCU111-based-USRP.patch#L105

What is needed is probably to get device-tree blob of X411 board if the board is unsupported.

jevkri commented 1 year ago

Hello,

What is the master clock rate supported by the zcu111 board and this UHD mod?

Is it the same as x410?

Thanks

Jevgenij

-------- Original message -------- From: Piotr Krysik @.> Date: 31/05/2023 05:44 (GMT+01:00) To: ptrkrysik/uhd @.> Cc: Jevgenij KRIVOCHIZA @.>, Author @.> Subject: Re: [ptrkrysik/uhd] UHD-4.4 branch doesn't compile in Ubuntu 22.04 (Issue #1)

I can't reproduce the issue on the recent SD card image and clean EEPROM. I don't know exactly why.

The line of code responsible for recognition of the board by u-boot based on contents of the EEPROM (mb_eeprom) is here:

https://github.com/ptrkrysik/meta-ettus/blob/a1ab2a5030fe3e5afcb4121db6c45d4909d30787/meta-titanium/recipes-bsp/u-boot/files/0001-x411-add-support-for-x411-a-ZCU111-based-USRP.patch#L105

What is needed is probably to get device-tree blob of X411 board if the board is unsupported.

— Reply to this email directly, view it on GitHubhttps://github.com/ptrkrysik/uhd/issues/1#issuecomment-1569451146, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJKP7MXW6KCQZKLYHUWKRRTXI25CLANCNFSM6AAAAAAYKS3R6E. You are receiving this because you authored the thread.Message ID: @.***>