My colleagues from the Arm Digital Signal Processing (DSP) software team have introduced a Python wrapper for the CMSIS-DSP library that is compatible with NumPy. The CMSIS-DSP library is a rich collection of DSP functions that Arm has optimized for the various Arm Cortex-M processors. CMSIS-DSP is widely used in the industry, and also enables optimized C code generation from various third-party tools.
Please read their blog here: https://developer.arm.com/architectures/instruction-sets/dsp-extensions/dsp-for-cortex-m/how-to-use-the-python-wrapper-for-csmsis-dsp-with-biquads-as-an-example
Thanks for the post, Christopher,
Do you know of any examples using NumPy on a microcontrolller? I did see this link but was curious about other good getting started resources.
https://developer.arm.com/solutions/machine-learning-on-arm/developer-material/how-to-guides/converting-a-neural-network-for-arm-cortex-m-with-cmsis-nn/single-page
Hello Ron,
actually, the goal is the opposite: running CMSIS-DSP on an x86 and use it with NumPy to ease the move from a signal processing chain to its implementation. As far as I know, NumPy has not been optimized for microcontrollers, so it might not be very useful to use it on such a device.
Kind regards,
Christopher
Is a micropython compatible wrapper for CMSIS-DSP or CMSIS-NN in the pipeline?
Dear Christopher! We are very enthusiastic about this wrapper and would like to use it but we keep getting errors when trying to install the package/library. I am working an MacOS and my colleague is working on Windows and we both get the same error message:
"ERROR: /Users/liselynen/OneDrive - Capetech BVBA/190521 Python Scripts/cmsdsp-tests/PythonWrapper/setup.py is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with svn+, git+, hg+, or bzr+)."
Can you or one of your colleagues help us out on this?
An update on this, on Mac we made some progress, the error message we get now is the following:
File "setup.py", line 22, in <module>
transform.remove(os.path.join(ROOT,"Source","TransformFunctions","TransformFunctions.c"))
ValueError: list.remove(x): x not in list
Does this has to do with the fact I am working on Mac OS? Should I adapt the setup.py code ?
I'll ask my colleagues to look into this. Come back to you soon.
Great! Thank you so much because we're really stuck on this.
Hello Lise,
unfortunately, the expert is not available before Moday, but here are some suggestions that you miight try before:
I suspect a pip (python package installer) issue
According to the readme, cmsisdsp package installation is done in the last step with the following command
> pip install -e "Path To The Folder Containing setup.py"
Obviously user is giving a complicated path with space, dashes etc..
" /Users/liselynen/OneDrive - Capetech BVBA/190521 Python Scripts/cmsdsp-tests/PythonWrapper/setup.py
Maybe you can suggest to try either :
- double backslashes
-e c:\\path_to_setup.py
- forward slashes
c:/path_tosetup.py
- file URL (-e file:///c:/path_to_setup.py)
Hi Christopher, For me this worked but then I got stuck on the new error as described above (which refers to line 22 in the config.py script)
For my colleague in Windows this still doesn't work, I guess it's because she is working in the Anaconda prompt. Not sure if there is a way to install it via Conda? However I will definitely tell her your feedback and try these suggestions.
Looking forward to more support on Monday.
Lise
my other colleague made these comments:
"I would suggest they move it outside of OneDrive and avoid path containing spaces. But I think the issue is with OneDrive.
Also, as explained in the README, they should be in the folder containing the setup.py file and type:
python setup.py build_ext –inplace
From the error I may conclude they called setup from another folder. But not totally sure since Python may internally recompute the absolute path."
Hi Christopher,
Thanks for your help. It worked for my colleague as she installed Microsoft Visual Studio 2019 (workload 'desktop development with C++').
However I keep getting this error message: '
ValueError: list.remove(x): x not in list'
Should I also install Visual Studio ? Or is there another reason? Does it has to do with my OS?
I tried both
pip3 install -e /Users/liselynen/Documents/cmsdsp-tests/PythonWrapper
and
Both in the correct "PythonWrapper" folder and I keep getting this error message. Does the python code take into account different operating systems? Would it be possible to discuss this topic in private with one of the application engineers? I would really like to have this solved.
I was able to find a colleague with a Mac. He reported the following:
"I did a quick test and the installation succeeded. I am using Python 3.7.0 on macOS Catalina 10.15. Couple of notes about macOS-specific changes to the README:
Hope this helps.
Thanks for the suggestion, however I already tried to install it like this but I keep getting the same error message.
To be clear I first still need to run this line "
> python setup.py build_ext --inplace" , right?And afterwards I create the virtual env and do the pip install... ?