Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XB200 unnecessary error thrown #882

Closed
ratzrattillo opened this issue Oct 15, 2022 · 2 comments
Closed

XB200 unnecessary error thrown #882

ratzrattillo opened this issue Oct 15, 2022 · 2 comments
Labels
Product: XB-200 Resolve: PR will close Will be closed by an upcoming PR

Comments

@ratzrattillo
Copy link

ratzrattillo commented Oct 15, 2022

I noticed that when using the XB-200 expansion board and setting the frequency always the following error will be thrown:

[ERROR @ host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c:2398]
Consider supplying the quick_tune parameter to bladerf_schedule_retune() when the XB-200 is enabled.

This is due to the function bladerf1_set_frequency always calling schedule_retune with NULL as the quicktune parameter, when the tuning mode is BLADERF_TUNING_MODE_FPGA:
https://github.com/Nuand/bladeRF/blob/master/host/libraries/libbladeRF/src/board/bladerf1/bladerf1.c#L2069

The function bladerf1_schedule_retune always checks, if the quicktune parameter is NULL, and throws the error above, if the XB-200 is attached.

Thus, the error can never be avoided, because as soon as calling set_frequency with an XB-200 attached, the error will be thrown.

I propose to get the quicktune parameters and supplying them before calling schedule_retune, when the XB-200 is attached.

This could be a solution replacing line 2069 in bladerf1.c:

if (attached == BLADERF_XB_200) {
    bladerf_quick_tune qt;
    status = bladerf_get_quick_tune(dev, ch, &qt);
    if (status != 0) {
        return status;
    }
    status = dev->board->schedule_retune(dev, ch, BLADERF_RETUNE_NOW, 0, &qt);
}
else {
    status = dev->board->schedule_retune(dev, ch, BLADERF_RETUNE_NOW, frequency, NULL);
}

What do you think? Looking forward to your feedback!

Another idea would be to stop throwing this error and rather printing it as INFO, to remind the programmer of setting the frequency with the quicktune parameters, leading to an example page like e.g.: https://nuand.com/libbladeRF-doc/v2.2.1/tuning.html

@ratzrattillo
Copy link
Author

Added a pull request: #883

@rthomp10 rthomp10 added Component: bladeRF-cli bladeRF-cli utility Product: XB-200 and removed Component: bladeRF-cli bladeRF-cli utility labels Jan 17, 2023
@rthomp10
Copy link
Collaborator

I believe changing the log message to INFO serving as a reminder is the right way to go. The issue will be fixed in the next release.

@rthomp10 rthomp10 added the Resolve: PR will close Will be closed by an upcoming PR label Jan 17, 2023
rthomp10 added a commit that referenced this issue Mar 31, 2023
XB-200 quick tune parameter recommendation now considered log info rather 
than an error.

Fix #882
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product: XB-200 Resolve: PR will close Will be closed by an upcoming PR
Projects
None yet
Development

No branches or pull requests

2 participants