Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Out of memory" error when installing arduino:samd platform #1059

Closed
arock093 opened this issue Nov 5, 2020 · 8 comments
Closed

"Out of memory" error when installing arduino:samd platform #1059

arock093 opened this issue Nov 5, 2020 · 8 comments
Labels
conclusion: resolved Issue was resolved type: imperfection Perceived defect in any part of project

Comments

@arock093
Copy link

arock093 commented Nov 5, 2020

I thought about posting this in the forum. It seems like a underlying technical issue so hopefully this will be alright.

I'm using a raspberry pi zero w. Based off of reports by others on the forum, it should be able to handle arduino-cli.
I tested the command arduino-cli core install arduino:avr and it worked fine.
I'm trying to run the commands, arduino-cli core install arduino:samd and arduino-cli core install adafruit:samd

This is the output. Both commands get hung up on "Installing arduino:arm-none-eabi-gcc@7-2017q4..." and then are Killed.

Downloading packages...
arduino:arm-none-eabi-gcc@7-2017q4 downloaded                                   
arduino:[email protected] downloaded                                        
arduino:[email protected] downloaded                                      
arduino:[email protected] downloaded                                                  
arduino:[email protected] downloaded                                            
arduino:[email protected] downloaded                                             
arduino:[email protected] downloaded                                                   
Installing arduino:arm-none-eabi-gcc@7-2017q4...
Killed

The process is getting killed for some reason.

dmesg output indicates a memory issue:

Out of memory: Killed process 514 (arduino-cli) total-vm:938304kB, anon-rss:398624kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:598kB oom_score_adj:0
@per1234
Copy link
Contributor

per1234 commented Nov 5, 2020

Hi @arock093. Thanks for your bug report.

Please post the output from this command:

arduino-cli version

@per1234 per1234 added component/core status: waiting for information More information must be provided before work can proceed labels Nov 5, 2020
@arock093
Copy link
Author

arock093 commented Nov 5, 2020

Hi @arock093. Thanks for your bug report.

Please post the output from this command:

arduino-cli version

arduino-cli Version: 0.13.0 Commit: 693a045

@per1234
Copy link
Contributor

per1234 commented Nov 5, 2020

OK, I think this bug might have been fixed since the time of the 0.13.0 release version you're using (#981).

Please try again with the nightly build of Arduino CLI and then let us know if that fixes the issue:
https://arduino.github.io/arduino-cli/latest/installation/#nightly-builds

@arock093
Copy link
Author

arock093 commented Nov 5, 2020

OK, I think this bug might have been fixed since the time of the 0.13.0 release version you're using (#981).

Please try again with the nightly build of Arduino CLI and then let us know if that fixes the issue:
https://arduino.github.io/arduino-cli/latest/installation/#nightly-builds

I used the nightly build and it allowed me to install the cores. Now I'm having an issue compiling.

I've also opened an issue on Adafruit/samd repository - adafruit/ArduinoCore-samd#271

arduino-cli compile --fqbn adafruit:samd:adafruit_trinket_m0 MyFirstSketch
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.3/cores/arduino/WInterrupts.c: In function 'detachInterrupt':
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.3/cores/arduino/WInterrupts.c:378:1: internal compiler error: Illegal instruction
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.3/cores/arduino/cortex_handlers.c: In function 'Reset_Handler':
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.3/cores/arduino/cortex_handlers.c:543:1: internal compiler error: Illegal instruction
 }

I am able to compile for a different board.

arduino-cli compile --fqbn arduino:avr:mega MyFirstSketch
Sketch uses 1536 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.

I am also able to compile the sketch for the board on a different computer.

Using a Raspberry Pi 4, the sketch compiles without any issues for the Adafruit Trinket M0 board. This leads me to believe the issue has something to due with the relationship between the Rasperry Pi Zero W and adafruit:samd.

I get the same errors when I try to compile for other adafruit:samd boards on the Raspberry Pi Zero W.


gcc --version
gcc (Raspbian 8.3.0-6+rpi1) 8.3.0

Section of verbose output:

/home/pi/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD "-D__SKETCH_NAME__=\"\"\"MyFirstSketch.ino\"\"\"" -DF_CPU=48000000L -DARDUINO=10607 -DARDUINO_TRINKET_M0 -DARDUINO_ARCH_SAMD -DCRYSTALLESS -DADAFRUIT_TRINKET_M0 -D__SAMD21E18A__ -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x801E -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"Trinket M0\"" -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/TinyUSB -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src -Os -I/home/pi/.arduino15/packages/adafruit/tools/CMSIS/5.4.0/CMSIS/Core/Include/ -I/home/pi/.arduino15/packages/adafruit/tools/CMSIS/5.4.0/CMSIS/DSP/Include/ -I/home/pi/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/ -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/variants/trinket_m0 /home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/WInterrupts.c -o /tmp/arduino-sketch-704E54BF84B4765302A16BBD33C1F4E6/core/WInterrupts.c.o
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/WInterrupts.c: In function 'detachInterrupt':
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/WInterrupts.c:378:1: internal compiler error: Illegal instruction
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
/home/pi/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/**arm-none-eabi-gcc** -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD "-D__SKETCH_NAME__=\"\"\"MyFirstSketch.ino\"\"\"" -DF_CPU=48000000L -DARDUINO=10607 -DARDUINO_TRINKET_M0 -DARDUINO_ARCH_SAMD -DCRYSTALLESS -DADAFRUIT_TRINKET_M0 -D__SAMD21E18A__ -DARM_MATH_CM0PLUS -DUSB_VID=0x239A -DUSB_PID=0x801E -DUSBCON -DUSB_CONFIG_POWER=100 "-DUSB_MANUFACTURER=\"Adafruit\"" "-DUSB_PRODUCT=\"Trinket M0\"" -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/TinyUSB -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src -Os -I/home/pi/.arduino15/packages/adafruit/tools/CMSIS/5.4.0/CMSIS/Core/Include/ -I/home/pi/.arduino15/packages/adafruit/tools/CMSIS/5.4.0/CMSIS/DSP/Include/ -I/home/pi/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/ -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino -I/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/variants/trinket_m0 /home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/cortex_handlers.c -o /tmp/arduino-sketch-704E54BF84B4765302A16BBD33C1F4E6/core/cortex_handlers.c.o
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/cortex_handlers.c: In function 'Reset_Handler':
/home/pi/.arduino15/packages/adafruit/hardware/samd/1.6.4/cores/arduino/cortex_handlers.c:545:1: internal compiler error: Illegal instruction
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
Error during build: exit status 1

I was thinking about manually updating gcc but I'm not sure if it's using Raspberry PI OS included gcc to compile or the one it downloads with Adafruit:samd.

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Nov 5, 2020
@ubidefeo
Copy link

ubidefeo commented Nov 9, 2020

@arock093
unfortunately there will always be some issues with armv6 because some tools (or versions of them) do not run happily on it.
If you move to armv7 (Pi3) you should have no issues.
The Zero is also quite slow and runs on 512MB of RAM.
The tests I ran on it a while back took an excruciatingly long time to compile for SAMD and when it came to mbedos I could sit there forever :(

Right now my only hope when it comes to that format is that Raspberry Pi Foundation releases a Zero form-factor board with more RAM and a new CPU :)

@arock093
Copy link
Author

Thanks for the help and feedback everyone. I apologize for opening an issue when it was less of a software issue and more hardware compatibility problem.

I was able to get an Arduino Micro to work with the Raspberry Pi Zero.

As far as this issue goes, should I close it and try to get the adafruit:SAMD repo to mention somewhere about the Pi zero having compatibility issues?

@ubidefeo
Copy link

@arock093
when it comes to 3rd party cores we don't have power, but we are working towards making sure that dependencies are properly installed when they are properly defined in the core package.
I haven't gone through Adafruit's ones, but I know they do their research and are very responsive when it comes to issues reports :)

@per1234 per1234 reopened this Mar 30, 2021
@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added type: imperfection Perceived defect in any part of project topic: core labels Sep 22, 2021
@per1234 per1234 changed the title Bug Report: Can't install samd cores "Out of memory" error when installing arduino:samd platform Nov 8, 2022
@umbynos
Copy link
Contributor

umbynos commented Nov 25, 2022

Closing because the original Out of Memory bug was resolved. Thanks for the interest in the project ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

7 participants