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

Build error when setting upload.maximum_size or upload.maximum_data_size properties in hexadecimal format #2517

Open
3 tasks done
fronders opened this issue Jan 31, 2024 · 1 comment
Labels
priority: low Resolution is a low priority type: imperfection Perceived defect in any part of project

Comments

@fronders
Copy link

fronders commented Jan 31, 2024

Describe the problem

When the boards.txt definition contains either {upload.maximum_size} or {upload.maximum_data_size} as hex values instead of decimal the build fails with error:

Using library ArduinoJson at version 6.21.4 in folder: C:\Users\xxx\Arduino\libraries\ArduinoJson 
Using library SrcWrapper at version 1.0.1 in folder: C:\Users\xxx\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.7.1\libraries\SrcWrapper 
Error during build: strconv.Atoi: parsing "0x20000": invalid syntax

Used library                            Version Path
SparkFun u-blox SARA-R5 Arduino Library 1.1.9   C:\Users\xxx\Repo\tacoman\SparkFun_u-blox_SARA-R5_Arduino_Library
SoftwareSerial                          1.0.0   C:\Users\xxx\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.7.1\libraries\SoftwareSerial
ArduinoUniqueID                         1.3.0   C:\Users\xxx\Arduino\libraries\ArduinoUniqueID
STM32duino RTC                          1.4.0   C:\Users\xxx\Arduino\libraries\STM32duino_RTC
ArduinoJson                             6.21.4  C:\Users\xxx\Arduino\libraries\ArduinoJson
SrcWrapper                              1.0.1   C:\Users\xxx\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.7.1\libraries\SrcWrapper

Used platform            Version Path
CustomBoard:stm32      1.0.0   C:\Users\xxx\Arduino\hardware\CustomBoard\stm32
STMicroelectronics:stm32 2.7.1   C:\Users\xxx\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.7.1
IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I"
[Error] Verifying sketch 'main.ino': Exit with code=1

To reproduce

Edit boards.txt entry to set {upload.maximum_size} or {upload.maximum_data_size} to a hex value i.e. 0x20000 instead of 131072

[......]
BOARD_ID.upload.maximum_size=0x20000
[......]

Expected behavior

Hexadecimal property values when prefixed with 0x should be parsed normally just like the {build.flash_offset} property is.

Arduino CLI version

nightly-20240131 Commit: 205a6a5 Date: 2024-01-31T01:27:13Z

Operating system

Windows

Operating system version

10.0.19045 Build 19045

Additional context

arduino-cli.exe is run from VSCode using Microsoft's Arduino extension: vsciot-vscode.vscode-arduino

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
@fronders fronders added the type: imperfection Perceived defect in any part of project label Jan 31, 2024
@alessio-perugini
Copy link
Contributor

alessio-perugini commented Feb 1, 2024

👋 currently we're giving support only to decimal values. As you can see here: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/builder/sizer.go#L138-L149
https://github.com/arduino/arduino-cli/blob/master/internal/arduino/builder/sketch.go#L254

We can add support for that, but I cannot guarantee you when as we're considering this is a low priority. If you're willing to make a PR we'll be more than happy the review it.

@alessio-perugini alessio-perugini added the priority: low Resolution is a low priority label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Resolution is a low priority type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants