Especially if you want to modify certain things about the library like table sizes it would make sense to explicitly exclude the STM32Cube version from being in the include path and add the CMSIS-DSP library as a folder to the project. Try using build_unflags for that with something like build_unflags = -I$PROJECT_PACKAGES_DIR/framework-stm32cubef4/Drivers/CMSIS/DSP/Include (completely untestedd) in conjuction with putting the CMSIS-DSP sources from either the original STM32Cube package version or a newer version as referenced above in a new folder in lib/. (You might have to remove the library.properties file from my version to get it to be accepted for framework = stm32cube).
In any case, the STM32Cube builder script can be improved here to at least have the option of buildding its included Drivers/CMSIS/DSP package. I’ll see to it to open an issue about that.
@maxgerhardt Thanks for detailed explanation, i will use it as plan B.
I’d like to avoid copying of external sources to project’s repo (not nice practice). So, 2 more questions:
Is it possible to just add $PROJECT_PACKAGES_DIR/framework-stm32cubeg0/CMSIS/DSP/Source/**/* as my project sources? It’s not critical to build those as standalone lib.
Is it possible to use lib_deps = https://github.com/ARM-software/CMSIS_5/archive/5.8.0.zip and organize paths to dsp headers/sources manually (via python script will be ok too)?
Possible via lib_deps with a file:// URI. Untested.
The shell script of the Arduino_CMSIS_DSP library I referenced already does that to generate an Arduino-compatible library layout, which is thus also PlatformIO compatible.
Tried. Seems doesn’t work. Probably, not expands variable (i also tried to cut path to be sure not mistyped nested folders).
Library Manager: Installing file://$PROJECT_PACKAGES_DIR/framework-stm32cubeg0/CMSIS/DSP/Source/
FileNotFoundError: [Errno 2] No such file or directory: '$PROJECT_PACKAGES_DIR/framework-stm32cubeg0/CMSIS/DSP/Source/':
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/builder/main.py", line 180:
env.SConscript("$BUILD_SCRIPT")
File "/home/vitaly/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py", line 597:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/vitaly/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Script/SConscript.py", line 285:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "/home/vitaly/.platformio/platforms/ststm32/builder/main.py", line 121:
target_elf = env.BuildProgram()
File "/home/vitaly/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Util.py", line 748:
return self.method(*nargs, **kwargs)
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/platformio.py", line 62:
env.ProcessProjectDeps()
File "/home/vitaly/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Util.py", line 748:
return self.method(*nargs, **kwargs)
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/platformio.py", line 141:
project_lib_builder = env.ConfigureProjectLibBuilder()
File "/home/vitaly/.platformio/packages/tool-scons/scons-local-4.2.0/SCons/Util.py", line 748:
return self.method(*nargs, **kwargs)
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 1104:
project.install_dependencies()
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/builder/tools/piolib.py", line 940:
lm.install(spec)
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/package/manager/_install.py", line 48:
pkg = self._install(
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/package/manager/library.py", line 91:
return super(LibraryPackageManager, self)._install(
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/package/manager/_install.py", line 97:
pkg = self.install_from_url(spec.url, spec, silent=silent)
File "/home/vitaly/.platformio/penv/lib/python3.8/site-packages/platformio/package/manager/_install.py", line 135:
shutil.copytree(_url, tmp_dir, symlinks=True)
File "/usr/lib/python3.8/shutil.py", line 555:
with os.scandir(src) as itr:
Is that fixable?
I understand. My question is “Is it possible to hack paths without copying cmsis dsp sources into project repo?”. I will copy, if all alternatives fail, but wish to avoid that (if possible).
One can add a little piece of Python script to add the files to the build system so that they are compiled. Using the same env.BuildSources() or env.BuildLibrary() function as the builder script uses.
However, since you say you want to modify the header or source files, that is then not possible unless you modify framework-internal files. So having the library in the lib/ folder in the version you want should be the best solution.
I temporary copied files to my project to check build. Seems i have to replace cmsis dsp with something different. After all optimizations, table sizes for arm_rfft_q31(…) is still huge.