Code Monkey home page Code Monkey logo

spresense-arduino-compatible's Introduction

Welcome to Spresense libs for Arduino compatible project

Clone this repository.

$ git clone [email protected]:sonydevworld/spresense-arduino-compatible.git

Directory structure

spresense-arduino-compatible
|-- Arduino15
|   |-- packages/SPRESENSE           - Spresense packages
|   |   |-- hardware
|   |   |   `--spresense             - Spresense reference board codes
|   |   |      `-- 1.0.0
|   |   |          |-- cores
|   |   |          |-- libraries
|   |   |          `-- variants
|   |   `-- tools                    - Necessary tool chain and prebuilt binaries
|   |       |-- spresense-tools      - Spresense tools
|   |       |   `-- 1.0.0
|   |       |-- spresense-sdk        - Spresense SDK prebuilt binaries
|   |       |   `-- 1.0.0
|   |       `-- gcc-arm-none-eabi    - GCC compiler
|   |           `-- 5.4.1
|   `-- package_spresense_index.json - Arduino IDE configuration json file
`-- tools                            - Import/Export tools

Getting started

How to prepare Arduino environment

Pull or Import GCC and Prebuilt SDK

./tools/prepare_arduino.sh [OPTIONS...]

Options

For using local archive

Option Argument Note
-g path/to/GCC-archive-path GCC archive path
-s path/to/SDK-archive-path Prebuilt SDK archive path

For using local source code

Option Argument Note
-S path/to/spresense-sdk-path Local Spresense SDK build root path
-v Board_variant Target board variant (default:spresense)
-c spresense or spresense_sub Target SDK configuration (default: spresense)
-d disable or enable Target debug configuration (default: disable)
-M "SDK" Manual configuration by menuconfig
-G "SDK" Manual configuration by gconfig
-Q "SDK" Manual configuration by qconfig
-i - Do not change SDK configuration

Other option

Option Argument Note
-H Windows or Linux64 or Mac Arduino IDE Host OS
-p - No network access option
-h - Show help

Example

Export Spresense SDK prebuilt binary for MainCore/Debug:Disabled from local repository.

$ ./tools/prepare_arduino.sh -S path/to/spresense -p

Export Spresense SDK prebuilt binary for MainCore/Debug:Enabled from local repository.

$ ./tools/prepare_arduino.sh -S path/to/spresense -d enable -p

Export Spresense SDK prebuilt binary for SubCore/Debug:Disabled from local repository.

$ ./tools/prepare_arduino.sh -S path/to/spresense -c spresense_sub -d disable -p

Export Spresense SDK prebuilt binary for SubCore/Debug:Enabled from local repository.

$ ./tools/prepare_arduino.sh -S path/to/spresense -c spresense_sub -d enable -p

Export Spresense SDK prebuilt binary for MainCore/Debug:Disabled from local repository with configuration change.

$ ./tools/prepare_arduino.sh -S path/to/spresense -M SDK -p

Creating Arduino boards manager local install package

To create a Arduino boards manager files for manual installation simply type:

$ make

This command will generate the following files:

out/package_spresense_local_index.json
out/staging/spresense-v*.*.*_local.tar.gz
out/staging/spresense-tools-v*.*.*_local.tar.gz
out/staging/spresense-sdk-v*.*.*_local.tar.gz

Manual install

  1. Copy out/staging into <Arduino15> directory.
  2. Set package_spresense_local_index.json URL into Additional Boards Manager URLs in Arduino IDE.
  3. Install local spresense board package by Boards Manager in Arduino IDE as same as official package.

<Arduino15>:

  • Windows: %userprofile%\AppData\Local\Arduino15
  • macOS: ~/Library/Arduino15
  • Ubuntu: ~/.arduino15

package_spresense_local_index.json URL:

file://path/to/out/package_spresense_local_index.json

spresense-arduino-compatible's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spresense-arduino-compatible's Issues

Flash and RAM usage computation

recipe.size.regex=^(\.text|\.data|\.init_section|\.ARM.exidx|\.bss)\s+([0-9]+).*
recipe.size.regex.data=^(\.text|\.data|\.init_section|\.ARM.exidx|\.bss)\s+([0-9]+).*

How can these two be equal? Flash and RAM usage should be calculated from different ELF sections, no?

This causes the Arduino IDE to always show Flash usage and RAM usage as the exact same number.

When I build the ELF file, I get the sections

.pio\build\spresense\firmware.elf  :

section             size        addr
.text             135804   218103808
.init_section          4   218239612
.ARM.exidx             8   218239616
.data               2244   218239624
.bss               11344   218242048
.comment             223           0
.ARM.attributes       50           0
.debug_abbrev      10853           0
.debug_info        60647           0
.debug_line        24462           0
.debug_aranges      1680           0
.debug_loc         25913           0
.debug_ranges       3536           0
.debug_str         13454           0
.debug_frame        5692           0
Total             295914

number_recognition.ino is not working

Example number_recognition.ino is not producing intended results

image

Results are not being displayed and it stays in the same state after feeding the processed test image into NN
I have used a mnist-classifer from nnabla misnt-collection example.

adding the relevant model file network.nnb file to this example repo would be helpful for the beginers

help needed with debugging. thanks in advance.

Support for std libraries and c++14 / c++17

Ubuntu 20.04 x64
Arduino IDE 1.8.13

Whilst attempting to compile the Arduino TensorFlowLite HelloWorld example, several errors are being observed.

There appear to be a number of std library functions which are currently not supported. The release of gcc-arm-none-eabi/5.4.1 is nearly 5 yrs old now, and the platform.txt specifies -std=gnu++11 which is also an ageing standard now. May I get advice how to modernise the toolchain to support these features?

A simple example of these failures can be seen by attempting to compile a simple sketch as below.

#include <cstdio>

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Which derives the errors shown:

In file included from /home/xxxx/Arduino/SpresenseFault/SpresenseFault.ino:1:0:
/home/xxxx/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/5.4.1/linux/arm-none-eabi/include/c++/5.4.1/cstdio:120:11: error: '::getc' has not been declared
   using ::getc;
           ^
/home/xxxx/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/5.4.1/linux/arm-none-eabi/include/c++/5.4.1/cstdio:121:11: error: '::getchar' has not been declared
   using ::getchar;
           ^
/home/xxxx/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/5.4.1/linux/arm-none-eabi/include/c++/5.4.1/cstdio:128:11: error: '::putc' has not been declared
   using ::putc;
           ^
/home/xxxx/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/5.4.1/linux/arm-none-eabi/include/c++/5.4.1/cstdio:129:11: error: '::putchar' has not been declared
   using ::putchar;
           ^
/home/xxxx/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/5.4.1/linux/arm-none-eabi/include/c++/5.4.1/cstdio:133:11: error: '::rewind' has not been declared
   using ::rewind;
           ^
/home/xxxx/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/5.4.1/linux/arm-none-eabi/include/c++/5.4.1/cstdio:139:11: error: '::tmpfile' has not been declared
   using ::tmpfile;
           ^
exit status 1
Error compiling for board Spresense.

Unable to install in Arduino IDE 2

OS: Windows 10 x64
Arduino IDE: 2.3.2
Used package URL:

https://raw.githubusercontent.com/sonydevworld/spresense-arduino-compatible/master/Arduino15/package_spresense_index.json

Error:

Downloading packages
SPRESENSE:[email protected]
SPRESENSE:[email protected]
SPRESENSE:[email protected]
SPRESENSE:[email protected]
Installing SPRESENSE:[email protected]
Failed to install platform: 'SPRESENSE:spresense:1.0.0'.
Error: 13 INTERNAL: Cannot install tool SPRESENSE:[email protected]: testing local archive integrity: testing archive size: fetched archive size differs from size specified in index: 26498276 != 6257789

So, the lines

"url": "https://github.com/sonydevworld/spresense-arduino-compatible/releases/download/v3.2.0/spresense-sdk-v3.2.0.tar.gz",
"host": "i686-mingw32",
"archiveFileName": "spresense-sdk-v3.2.0.tar.gz",
"size": "6257789"

seems wrong is indeed 26498276 Bytes big when downloading from that URL.

It installs just fine in the old Arduino IDE 1.8.19, but Arduino IDE 2 fails because of the wrong metadata in the package index.

Furthermore, the entries seem to be missing a "checksum": "SHA-256:..." entry.

Wrong type of GNSS azimuth

The type of azimuth defined in GNSS.h is incorrect.
Original: unsigned char azimuth;
Corrected: signed short azimuth;

Related #34

MP3 Audio too fast

Description of the issue: Hi, opened this example for mp3 playing and everything works except for one thing: the audio seems to be playing too fast. When I upload the file, I get the message below in the serial monitor and the audio plays perfectly except it is like a sped up version of it. Changing the values for usleep does not change things, nor does adding delay.

initialization Audio Library
Open! 0x00000001
Play!
loop!!
Main player File End!
Main player error code: 5

How to reproduce: Open example, change setVolume from -160 to 120. Upload and that's all

Describe your hardware setup: Spresense main board on top of LTE expansion board. Speaker soldered to aux cord and plugged into headphone jack on expansion board. MP3s loaded from microSD. MP3s sounded normal speed when recorded.

Software version used: Arduino software 1.8.15. All libraries installed fresh today (6/20/22)

SUBCORE not defined for Signal Processing examples

I am trying to use the Peak and Sound Detector Examples. The Main Core code compiles correctly. When I try to compile the SubCore examples I get a similar error:

/private/var/folders/7k/qtt4sc3j2sq1rx4yc452d38r0000gn/T/.arduinoIDE-unsaved2022513-22396-161duwj.eqik/SubFFT/SubFFT.ino: In function 'void setup()':
/private/var/folders/7k/qtt4sc3j2sq1rx4yc452d38r0000gn/T/.arduinoIDE-unsaved2022513-22396-161duwj.eqik/SubFFT/SubFFT.ino:76:22: error: no matching function for call to 'MPClass::begin()'
   76 |   int ret = MP.begin();
      |                      ^
In file included from /private/var/folders/7k/qtt4sc3j2sq1rx4yc452d38r0000gn/T/.arduinoIDE-unsaved2022513-22396-161duwj.eqik/SubFFT/SubFFT.ino:20:
/Users/luke/Library/Arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/libraries/MP/src/MP.h:127:7: note: candidate: 'int MPClass::begin(int)'
  127 |   int begin(int subid);
      |       ^~~~~
/Users/luke/Library/Arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/libraries/MP/src/MP.h:127:7: note:   candidate expects 1 argument, 0 provided
/private/var/folders/7k/qtt4sc3j2sq1rx4yc452d38r0000gn/T/.arduinoIDE-unsaved2022513-22396-161duwj.eqik/SubFFT/SubFFT.ino: In function 'void loop()':
/private/var/folders/7k/qtt4sc3j2sq1rx4yc452d38r0000gn/T/.arduinoIDE-unsaved2022513-22396-161duwj.eqik/SubFFT/SubFFT.ino:100:33: error: no matching function for call to 'MPClass::Recv(int8_t*, Request**)'
  100 |   ret = MP.Recv(&rcvid, &request);
      |                                 ^
In file included from /private/var/folders/7k/qtt4sc3j2sq1rx4yc452d38r0000gn/T/.arduinoIDE-unsaved2022513-22396-161duwj.eqik/SubFFT/SubFFT.ino:20:
/Users/luke/Library/Arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/libraries/MP/src/MP.h:176:7: note: candidate: 'int MPClass::Recv(int8_t*, uint32_t*, int)'
  176 |   int Recv(int8_t *msgid, uint32_t *msgdata, int subid);
      |       ^~~~
/Users/luke/Library/Arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/libraries/MP/src/MP.h:176:7: note:   candidate expects 3 arguments, 2 provided
/Users/luke/Library/Arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/libraries/MP/src/MP.h:210:7: note: candidate: 'int MPClass::Recv(int8_t*, void*, int)'
  210 |   int Recv(int8_t *msgid, void *msgaddr, int subid);
      |       ^~~~
/Users/luke/Library/Arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/libraries/MP/src/MP.h:210:7: note:   candidate expects 3 arguments, 2 provided

Compilation error: exit status 1

It looks like SUBCORE may not being defined correctly somewhere based on this lines from the MP Library:

#ifdef SUBCORE
int begin();
#else
int begin(int subid);
#endif

I am using an M1 MacBook Pro running Arduino IDE Version: 2.0.0-rc7

Cannot run Blink example

There is no blinking of LED_BUILTIN with the most basic Blink example. (I know that there is a different example to blink the four LED0 ... LED3 on-board LEDs) I replaced LED_BUILTIN with LED0 but experienced the same output shown below:
`
/home/chowkidar/Downloads/arduino-1.8.19/arduino-builder -compile -logger=machine -hardware /home/chowkidar/Downloads/arduino-1.8.19/hardware -hardware /home/reza/.arduino15/packages -tools /home/chowkidar/Downloads/arduino-1.8.19/tools-builder -tools /home/chowkidar/Downloads/arduino-1.8.19/hardware/tools/avr -tools /home/reza/.arduino15/packages -built-in-libraries /home/chowkidar/Downloads/arduino-1.8.19/libraries -libraries /home/reza/Arduino/libraries -fqbn=SPRESENSE:spresense:spresense:Core=Main,Memory=768,Debug=Disabled,UploadSpeed=115200 -vid-pid=10C4_EA60 -ide-version=10819 -build-path /tmp/arduino_build_408149 -warnings=none -build-cache /tmp/arduino_cache_420848 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.gcc-arm-none-eabi.path=/home/reza/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/9.2.1 -prefs=runtime.tools.gcc-arm-none-eabi-9.2.1.path=/home/reza/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/9.2.1 -prefs=runtime.tools.spresense-tools.path=/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-tools/2.5.1 -prefs=runtime.tools.spresense-tools-2.5.1.path=/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-tools/2.5.1 -prefs=runtime.tools.spresense-sdk.path=/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1 -prefs=runtime.tools.spresense-sdk-2.5.1.path=/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1 -verbose /home/reza/Arduino/Spresence/Blink/Blink.ino
Using board 'spresense' from platform in folder: /home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1
Using core 'spresense' from platform in folder: /home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1
Detecting libraries used...
/home/reza/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/9.2.1/linux/bin/arm-none-eabi-g++ -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/include/libcxx -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/arch -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/arch/chip -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/modules/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/apps/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/system/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/externals/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/externals/include/cmsis -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/variants/spresense -DCONFIG_WCHAR_BUILTIN -DCONFIG_HAVE_DOUBLE -D__NuttX__ -c -w -std=gnu++11 -c -fno-builtin -mabi=aapcs -Wall -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -pipe -ffunction-sections -fno-exceptions -fno-rtti -ggdb -gdwarf-3 -ffunction-sections -fdata-sections -fpermissive -w -x c++ -E -CC -DF_CPU=156000000L -DARDUINO=10819 -DARDUINO_spresense_ast -DARDUINO_ARCH_SPRESENSE "-DARDUINO_BOARD="spresense_ast"" -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/cores/spresense -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/variants/spresense /tmp/arduino_build_408149/sketch/Blink.ino.cpp -o /dev/null
Generating function prototypes...
/home/reza/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/9.2.1/linux/bin/arm-none-eabi-g++ -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/include/libcxx -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/arch -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/arch/chip -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/modules/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/apps/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/system/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/externals/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/externals/include/cmsis -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/variants/spresense -DCONFIG_WCHAR_BUILTIN -DCONFIG_HAVE_DOUBLE -D__NuttX__ -c -w -std=gnu++11 -c -fno-builtin -mabi=aapcs -Wall -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -pipe -ffunction-sections -fno-exceptions -fno-rtti -ggdb -gdwarf-3 -ffunction-sections -fdata-sections -fpermissive -w -x c++ -E -CC -DF_CPU=156000000L -DARDUINO=10819 -DARDUINO_spresense_ast -DARDUINO_ARCH_SPRESENSE "-DARDUINO_BOARD="spresense_ast"" -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/cores/spresense -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/variants/spresense /tmp/arduino_build_408149/sketch/Blink.ino.cpp -o /tmp/arduino_build_408149/preproc/ctags_target_for_gcc_minus_e.cpp
/home/reza/.arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_408149/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/home/reza/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/9.2.1/linux/bin/arm-none-eabi-g++ -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/include/libcxx -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/arch -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/arch/chip -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/modules/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/apps/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/system/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/externals/include -I/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/sdk/externals/include/cmsis -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/variants/spresense -DCONFIG_WCHAR_BUILTIN -DCONFIG_HAVE_DOUBLE -D__NuttX__ -c -w -MMD -std=gnu++11 -c -fno-builtin -mabi=aapcs -Wall -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -pipe -ffunction-sections -fno-exceptions -fno-rtti -ggdb -gdwarf-3 -ffunction-sections -fdata-sections -fpermissive -DF_CPU=156000000L -DARDUINO=10819 -DARDUINO_spresense_ast -DARDUINO_ARCH_SPRESENSE "-DARDUINO_BOARD="spresense_ast"" -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/cores/spresense -I/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/variants/spresense /tmp/arduino_build_408149/sketch/Blink.ino.cpp -o /tmp/arduino_build_408149/sketch/Blink.ino.cpp.o
Compiling libraries...
Compiling core...
Using precompiled core: /tmp/arduino_cache_420848/core/core_16aa5f51ffb5d1a29ed27267b40710a1.a
Linking everything together...
/home/reza/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/9.2.1/linux/bin/arm-none-eabi-g++ -ggdb -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Xlinker --entry=__start -nodefaultlibs -nostartfiles -Wl,--defsym,__reserved_ramsize=1572864-786432 -T/home/reza/.arduino15/packages/SPRESENSE/hardware/spresense/2.5.1/variants/spresense/ramconfig.ld -Wl,--gc-sections -Xlinker -Map=/tmp/arduino_build_408149/output.map -o /tmp/arduino_build_408149/Blink.ino.elf -Wl,--start-group /tmp/arduino_build_408149/sketch/Blink.ino.cpp.o -u spresense_main /tmp/arduino_build_408149/../arduino_cache_420848/core/core_16aa5f51ffb5d1a29ed27267b40710a1.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libapps.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libarch.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libarm_cortexM4lf_math.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libaudio.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libbinfmt.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libboard.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libboards.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libc.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libcmsis_nn.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libdrivers.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libfs.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libmm.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libnet.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libnnablart.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libsched.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libsslutils.a /home/reza/.arduino15/packages/SPRESENSE/tools/spresense-sdk/2.5.1/spresense/release/nuttx/libs/libxx.a -lgcc -lm -lsupc++_nano -Wl,--end-group -L/tmp/arduino_build_408149
/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-tools/2.5.1/mkspk/linux/mkspk -c 2 /tmp/arduino_build_408149/Blink.ino.elf nuttx /tmp/arduino_build_408149/Blink.ino.spk
File /tmp/arduino_build_408149/Blink.ino.spk is successfully created.
/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-tools/2.5.1/getspkinfo/linux/getspkinfo /tmp/arduino_build_408149/Blink.ino.spk
####################################

Used memory size: 768 [KByte]

####################################
/home/reza/.arduino15/packages/SPRESENSE/tools/gcc-arm-none-eabi/9.2.1/linux/bin/arm-none-eabi-size -A /tmp/arduino_build_408149/Blink.ino.elf
Sketch uses 148288 bytes (18%) of program storage space. Maximum is 786432 bytes.
Global variables use 148288 bytes (18%) of dynamic memory, leaving 638144 bytes for local variables. Maximum is 786432 bytes.
/home/reza/.arduino15/packages/SPRESENSE/tools/spresense-tools/2.5.1/flash_writer/linux/flash_writer -s -c /dev/ttyUSB0 -d -n /tmp/arduino_build_408149/Blink.ino.spk

Install files ...
install
Install /tmp/arduino_build_408149/Blink.ino.spk
|0%-----------------------------50%------------------------------100%|
######################################################################

137040 bytes loaded.
Package validation is OK.
Saving package to "nuttx"
sync
Restarting the board ...
reboot
`
I'm running IDE 1.8.19 under Ubuntu 22.04 with the following default settings:

  • Board: Spresense
  • Debug: Disabled
  • Core: MainCore
  • Memory: 768 KB (Default)
  • UploadSpeed: 115200
  • Port: /dev/ttyUSB0 (Spresense)
  • Programmer: Spresense Firmware Updater

There is no LED (except for the blue PWR LED) that is ON either in steady or blink mode.

Is there any other basic test that I can perform to get started on working with the Spresense board under Arduino IDE? Thanks.

Kind regards.

P.S.
The standard Blink example that I'm trying to run on the Spresense board is:

// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED0, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED0, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED0, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

flash_writer path is not properly templated when using arduino-cli on Linux

Issue

When uploading Spresense Arduino projects from a machine running Ubuntu 20.04 with arduino-cli, I get the following error:

guberti@microtvm:~/blink$ arduino-cli upload --fqbn SPRESENSE:spresense:spresense --port /dev/ttyUSB0
Error during Upload: uploading error: cannot execute upload tool: fork/exec /home/vagrant/.arduino15/pack
ages/SPRESENSE/tools/spresense-tools/2.2.1/flash_writer/{runtime.os}/flash_writer: no such file or direct
ory

Workaround

This path (tools.spresense-tools.cmd.path.linux) is defined in platform.txt as seen below:

# ------------------------------
tools.spresense-tools.path={runtime.tools.spresense-tools.path}
tools.spresense-tools.cmd.path={path}/flash_writer/{runtime.os}/flash_writer
tools.spresense-tools.cmd.path.windows={path}/flash_writer/{runtime.os}/flash_writer.exe
tools.spresense-tools.cmd.path.linux={path}/flash_writer/{runtime.os}/flash_writer

This issue can be fixed by changing the path to:

tools.spresense-tools.cmd.path.linux={path}/flash_writer/linux/flash_writer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.