It's actually set in the firmware software code, firmware/usrp3/x300/x300_main.c towards the end. What the host-side UHD does is ask the firmware running on the X3x0 to reply with the content of that piece of memory.

How to figure out such things: you see how the code you found access a leaf "fw_version" in the almighty property tree. You either get very clever with your debugger, or you're like me and just grep for fw_version in the uhd/host/ source code for '"fw_version"', find where that property is created (host/lib/usrp/x300/x300_impl.cpp), then check that source code file for the values/getters/setters that this property has, and see it is just in the end a value poked (via `iface->peek32(SR_ADDR(X300_FW_SHMEM_BASE, X300_FW_SHMEM_COMPAT_NUM));`) from the firmware.
From there, you go into uhd/firmware directory and find that place.

I'd honestly do roughly the same as for that firmware compatibility number, but outside the firmware, directly in FPGA fabric: you instantiate a settings_reg module in your verilog/VHDL, pick an address that isn't in use yet, and then query it from the iface with peek just like the compat version getter does. I'd recommend copying an already functioning settings_reg instance and modifying the address parameter accordingly :)

Best regards,
Marcus

On 08.11.22 18:47, [email protected] wrote:

I found the following line in uhd_usrp_probe that looks like it does what I’m 
looking for:

|if (tree->exists(path / "fw_version")) {|

|ss << "FW Version: " << tree->access<std::string>(path / "fw_version").get()|

|<< std::endl;|

|}|

The next question is where does the firmware version get set? I did some poking around fpga/usrp3/top, but it’s not immediately obvious. Is this set somewhere in the build scripts? I run the standard Makefile when I build my custom image. I would like to write something so I can definitely distinguish this FPGA is running my modified firmware.


_______________________________________________
USRP-users mailing list [email protected]
To unsubscribe send an email [email protected]
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to