What parameter values are used in the firmware images?

Hi, I’m trying to figure out what parameter values are used in the firmware images, and I was hoping to find the script(s) used to build the images so that I can follow the steps exactly. Is there a repo somewhere that I’m missing?

I’ve been using these commands to learn ArduSub, and they work great:

$ ./waf configure --board Pixhawk1
...
$ ./waf sub
...
BUILD SUMMARY
Build directory: /home/clyde/projects/bluerov2_ignition/ardupilot/build/Pixhawk1
Target       Text (B)  Data (B)  BSS (B)  Total Flash Used (B)  Free Flash (B)
------------------------------------------------------------------------------
bin/ardusub   1336548      1832   194980               1338380          742376

I suppose the parameters are just the defaults from the various locations in the code. But then I came across these param files and I thought I should try to build with these instead – to make sure that I’m getting the exact same parameters. But I can’t seem to get those to work:

$ ./waf configure --board Pixhawk1 --default-parameters=Tools/Frame_params/Sub/bluerov2-4_0_0.params
...
$ ./waf sub
...
Broken revdeps detected on {
	{task 140040649966864: generate_bin ardusub -> ardusub.bin}, 
	{task 140040649967200: build_intel_hex ardusub.bin,Pixhawk1_bl.bin -> ardusub.hex}, 
	{task 140040649966976: generate_apj ardusub.bin -> ardusub.apj}, 
	{task 140040649967088: build_normalized_bins ardusub.bin -> }}

Any advice?

Thanks in advance,
/Clyde

Hi @clyde,

Not sure on this one, so I’ve asked @williangalvani to respond :slight_smile:

Hi @clyde,

This is a bit of a messy subject.

most Libraries in ardupilot have some default defined in them. When a parameter is declared, the last parameter is the default value for it:

 AP_GROUPINFO("VOLT_PIN", 1, AP_BattMonitor_Analog, _volt_pin, AP_BATT_VOLT_PIN),

In this case, a #define is used. this means it can be overriden on a per-board basis by changing the hwdef files.

Additionally, vehicles can override values in their parameters.cpp as we do in Ardusub

For ardusub up to 4.0, we keep some param files in here. These are not used to build the firmware, but by QGC when you click the “load default parameters” button.

But we’re moving away from that, towards having all our defaults properly defined in Ardusub itself.

1 Like

Thanks for the info @williangalvani

For ardusub up to 4.0, we keep some param files in here. These are not used to build the firmware, but by QGC when you click the “load default parameters” button.

So, IIUC, my best bet is to load the params in whatever GCS I’m using. In my case I’m mostly experimenting with SITL so I can load the parameters in mavproxy.

But we’re moving away from that, towards having all our defaults properly defined in Ardusub itself.

Makes sense!

1 Like