arduino / nicla-sense-me-fw

Arduino Nicla Sense ME resources (libraries, bootloader, host pc utilities)
GNU Affero General Public License v3.0
47 stars 27 forks source link

[AE-60] Compiling `Blink_flasher_unisense` leads to `Error during build: exit status 1` #96

Open aliphys opened 1 year ago

aliphys commented 1 year ago

Describe the Problem

😔 The Blink_flasher_unisense.ino sketch does not compile, due to an exit status 1 error message.

To reproduce

Compile sketch to Nicla Sense ME Board

arduino-cli compile --fqbn arduino:mbed_nicla:nicla_sense 

Output:

/home/ali/gitRepos/nicla-sense-me-fw/bootloader/examples/Blink_flasher_unisense/Blink_flasher_unisense.ino: In function 'void loop()':
/home/ali/gitRepos/nicla-sense-me-fw/bootloader/examples/Blink_flasher_unisense/Blink_flasher_unisense.ino:53:5: error: 'system_reset' was not declared in this scope
     system_reset();
     ^~~~~~~~~~~~
/home/ali/gitRepos/nicla-sense-me-fw/bootloader/examples/Blink_flasher_unisense/Blink_flasher_unisense.ino:53:5: note: suggested alternative: '_system_r'
     system_reset();
     ^~~~~~~~~~~~
     _system_r

Used platform      Version Path                                                           
arduino:mbed_nicla 4.0.2   /home/ali/.arduino15/packages/arduino/hardware/mbed_nicla/4.0.2
Error during build: exit status 1

Expected behaviour

🙂 Sketch compiles

Arduino CLI version

0.32.3 - https://github.com/arduino/arduino-cli/commit/2661f5d9a68c028df370cd56b4ae7f2a4b651c4c

Operating system

Ubuntu 22.04.2 LTS

Additional Context

The system_reset() function is not identified by the compiler. https://github.com/arduino/nicla-sense-me-fw/blob/098b8e08492f76af82a918fa25e99ea377b4a16a/bootloader/examples/Blink_flasher_unisense/Blink_flasher_unisense.ino#L53 As far as I see, this is only defined for the SAMD core. https://github.com/arduino/ArduinoCore-samd/blob/84c09b3265e2a8b548a29b141f0c9281b1baf154/bootloaders/mzero/Bootloader_D21/src/ASF/sam0/drivers/system/system.h#L441 Compiling for a SAMD board leads to

$ arduino-cli compile --fqbn arduino:samd:nano_33_iot
/home/ali/gitRepos/nicla-sense-me-fw/bootloader/examples/Blink_flasher_unisense/Blink_flasher_unisense.ino:24:10: fatal error: SPIFBlockDevice.h: No such file or directory
 #include "SPIFBlockDevice.h"
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

Used platform Version Path                                                      
arduino:samd  1.8.13  /home/ali/.arduino15/packages/arduino/hardware/samd/1.8.13
Error during build: exit status 1

I am unable to install the SPIFBlockDevice library via command line (should this need to be installed separately).

$ arduino-cli lib install SPIFBlockDevice
Error installing SPIFBlockDevice: Library 'SPIFBlockDevice' not found