in the top level pico-sdk folder
$ python3 tools/build_all_headers.py $PWD /tmp/build_all_headers.out
Traceback (most recent call last):
File "/cygdrive/c/git/pico-sdk/tools/build_all_headers.py", line 66, in <module>
raise Exception("Duplicate include file '{}' (found in both {} and {})".format(include_file, include_locations[include_file], include_path))
Exception: Duplicate include file 'boot_stage2/config.h' (found in both rp2040/boot_stage2/include and rp2350/boot_stage2/include)
workaround - add IGNORE_DIRS.add('rp2040') or IGNORE_DIRS.add('rp2350')
While useful, there were no examples of this tool being used.