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

Runtime error using arduino-cli upload with version 0.34 #2304

Closed
3 tasks done
automatiek opened this issue Sep 8, 2023 · 4 comments
Closed
3 tasks done

Runtime error using arduino-cli upload with version 0.34 #2304

automatiek opened this issue Sep 8, 2023 · 4 comments
Assignees
Labels
conclusion: resolved Issue was resolved os: macos Specific to macOS operating system type: imperfection Perceived defect in any part of project

Comments

@automatiek
Copy link

Describe the problem

Trying to upload a binary to the Arduino Nano BLE 33 Sense on version 0.34 of the cli tools fails with following output:

shawnhymel@Shawn-Hymel-LQNW70Y61L arduino-cli_0.34.1_macOS_ARM64 % ./arduino-cli upload -p /dev/cu.usbmodem1201 --fqbn arduino:mbed_nano:nano33ble --input-dir .
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x68 pc=0x102f7df24]

goroutine 1 [running]:
github.com/arduino/arduino-cli/arduino/sketch.(*Sketch).GetDefaultFQBN(...)
	/home/build/arduino/sketch/sketch.go:241
github.com/arduino/arduino-cli/internal/cli/upload.runUploadCommand(0x14000413400?, {0x1400019af00, 0x0, 0x6?})
	/home/build/internal/cli/upload/upload.go:103 +0x1d4
github.com/spf13/cobra.(*Command).execute(0x14000413400, {0x1400019ae40, 0x6, 0x6})
	/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x4a8
github.com/spf13/cobra.(*Command).ExecuteC(0x14000313680)
	/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x338
github.com/spf13/cobra.(*Command).Execute(0x0?)
	/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 +0x1c
main.main()
	/home/build/main.go:31 +0x110

To reproduce

Use this command to reproduce

arduino-cli_0.34.1_macOS_ARM64 % ./arduino-cli upload -p /dev/cu.usbmodem1201 --fqbn arduino:mbed_nano:nano33ble --input-dir .

Expected behavior

Output using version 0.33.1:

shawnhymel@Shawn-Hymel-LQNW70Y61L arduino-cli_0.33.1_macOS_ARM64 % ./arduino-cli upload -p /dev/cu.usbmodem1201 --fqbn arduino:mbed_nano:nano33ble --input-dir .
Device       : nRF52840-QIAA
Version      : Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ]
Address      : 0x0
Pages        : 256
Page Size    : 4096 bytes
Total Size   : 1024KB
Planes       : 1
Lock Regions : 0
Locked       : none
Security     : false
Erase flash

Done in 0.001 seconds
Write 262200 bytes to flash (65 pages)
[==============================] 100% (65/65 pages)
Done in 10.397 seconds

Arduino CLI version

0.34.1

Operating system

macOS

Operating system version

Ventura 13.5 on Apple M1

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@automatiek automatiek added the type: imperfection Perceived defect in any part of project label Sep 8, 2023
@umbynos umbynos added the os: macos Specific to macOS operating system label Sep 8, 2023
@cmaglie
Copy link
Member

cmaglie commented Sep 8, 2023

I can reproduce and confirm this is a regression on MacOSX.

@cmaglie
Copy link
Member

cmaglie commented Sep 8, 2023

Also, this seems already fixed on master, I guess I can cherry-pick the commits and release a patched version 0.34.2

@automatiek
Copy link
Author

thanks @cmaglie for picking this up so rapidly.

cmaglie added a commit that referenced this issue Sep 11, 2023
…#2304 (#2305)

* Add support for default build profile (#2203)

* Add support for default profile to compile command

* Add support for default profiles to upload command

* Add TestCompileWithDefaultProfile to integration tests

* Get the profile's FQBN if it's not already specified in the request

* Update documentation regarding sketch projects

* Added integration tests for all default_profile cases

* Reverted old sketch_with_profile test

---------

Co-authored-by: Cristian Maglie <c.maglie@arduino.cc>

* [skip-changelog] Use `LoadSketch` in upload function and return `rpc.Port` in `GetPort` (#2297)

* Change GetPort's returned type to rpc.Port

* Use LoadSketch in runUploadCommand

---------

Co-authored-by: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com>
@cmaglie
Copy link
Member

cmaglie commented Sep 11, 2023

Fixed in version 0.34.2.

@cmaglie cmaglie closed this as completed Sep 11, 2023
@cmaglie cmaglie added the conclusion: resolved Issue was resolved label Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved os: macos Specific to macOS operating system type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants