sipeed / platform-kendryte210

Kendryte K210: development platform for PlatformIO
https://platformio.org/platforms/kendryte210
Other
79 stars 31 forks source link

Default the value of upload.slow to avoid build error #39

Closed mikljohansson closed 2 years ago

mikljohansson commented 3 years ago

Default the value of upload.slow to avoid build errors for boards when this field is not specified. This issue was introduced in #22

maxgerhardt commented 3 years ago

@sipeed can this PR please be merged? People are reporting that uploading does not work in the current master version (here)

ivankravets commented 3 years ago

board.get("upload.slow") returns None if value is not set. it almost the same as False

if None == if False.

Could you explain how to reproduce this issue?

maxgerhardt commented 2 years ago

This PR is absotely needed, otherwise


KeyError: "Invalid board option 'upload.slow'":
  File "C:\Users\Max\AppData\Local\Programs\Python\Python38\Lib\site-packages\platformio\builder\main.py", line 180:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\Max\.platformio\packages\tool-scons\scons-local-4.2.0\SCons\Script\SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Max\.platformio\packages\tool-scons\scons-local-4.2.0\SCons\Script\SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\Max\.platformio\platforms\kendryte210@src-5b2280d30a918e89fd87b2e29227ee59\builder\main.py", line 108:
    "-S" if board.get("upload.slow") else ""
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\platformio\platform\board.py", line 46:
    raise KeyError("Invalid board option '%s'" % path)
========================================================================================== [FAILED] Took 1.16 seconds ==========================================================================================

with a platformio.ini of

[env:sipeed-maix-bit]
platform = https://github.com/sipeed/platform-kendryte210.git
board = sipeed-maix-bit
framework = kendryte-standalone-sdk
ivankravets commented 2 years ago

Thanks, @maxgerhardt !