Custom build target: Configuration option warnings

Good afternoon,

I am writing a custom build and deployment script for an RP2040 board (pi pico). Everything is working as expected, my build and deployment (including a custom reset, etc) is working as intended. The dependencies on the various targets work as expected as well.

In my script I setup my custom targets like this:


env.AddCustomTarget(
    name="deployonly",
    dependencies="$BUILD_DIR\${PROGNAME}.uf2",
    actions=[
        force_reset_cb,
        run_loader_cb
    ],
    title="Deploy Only",
    description="Manually reset RP2040 to BL mode, upload firmware."
)'

In my code I grab the custom defined variables from the PIO.ini file like so:


tries = int(env.GetProjectOption("bootload_verify_tries"))

The .ini:


[env:pico]
board = pico
extra_scripts = picodeploy.py
bootload_verify_tries = 10

This is how the PIO build system API examples do this as well.

These are working perfectly! The variables change when I update the ini file, however when I run my target, I still get warnings in the output:

Warning! Ignore unknown configuration option `bootload_verify_tries` in section [env:pico]

Though these warnings aren’t impacting the performance, I’d like to know how I tell the build system that these options are being used? Please note that this is just one example, I have a handful of these config options, each of which results in a warning, even though it is used and is working correctly.

This is my first week using PIO, and it’s really excellent. I love the expandable build system, and there is tons of documentation. Thanks for the help!

I have gone through all the options here: Redirecting...
But I did not find anything pertaining to this warning specifically, I could be missing something though.

Best,
D

EDIT: It’s also worth noting that my custom targets DO show up in the PIO targets menu.

Hi,
I am running into a very similar problem and cannot find a way to solve this. Did you finally find a fix ? Thanks, Philippe

Per documentation, custom options need to be starting with custom_, otherwise PlatformIO will think you misspelled one of the built-in options and warn you about it.