Closed
Description
Bug Report
This issue is already discussed before. here, #340
But, It's old Arduino-CLI version (0.4.0) and it is not able to find the board(STM32) connected to it. So I tried arm7 build and it is able to find the board but give the unknown in board name, it can compile successfully it but give some memory error when I trying to upload it.
pi@raspberrypi:~ $ ./arduino-cli board list
Port Type Board Name FQBN Core
/dev/ttyAMA0 Serial Port Unknown
/dev/ttyS0 Serial Port Unknown
pi@raspberrypi:~ $ ./arduino-cli upload -p /dev/ttyS0 --fqbn stm32duino:STM32F1:genericSTM32F103C $HOME/Arduino/test
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x385c50]
goroutine 1 [running]:
github.com/arduino/go-paths-helper.(*Path).String(...)
/github/home/go/pkg/mod/github.com/arduino/go-paths-helper@v1.0.1/paths.go:470
github.com/arduino/arduino-cli/arduino/cores.(*ToolRelease).RuntimeProperties(0x2e67760, 0x4)
/__w/arduino-cli/arduino-cli/arduino/cores/tools.go:136 +0x7c
github.com/arduino/arduino-cli/commands/upload.Upload(0x914bb8, 0x2c2a078, 0x48a3e88, 0x90d358, 0x2c100e0, 0x90d358, 0x2c100e8, 0x60040c, 0x2c8f4f0, 0x2d46540)
/__w/arduino-cli/arduino-cli/commands/upload/upload.go:128 +0x6d0
github.com/arduino/arduino-cli/cli/upload.run(0x2d3c140, 0x2c67e30, 0x1, 0x5)
/__w/arduino-cli/arduino-cli/cli/upload/upload.go:73 +0x180
github.com/spf13/cobra.(*Command).execute(0x2d3c140, 0x2c67e00, 0x5, 0x6, 0x2d3c140, 0x2c67e00)
/github/home/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830 +0x1f4
github.com/spf13/cobra.(*Command).ExecuteC(0xdfb388, 0x42754, 0x0, 0x2c000e0)
/github/home/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914 +0x230
github.com/spf13/cobra.(*Command).Execute(...)
/github/home/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
main.main()
/__w/arduino-cli/arduino-cli/main.go:26 +0x20
Metadata
Metadata
Assignees
Labels
No labels
Activity
rsora commentedon Jun 22, 2020
Hi @raj-priyanshu,
Thanks for the Heads up!
Can you please try with the latest release for ARMv6
https://github.com/arduino/arduino-cli/releases/download/0.11.0/arduino-cli_0.11.0_Linux_ARMv6.tar.gz
and tell us if you get errors?
Thanks!
raj-priyanshu commentedon Jun 29, 2020
still getting the similar problem. i am connecting the board with gpio serial and expecting only
/dev/ttyS0
and board name but the output is as follow.pi@raspberrypi:~ $ ./arduino-cli board list
Port Type Board Name FQBN Core
/dev/ttyAMA0 Serial Port Unknown
/dev/ttyS0 Serial Port Unknown
Edit: 1. I am getting the above output even without connecting the board.
2. I can compile a test sketch successfully by '$./arduino-cli compile -v -b stm32duino:STM32F1:genericSTM32F103C $HOME/Arduino/test'
3. I tried to upload the sketch anyway and got error for both port [/dev/ttyAMA0 and /dev/ttytS0.
4. similar kind of problem discuss here https://github.com//issues/435 and I tried what they discussed there but not get succeded.
rsora commentedon Jun 29, 2020
@raj-priyanshu Can you please confirm that you installed the
stm32duino:STM32F1
core?Can you please run a
arduino-cli core list
and post here the output you get?Thanks!
raj-priyanshu commentedon Jun 29, 2020
@rsora
here it is
pi@raspberrypi:~ $ ./arduino-cli core list
ID Installed Latest Name
stm32duino:STM32F1 2019.2.28 2019.2.28 STM32F1xx/GD32F1xx boards
Edit: I am still confused about this. -> I am getting this output even without connecting the board. here is the output without the board connected.
pi@raspberrypi:~ $ ./arduino-cli board list
Port Type Board Name FQBN Core
/dev/ttyAMA0 Serial Port Unknown
/dev/ttyS0 Serial Port Unknown
rsora commentedon Jun 29, 2020
I'll ask to @per1234 to chime in as I'm not an expert in the STM32F1 chip, from CLI side it seems to me that everything was done correctly by the user.
Maybe this particular board requires some additional config parameters to pass via FQBN?
ubidefeo commentedon Jul 1, 2020
hi @raj-priyanshu
Sorry for the late reply on this, I've assigned the issue to myself in order to take some stuff off of @per1234 's plate, and because this kind of investigation is fun.
Let me share with you what Per found out and what I'm up to in order to resolve the issue and point you in the right direction.
I don't have a Blue Pill handy now, and modifying an ST-Link V2 has failed miserably, but I'll have one in house tomorrow to test.
I brought myself up to speed with STM32duino and setup a Pi Zero with Arduino-CLI which works well, and as soon as I have an F103 with bootloader I'll attempt what you are having problems with.
Here's what Per found out and observed in our conversation based on you referring to GPIO serial on the Pi.:
The first outcome is not seeing a board name, which is normal because boards can be identified solely from their USB VID:PID pair, while a serial port is just a serial port.
Per observed that uploading via serial port will require a parameter to be added as extra configuration for the board, and such parameter is
upload_method=serialMethod
, otherwise the core defaults toDFUUploadMethod
and that won't work over serial.As I gathered more information I also found out that you'll need the pins BOOT0 set to HIGH and BOOT1 set to LOW in order to be able to upload a new firmware via the Maple bootloader.
My suggestion is that you begin with making sure BOOT0 and BOOT1 are properly configured and that you add the
upload_method
parameter to yourfqbn
Try the following
and let me know.
I'll test the same and let you know, but if you succeed, please, report back to us :)
raj-priyanshu commentedon Jul 1, 2020
Hi @ubidefeo, Thanks for covering the issue
Here are the steps I did for testing:
Arduino-CLI Version: 0.11.0 Commit: 0296f4d
provided by rsora in this thread.I got this result:
I tried with usb to ttl serial cable on Ubuntu 20.04 and successfully uploaded the code.
ubidefeo commentedon Jul 1, 2020
hey @raj-priyanshu
thank you for giving it a shot.
bummer!
I have failed to hack my ST-Link into a bare board, but tomorrow I'm receiving a blue pill.
I'm concerned by this message
Filter on vendor = 0x1eaf product = 0x0003 No DFU capable USB device found Waiting for /dev/ttyUSB0 serial...Done
because it means that it's still trying DFU upload.I look forward to trying this out.
Keep you posted, and thank you for helping us squash some bugs 🙏🏼
raj-priyanshu commentedon Jul 1, 2020
Hi @ubidefeo...
I forgot to mention... the last one (STEP 9) I tried on my computer and not on raspberry pi... Also, I was making some mistake in the uploading process. So, I found that and got a successful upload on Bluepill. :)
Since the same version of Arduino-CLI is working on my computer (Linux x64) I think it is more like build issue for arm6.
ubidefeo commentedon Jul 2, 2020
That is an interesting turn of events, but before blaming the ARMv6 version I'd like to look at why it shouldn't work on the Pi.
Forgive me for asking, but even 15 years later I sometimes make this mistake myself:
Have you connected Blue Pill this way?
raj-priyanshu commentedon Jul 2, 2020
Hi @ubidefeo,
Yes, apart from that I make a pcb for this, Where rpi communicating to stm32 over serial connection and both already able to communicate properly. I wanted some cli solutions so that I could easly program the arm over ssh connection and I found Arduino-cli could be helful.
To be make sure it is not the problem with my pcb I already checked the same connection on breadboard first. And then tried to flash.so, I am very sure about connection side nothing is wrong.
Ps.- also found that some basic features will be helpful with Arduino cli so once this issue is covered I will put some feature request.
ubidefeo commentedon Jul 2, 2020
All right, I'm happy you picked our CLI for your needs and I'll further investigate this with the team.
I can't wait for my Blue Pill to arrive and get cracking :)
Please feel free to propose features, we're at a phase of the project in which we can still shape a lot and you'll see more releases coming out as we add/remove/adjust workflows based on users' needs
Thank you for helping hunt this one down for now
u.
21 remaining items