Description
Originally posted by @matthijskooijman in #1333 (comment)
I noticed a regression that I expect is caused by this PR. When using arduino-cli from git now, uploads using (our slightly customized version of) the STM32 core fail with:
Error during Upload: Property 'upload.tool.serial' is undefined
The board in question indeed does not define upload.tool.serial
, but still uses the pre-pluggable syntax of defining upload.tool
, which should be translated to upload.tool.default
by convertUploadToolsToPluggableDiscovery()
. However, this core does not define upload.tool
on the board directly, but defines it in a board menu: https://github.com/stm32duino/Arduino_Core_STM32/blob/974b35690cbf4680ce5746c61c69fb20935bae2f/boards.txt#L522
To reproduce:
$ arduino-cli compile --fqbn STMicroelectronics:stm32:Nucleo_32:pnum=NUCLEO_F031K6,upload_method=serialMethod --upload --port /dev/ttyACM0
Sketch uses 7612 bytes (23%) of program storage space. Maximum is 32768 bytes.
Global variables use 828 bytes (20%) of dynamic memory, leaving 3268 bytes for local variables. Maximum is 4096 bytes.
Error during Upload: Property 'upload.tool.serial' is undefined
I guess this is fairly easy to fix in the core, though (just define both upload.tool.default
(or upload.tool.<protocol>
) in addition to the legacy upload.tool
, but it might be useful to fix compatibility here too. An obvious fix would be to implement the fallback when actually doing the upload, rather than when loading the boards).
@fpistm, you might find this interesting too :-)