stm32duino / Arduino_Core_STM32

STM32 core support for Arduino
https://github.com/stm32duino/Arduino_Core_STM32/wiki
Other
2.84k stars 976 forks source link

Failed programming: recipe not found 'program.pattern' in v.2.8.0 #2415

Closed brightproject closed 4 months ago

brightproject commented 4 months ago

I'm not entirely sure that this is a bug, but without changing it, I conducted a series of observations and experiments. Also not entirely sure what is causing the crash, but initially decided to write to this community. I have been using the arduino-cli and Arduino_Core_STM32 combination for a long time. Some time ago the arduino-cli was updated, but there were no problems. I usually use Arduino IDE version 1.8.19 and update the stm32 and esp32 cores through the board manager. I could not install the stm32 core using Arduino IDE version 1.8.19 stm32_core_update_error

Updated the core via arduino-cli by entering the command

arduino-cli core install STMicroelectronics:stm32

The stm32 core has been updated to version 2.8.0 and when loading the firmware onto the board

arduino-cli upload -b STMicroelectronics:stm32:GenF4:pnum=BLACKPILL_F411CE,upload_method=swdMethod -i C:\Users\name\AppData\Local\Temp\arduino\sketches\28137305E41AD2AD2370E09B77B89274\test.ino.bin

got this error

Failed programming: recipe not found 'program.pattern'

Used library                           Version Path
Wire                                   1.0.0   C:\Users\name\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.8.0\libraries\Wire
Adafruit Unified Sensor                1.1.14  C:\Users\name\Documents\Arduino\libraries\Adafruit_Unified_Sensor
Adafruit BNO055                        1.6.3   C:\Users\name\Documents\Arduino\libraries\Adafruit_BNO055
Adafruit BusIO                         1.16.0  C:\Users\name\Documents\Arduino\libraries\Adafruit_BusIO
Bolder Flight Systems Eigen            3.0.2   C:\Users\name\Documents\Arduino\libraries\Eigen
Bolder Flight Systems WMM              1.1.0   C:\Users\name\Documents\Arduino\libraries\wmm
Bolder Flight Systems Unit Conversions 5.0.0   C:\Users\name\Documents\Arduino\libraries\units-main
SrcWrapper                             1.0.1   C:\Users\name\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.8.0\libraries\SrcWrapper
SPI                                    1.1.0   C:\Users\name\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.8.0\libraries\SPI

Used platform            Version Path
STMicroelectronics:stm32 2.8.0   C:\Users\name\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.8.0
PS C:\Users\name\OneDrive\Documents\PlatformIO\Projects\esp32_two_buttons> arduino-cli upload -b STMicroelectronics:stm32:GenF4:pnum=BLACKPILL_F411CE,upload_method=swdMethod -i C:\Users\name\AppData\Local\Temp\arduino\sketches\28137305E41AD2AD2370E09B77B89274\test.ino.bin
Failed programming: recipe not found 'program.pattern'

and in arduino IDE log

 Tool STM32_SVD is not available for your operating system.
java.lang.RuntimeException: java.lang.Exception: Tool STM32_SVD is not available for your operating system.
    at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:179)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Tool STM32_SVD is not available for your operating system.
    at cc.arduino.contributions.packages.ContributionInstaller.install(ContributionInstaller.java:84)
    at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$2(ContributionManagerUI.java:172)
    ... 1 more
Tool name : STM32_SVD 1.15.1
     sys : all cc.arduino.contributions.packages.HostDependentDownloadableContribution@e22d00
 seems to have no downloadable contributions for your operating system, but it is installed in
C:\Users\name\AppData\Local\Arduino15\packages\STMicroelectronics\tools\STM32_SVD\1.15.1

I rolled back to version 2.7.1 - everything works fine on it. I'm not sure if I can repeat the error on other PCs, but version 2.8.0 doesn't work for me.

fpistm commented 4 months ago

Could you be more precise on your setup? Arduino ide version? arduino-cli version? Host OS? ....

brightproject commented 4 months ago

Could you be more precise on your setup? Arduino ide version? arduino-cli version? Host OS? ....

Yes, sure! Windows 10 pro, 22H2 Arduino-cli 1.0.1 Arduino IDE 1.8.19

BennehBoy commented 4 months ago

Same issue. Arch Linux (currently patched) Arduino-cli 0.35.3 (Arch package not yet updated to 1.0.1) Arduino IDE 2.3.2

EDIT - although I can upload fine from the IDE, just arduino-cli throwing the program.pattern issue.

fpistm commented 4 months ago

@BennehBoy seems strange with arduino ide2. It works fine on Linux. Which target you used?

BennehBoy commented 4 months ago

Updated my comment, IDE works fine. arduino-cli fails.

sketch.yaml: default_fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103CB,usb=CDCgen,xserial=generic,xserial=generic

SuppaTenko commented 4 months ago

I second this issue. Saw recipe not found 'program.pattern' error in logs today. Didn't bother about it for some reason. Now when i try to flash my MCU via STLink first i get read ECONNRESET in arduino logs. And when i retry - i get No connection established Compilation error: No connection established

And arduino-cli.exe process is dead. When i only compile my code without flashing or when i export binaries - it works just fine. My OS is Win10x64 build 17763 Arduino IDE is 2.3.2 Rolled back stm32 core to 2.7.1, and it works good, so it's something with this update...

fpistm commented 4 months ago

@BennehBoy , @SuppaTenko So you get the issue only to flash the board? Can you share your command line please?

BennehBoy commented 4 months ago
arduino-cli upload
Failed programming: recipe not found 'program.pattern'
SuppaTenko commented 4 months ago

Hold up, let me update it back to 2.8.0... ** upd. Yeah, my error is still there.

It goes straight to read ECONNRESET, so i can't see my command line in arduino log. Verbose logging for both compilation and upload is active, and i also activated all warnings.

... Sketch uses 60980 bytes (11%) of program storage space. Maximum is 524288 bytes. Global variables use 20272 bytes (15%) of dynamic memory, leaving 110800 bytes for local variables. Maximum is 131072 bytes. read ECONNRESET

Please tell me how to check my command line the right way if I'm misunderstanding something.

fpistm commented 4 months ago

@BennehBoy Could you test with arduino-cli 1.0.1. There is a lot a breaking change and probably linked...

BennehBoy commented 4 months ago

@BennehBoy Could you test with arduino-cli 1.0.1. There is a lot a breaking change and probably linked...

Will do as soon as there's a package update available for Arch - it's been flagged out of date since 1.0.1 got released.

BennehBoy commented 4 months ago

I've manually built arduino-cli 1.0.1 and re-tested:

arduino-cli compile
Sketch uses 48532 bytes (37%) of program storage space. Maximum is 131072 bytes.
Global variables use 6108 bytes (29%) of dynamic memory, leaving 14372 bytes for local variables. Maximum is 20480 bytes.

Used library                                     Version Path
SPI                                              1.1.0   /home/bennehboy/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.0/libraries/SPI
Adafruit GFX Library                             1.11.9  /home/bennehboy/Arduino/libraries/Adafruit_GFX_Library
Adafruit BusIO                                   1.16.1  /home/bennehboy/Arduino/libraries/Adafruit_BusIO
Wire                                             1.0.0   /home/bennehboy/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.0/libraries/Wire
Adafruit SSD1331 OLED Driver Library for Arduino 1.2.2   /home/bennehboy/Arduino/libraries/Adafruit_SSD1331_OLED_Driver_Library_for_Arduino
SrcWrapper                                       1.0.1   /home/bennehboy/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.0/libraries/SrcWrapper
USBDevice                                        1.0.0   /home/bennehboy/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.0/libraries/USBDevice

Used platform            Version Path
STMicroelectronics:stm32 2.8.0   /home/bennehboy/.arduino15/packages/STMicroelectronics/hardware/stm32/2.8.0

arduino-cli upload
Failed programming: recipe not found 'program.pattern'

arduino-cli version
arduino-cli  Version: 1.0.1-arch Commit: 590e73bf0412a30780298415180ee085e8d27a07 Date:
fpistm commented 4 months ago

@brightproject Install under Arduino 1.8.19 is now ok. Legacy Arduino IDE doesn't support the host value "all". I've updated the json to provide all supported host value: https://github.com/stm32duino/BoardManagerFiles/commit/0e3e525120767e5214201172dae50c2655eb2f1c

Anyway, other issues appears, some variables values defined in the platform.txt are not expanded. I guess, I will not support the legacy Arduino IDE 1.8.x. Supporting new features and specifications from Arduino is not compatible with it.

About the upload issue, I found the root cause, since programmer.default is defined the cli try to use it and does not fallback to upload feature like it is done by the Arudino IDE 2.x. Will try to find a fix, for testing simply remove the line in the menu of your board in boards.txt which set the programmer.default

BennehBoy commented 4 months ago

About the upload issue, I found the root cause, since programmer.default is defined the cli try to use it and does not fallback to upload feature like it is done by the Arudino IDE 2.x. Will try to find a fix, for testing simply remove the line in the menu of your board in boards.txt which set the programmer.default

Confirmed working, thanks.

SuppaTenko commented 4 months ago

Oh! Caught it! image

And after I retry uploading i get ECONNRESET again. Just like yesterday. image

fpistm commented 4 months ago

@SuppaTenko issue is identified and a workaround exist see my comment: https://github.com/stm32duino/Arduino_Core_STM32/issues/2415#issuecomment-2203131381

Fix will come soon.