Hi all!
For a music effects project, I'm looking into using the VS1053B. I'm especially interested in using the hvcc framework for running C code that is designed with Pure Data. I have done some initial testing and am running into a somewhat weird bunch of errors, namely that several Standard C libraries cannot be found:
Could not find include file <stdint.h>
Could not find include file <stdbool.h>
When I copy the exact same include statements into a standard VSIDE project, there is no error. Any pointers appreciated!
Standard C libraries not found
Re: Standard C libraries not found
Meanwhile, I've come to understand that VSIDE only has a limited version of the complete Standard C library installed - I wonder to which degree it would be feasible to extend this. For now I will focus on getting back into programming directly in C.
Re: Standard C libraries not found
Hi!
VSDSP supports the original Ansi standard C. Not C99, C11 or other extensions, just plain and simple original standard Ansi C as it's defined in the Ansi C edition of Kernighan & Ritchie's book "C Programming Language" in 1990. All standard libraries are included as they were defined in ISO/IEC 9899:1990 standard.
One thing to note is that the core does not support 8-bit data types. sizeof(char) == sizeof(int) == sizeof(u_int16) == 1. VSDSP has 16-bit bytes, e.g. CHAR_BIT = 16. All pointers have 16 bits. That's all fine and well according to the standard, but a lot of C code out there expects 8-bit char types and/or 32-bit pointers, and these may work differently than you might expect in the VSDSP.
If the code is clean and it respects definitions in <limits.h> then all should be well and compile normally.
I am not familiar with the library that you mention, do you feel that is it something that we should take a look at?
-Panu
VSDSP supports the original Ansi standard C. Not C99, C11 or other extensions, just plain and simple original standard Ansi C as it's defined in the Ansi C edition of Kernighan & Ritchie's book "C Programming Language" in 1990. All standard libraries are included as they were defined in ISO/IEC 9899:1990 standard.
One thing to note is that the core does not support 8-bit data types. sizeof(char) == sizeof(int) == sizeof(u_int16) == 1. VSDSP has 16-bit bytes, e.g. CHAR_BIT = 16. All pointers have 16 bits. That's all fine and well according to the standard, but a lot of C code out there expects 8-bit char types and/or 32-bit pointers, and these may work differently than you might expect in the VSDSP.
If the code is clean and it respects definitions in <limits.h> then all should be well and compile normally.
I am not familiar with the library that you mention, do you feel that is it something that we should take a look at?
-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy
Panu-Kristian Poiksalo, VLSI Solution Oy
Re: Standard C libraries not found
Ah, I see. Yes it looks like Heavy (hvcc) is dependent on these newer extensions.
If you think it would be at all feasible to implement Heavy on your hardware, then yes, I think it would certainly be worth taking a look at. Although it is currently an abandoned project (one of the main developers now works for Apple if I understand correctly), it is quite mature and enables running DSP applications that were designed in Pure Data (albeit with a relatively limited set of objects) on C/C++ platforms.
More info about it here: https://github.com/enzienaudio/hvcc
For those who don't know about Pure Data: it's essentially the more academic/open-source brother to MaxMSP. It enables a designer to create DSP systems by visually linking together named boxes - this makes it quite intuitive and fast compared to working directly in a language like C. Here's a typical Pure Data patch:

Last edited by audionerd on Thu 2019-12-12 0:47, edited 1 time in total.
Re: Standard C libraries not found
By the way, another way to run Pure Data on a platform that can run native code is libpd: http://libpd.cc/about/
It might be less suitable for a relatively minimal embedded situation like the VSDSP chips though, that's hard for me to tell.
In any case, I think it would be great to have the combination of high-level programming in Pure Data and the low-level elegance of VSDSP! I look forward to your thoughts on the feasibility of this.
It might be less suitable for a relatively minimal embedded situation like the VSDSP chips though, that's hard for me to tell.
In any case, I think it would be great to have the combination of high-level programming in Pure Data and the low-level elegance of VSDSP! I look forward to your thoughts on the feasibility of this.