I wrote earlier about the problem on github, but I was redirected to the forum.
How to change arduino-builder to arduino-cli in arduino IDE 1.8.19 · Issue #375 · arduino/arduino-builder · GitHub
I use arduino IDE 1.8.19 for code
When I click the checkmark, the code is compiled.
In the IDE settings, I specified the output of details - verbose.
And when compiling the sketch, I see many many lines that begin with the following lines
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Admin\AppData\Local\Arduino15\packages -hardware C:\Users\Admin\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Admin\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Admin\Documents\Arduino\libraries
Link about arduino builder arduino-builder
I realized that the program is deprecated, and it is recommended to use the new version of arduino-cli.
But, after reading the branch about arduino-cli, I got completely confused a very complex tool for a not very advanced programmer.
The main problem, I use the arduino IDE and the core from STMicroelectronics to work with stm32 Arduino_Core_STM32
Every programmer knows how many times to compile code during debugging and programming.
This is tens of hundreds of times a day.
The problem with the kernel from ST is that it takes a very, very long time to compile for the Windows platform.
About 20-30 sec on 1 non-biggest scketch.
One solution is to switch to Linux, but this option has not yet been considered by me.
Therefore I look towards the command line.
My actions are the following:
- The Arduino builder is outdated, so I don’t consider it at all, but it is still used when compiling code from the Arduino IDE
- Use an arduino-cli, but a very complex entry threshold and there are no examples as such. Documentation for advanced programmers. There is little information on the Internet, on YouTube.
- Use the command line from the CT kernel itself Arduino_Core_STM32, but it involves the use of Smake and this is also very, very difficult for me.
Tell me to set up the compiler in step 2, i.e. using arduino cli.
Examples and some hints.
I use power shell as command line.
I registered the global path to the arduino-folder where the arduino-cli is located and I can run the arduino-cli from anywhere.
But difficulties with setting up the compiler.
I will be glad for any help.
When I compile the sketch and load it into the black pill STM32F401CCU6 via SWD from the arduino IDE, all is well.
But I want to use arduino cli to compile and upload without resorting to using arduino IDE.
I'm already using a third party code editor, Notepad++, check the Arduino IDE settings (use external code editor) and write the code.
Some commands put me in a stupor through arduino-cli.
For example:
PS C:\Users\Admin> arduino-cli board attach
Error opening sketch: main file missing from sketch: C:\Users\Admin\Admin.ino
Firstly, the command to display the list of boards does not see anything.
This is probably due to the connection of the black pill through the SWD, but when you work from the Arduino IDE, everything works without problems.
When you try to update the stm32 kernel, it doesn't find anything at all.
PS C:\Users\Admin> arduino-cli core update-index
Downloading index: package_index.tar.bz2 downloaded
Downloading index: package_esp8266com_index.json downloaded
Downloading index: package_esp32_index.json downloaded
Downloading index: package_STM32duino_index.json downloaded
Downloading index: package_stmicroelectronics_index.json downloaded
What could be the problem?
I don't understand why the arduino IDE, when compiling from the editor, uses the default arduino builder, and not the arduino cli or at least the operocd?
How can I make it clear to the Arduino-cli command line that I have a SVD programmer slink version 2 connected?
It is defined in the system as a USB device, not a COM port.
The most incomprehensible thing is that the arduino cli is kind of the same as the arduino IDE, only in the form of a command line.
But for some reason this command line does not work as an arduino IDE, it does not even see the boards and ports.
PS C:\Users\Admin> arduino-cli board list
Порт Protocol Тип Board Name FQBN Core
COM1 serial Serial Port Unknown
COM4 serial Serial Port Unknown
COM5 serial Serial Port Unknown
COM8 serial Serial Port (USB) Unknown
I do not want to use Arduino IDE 2.0 yet, because I see the use of the new version of the IDE as just an additional load on the PC.
I have notepad++ and I'm pretty good at coding in it.
I just need a command line to compile and download the black pill firmware via ST link version 2 (or as specified in kernel Arduino_Core_STM32 SWD).