Questions about spresense-aruino-compatible
I am trying to use the spresense as an audio recorder ant I am faing the same error message than detailed in this topic : https://forum.developer.sony.com/topic/98/recorder_wav-multiple-recordings. The error message is Attention: module attention id/code (objects/media_recorder/audio_recorder_sink.cpp L84).
I tried the solution detailed in the last message of this previous topic which is to build Spresense Arduino package again. However I am a bit lost. I downloaded the content of https://github.com/sonydevworld/spresense-arduino-compatible and I understand I have to use the scripts of the ./tools folder but their purpose are not clear to me.
I launched the prepare_arduino.sh file with the following option :
tools/prepare_arduino.sh -S /home/ahoudeau/spresense/ -H Windows
Then it goes through different steps until Export to Arduino line where it stops because of lack the “sdk-export.zip” file but I have no idea of where the zip file could come from.
Install gcc-arm-none-eabi... Install SDK from Spresense build... Export SDK from build. SDK_VERSION=1.0.0 VARIANT_NAME=spresense Clean SDK objects... Configure SDK components... Kernel : release SDK : board/spresense device/adc device/camera device/charger device/pwm device/sdcard feature/asmp feature/audio_player feature/audio_recorder feature/audio_recognizer feature/dnnrt feature/gnss feature/imageproc feature/ststep_counter -- +DNN_RT_MP -NSH_BUILTIN_APPS Build kernel... Export to Arduino... cp: impossible d'évaluer 'sdk-export.zip': No such file or directory unzip: cannot find or open sdk-export.zip, sdk-export.zip.zip or sdk-export.zip.ZIP. rm: impossible de supprimer 'sdk-export.zip': No such file or directory mv: impossible d'évaluer '/tmp/tmp.tPAcwT86QD/sdk-export/nuttx': No such file or directory /home/ahoudeau/spresense/sdk/tools/sdk_export.sh: ligne 63 : cd: /tmp/tmp.tPAcwT86QD/sdk/1.0.0/spresense/release: No such file or directory mv: impossible d'évaluer '/tmp/tmp.tPAcwT86QD/sdk-export/sdk/modules/include/': No such file or directory mv: impossible d'évaluer '/tmp/tmp.tPAcwT86QD/sdk-export/sdk/bsp/include/sdk': No such file or directory mv: impossible d'évaluer '/tmp/tmp.tPAcwT86QD/sdk-export/sdk/libs/': No such file or directory mv: impossible d'évaluer './libs/libsdk.a': No such file or directory cp: impossible d'évaluer 'build': No such file or directory /home/ahoudeau/spresense/sdk/tools/sdk_export.sh: ligne 85: zip : commande introuvable mv: impossible d'évaluer 'sdk-export.zip': No such file or directory SDK exported to /home/ahoudeau/spresense/sdk-export.zip Please input a ZIP file as SDK package
Can you please explain me how does the prepare_arduino.sh works and what does it take as input and what it is supposed to output ?
Hello @ahoudeau ,
Arduino15folder that you can use to manually install Spresense Arduino Library. You can find more about manual installation here: https://developer.sony.com/develop/spresense/docs/arduino_set_up_en.html#_manual_installation
sdk-export.zipcomes from the folder in which the Spresense SDK is located.
If your Spresense SDK is here
/home/ahoudeau/spresensethen the zip file can be found here:
sdk-export.zipis an exported Spresense SDK that is created after running the command
Check if the
sdk-export.zipexists in your Spresense SDK.
Try running the command
make exportand see if it will export the Spresense SDK successfully.
Try these 2 steps and write what you got. What OS are you using?
I am using Windows10 and I use the bash terminal of VScode for the commands. I checked the presence of
sdk-export.zipand tried to run
spresense/sdkbut I end with the same error.
Here is the end of the terminal output :
SPK: nuttx.spk make : on entre dans le répertoire « /home/ahoudeau/spresense/nuttx/tools » make : on quitte le répertoire « /home/ahoudeau/spresense/nuttx/tools » Merging archive: libsched Merging archive: libdrivers Merging archive: libconfigs Merging archive: libc Merging archive: libmm Merging archive: libarch Merging archive: libcxx Merging archive: libnet Merging archive: libfs Merging archive: libbinfmt Merging archive: libgraphics Merging archive: libnx Merging archive: libcxx Merging archive: libbsp Merging archive: libextdrivers Merging archive: libsdkaudio Merging archive: libsystem Merging archive: libexamples Merging archive: libboard cp: impossible d'évaluer 'sdk-export.zip': No such file or directory
I found a solution. The problem was that there is no
zipcommand in the default installation of
MSYS2. You must install an additional package.
To do this run this command from
$ pacman -S zip
After installing this package you should no longer have a problem with the
Thank you ! it eventually worked fine after the
pacman -S zipcommand. However the generated files seem to be for version 1.0.0 while the version I get through Arduino IDE is 1.4.2. So if I try to use the generated
Arduino15/package/SPRESENSE/toolsto build code examples I have errors.
My original issue was the line 84 of
audio_recorder_sink.cppand rebuild the Arduino library. Is it possible to rebuild the 1.4.2 version with the modified
The source code that was used by the
prepare_arduino.shscript is version 1.4.2. You can check the git log and see the tag.
Version 1.0.0 here does not apply to the Spresense Arduino Library version but only to the version of your custom Arduino15.
You can change this to 1.4.2. Change all occurrences of 1.0.0 to 1.4.2 in the
It will not change anything in the source code. Everything will be the same. Only the Arduino IDE will see that this is a different package.
You shouldn't have any problems. Maybe try:
In the Arduino IDE go to Tools-> Board-> Board Manager... and remove Spresense.
package_spresense_index.jsonand other files that have spresense in their name.
In the Arduino IDE go to Tools-> Board and select Spresense.
Do you use automatic updates in the Arduino IDE?