Sony's Developer World forum

    • Home
    • Forum guidelines

    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?

    Spresense
    3
    9
    1125
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JITHUL last edited by

      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_project

      Regards,
      Jithul

      K 1 Reply Last reply Reply Quote
      • K
        KamilTomaszewski DeveloperWorld @JITHUL last edited by

        Hi @jithul

        Please follow these steps:

        1. https://developer.sony.com/develop/spresense/docs/sdk_set_up_ide_en.html#_creating_an_application_project
        2. https://developer.sony.com/develop/spresense/docs/sdk_set_up_ide_en.html#_create_and_run_application_myapps
        3. Copy the include folder from examples/audio_pcm_capture to myapps.
        4. Copy the audio_pcm_capture_main.cxx file from examples/audio_pcm_capture to myapps.
        5. 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. Remove myapps_main.c from myapps.
        7. Modify the Makefile 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
        
        1. Go to SDK config in VSC, then New -> Examples -> audio_pcm_capture -> OK and save.
          Screenshot from 2021-08-24 22-40-37.png
        2. Disable EXAMPLES AUDIO_PCM_CAPTURE under Application Configuration -> Spresense SDK -> Example, since you have your own example.
          Screenshot from 2021-08-24 22-43-36.png
        3. Build and flash.

        I hope it will help.

        Best Regards,
        Kamil Tomaszewski

        J M 2 Replies Last reply Reply Quote
        • J
          JITHUL @KamilTomaszewski last edited by

          @kamiltomaszewski You are the hero, I got the audio capturing side working! Thanks a lot.

          1 Reply Last reply Reply Quote
          • M
            MatBen 0 @KamilTomaszewski last edited by

            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.
            
            K 1 Reply Last reply Reply Quote
            • K
              KamilTomaszewski DeveloperWorld @MatBen 0 last edited by

              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 to include $(APPDIR)/Make.defs.

              Best Regards,
              Kamil Tomaszewski

              M 2 Replies Last reply Reply Quote
              • M
                MatBen 0 @KamilTomaszewski last edited by

                Hi @kamiltomaszewski,
                Thank you so much, this solution worked for me.

                1 Reply Last reply Reply Quote
                • M
                  MatBen 0 @KamilTomaszewski last edited by

                  @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 to include $(APPDIR)/Make.defs.

                  Best Regards,
                  Kamil Tomaszewski

                  Hi @KamilTomaszewski
                  What changes in procedure should I follow up if I've to work with audio_player which have ASMP worker files.

                  K 1 Reply Last reply Reply Quote
                  • K
                    KamilTomaszewski DeveloperWorld @MatBen 0 last edited by

                    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

                    M 1 Reply Last reply Reply Quote
                    • M
                      MatBen 0 @KamilTomaszewski last edited by

                      Thank you @KamilTomaszewski, your suggestion worked & it helped me a lot.

                      1 Reply Last reply Reply Quote
                      • First post
                        Last post
                      Developer World
                      Copyright © 2021 Sony Group Corporation. All rights reserved.
                      • Contact us
                      • Legal