Upcoming maintenance
Dear Customers and Partners.
This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.
This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.
We apologize for any inconvenience.
How to run example project in the spresense sdk using vscode IDE?
-
Hi experts,
Can somebody help me to run an example code (preferebly 'audio_pcm_capture') in the spresense sdk using vscode IDE. I am getting into many problems while using this example.
Sharing steps to follow to create the project with these example would be greatfull, or any vscode project with this example also fine.
I am able to run simple code using the below help, but anot able to add example code in the sdk.
https://developer.sony.com/develop/spresense/docs/sdk_set_up_ide_en.html#_creating_an_application_projectRegards,
Jithul -
Hi @jithul
Please follow these steps:
- https://developer.sony.com/develop/spresense/docs/sdk_set_up_ide_en.html#_creating_an_application_project
- https://developer.sony.com/develop/spresense/docs/sdk_set_up_ide_en.html#_create_and_run_application_myapps
- Copy the
include
folder fromexamples/audio_pcm_capture
tomyapps
. - Copy the
audio_pcm_capture_main.cxx
file fromexamples/audio_pcm_capture
tomyapps
. - Change
extern "C" int main(int argc, FAR char *argv[])
to
extern "C" int myapps_main(int argc, FAR char *argv[])
in
audio_pcm_capture_main.cxx
6. Removemyapps_main.c
frommyapps
.
7. Modify theMakefile
as follows:-include $(TOPDIR)/Make.defs include $(SDKDIR)/Make.defs # Audio application info PROGNAME = myapps PRIORITY = 100 STACKSIZE = 2048 # Audio Example MAINSRC = audio_pcm_capture_main.cxx # Audio Example paths AUDIODIR = $(SDKDIR)$(DELIM)modules$(DELIM)audio # Audio Example flags CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(AUDIODIR)"} CXXFLAGS += -D_POSIX CXXFLAGS += -DUSE_MEMMGR_FENCE CXXFLAGS += -DATTENTION_USE_FILENAME_LINE include $(APPDIR)/Application.mk
- Go to SDK config in VSC, then New -> Examples -> audio_pcm_capture -> OK and save.
- Disable EXAMPLES AUDIO_PCM_CAPTURE under Application Configuration -> Spresense SDK -> Example, since you have your own example.
- Build and flash.
I hope it will help.
Best Regards,
Kamil Tomaszewski -
@kamiltomaszewski You are the hero, I got the audio capturing side working! Thanks a lot.
-
Hi @kamiltomaszewski, I followed the exact steps but my build get stopped with the following error:
*** No rule to make target 'audio_pcm_capture_main.cxx', needed by 'audio_pcm_capture_main.cxx.home.ssup.my_prjct.o'. Stop.
-
Hi @matben-0
It worked on the older SDK. Now for this to work you need to modify the first line in the Makefile from step 7. Please change
-include $(TOPDIR)/Make.defs
toinclude $(APPDIR)/Make.defs
.Best Regards,
Kamil Tomaszewski -
Hi @kamiltomaszewski,
Thank you so much, this solution worked for me. -
@kamiltomaszewski said in How to run example project in the spresense sdk using vscode IDE?:
Hi @matben-0
It worked on the older SDK. Now for this to work you need to modify the first line in the Makefile from step 7. Please change
-include $(TOPDIR)/Make.defs
toinclude $(APPDIR)/Make.defs
.Best Regards,
Kamil TomaszewskiHi @KamilTomaszewski
What changes in procedure should I follow up if I've to work withaudio_player
which haveASMP
worker
files. -
Hi @matben-0 ,
If you take the worker's files from the new SDK, you don't have to change anything.
Best Regards,
Kamil Tomaszewski -
Thank you @KamilTomaszewski, your suggestion worked & it helped me a lot.