Sync config issues

Discussions related to embedded firmware, driver, and user mode application software development
Post Reply
Jaco
Posts: 28
Joined: Wed Jul 30, 2014 2:03 am

Sync config issues

Post by Jaco »

Hi,

I'm trying to use the synchronous tx / rx interface in a C program. Thus far I can set up all device configuration, and every setting checks out when I test it in the command line interface.

However, when setting up the synchronous interface, it doesn't seem to actually write anything. Here's a snippet from my sync_config function:

Code: Select all

	status = bladerf_sync_config(	dev, 
					stream->module, 
					BLADERF_FORMAT_SC16_Q11, 
					stream->num_buffers, 
					stream->buffer_size, 						
					stream->num_transfers, 
					stream->stream_timeout);

	if (status!=0){
		fprintf(stderr, "%s %s\n", "Failed to configure sync interface:",  bladerf_strerror(status));
		bladerf_close(dev);
		return status;
	}
	printf("DONE\n");
where my stream struct is defined as:

Code: Select all

struct bladerf_stream{
	bladerf_module module;
	size_t	num_buffers;
	size_t	buffer_size;
	size_t	num_transfers;
	int32_t stream_timeout;	
	};
and initialized based on earlier settings. Printing them to the stdio gives the correct values, but when I run tx (or rx) in bladeRF-cli to show the config settings on the device, it just prints out the default settings.

If I'm not mistaken, the bladeRF-cli uses the async interface, which now that I mention it is why I'm not seeing a difference ... >.<

Is there any suggestion to test whether I actually wrote the correct sync config settings to the device?

Any input will be hugely appreciated.
jynik
Posts: 455
Joined: Thu Jun 06, 2013 8:15 pm

Re: Sync config issues

Post by jynik »

Hi Jaco,

Sorry for the delay -- I thought I replied to this a few days ago, only to find that I apparently wandered off without every actually hitting "Submit."

I don't believe you're doing anything incorrect here. The (a)sync stream configuration items are simply software settings that are not persistant. They are stored in the struct bladerf device handle, so they only "live" as long as you have a valid device handle. What you're seeing when you open the CLI are some default values in the device handle opened by the CLI program.

On the other hand, settings like samplerate, frequency, bandwidth, etc. are based upon the configuration of physical hardware and the state of the associated register values. Therefore, these persist across the lifetime of host programs.

Does that make sense?

Cheers,
Jon
Jaco
Posts: 28
Joined: Wed Jul 30, 2014 2:03 am

Re: Sync config issues

Post by Jaco »

Hi John, thanks for the response, I appreciate the input.

This does make sense, I've played around with it over the weekend and I've noticed that when changing settings in the CLI (stream settings specifically), these settings do not persist when I close and re-open the CLI.

My next step is figuring out a plan to test the transmitter - running in full-duplex mode by making a call to sync_rx shortly after sync_tx and analysing the contents of the received file, easier said than done I know. I'll post here if I find anything interesting.

Cheers,
Jaco
Post Reply