platformio / platform-intel_mcs51

Intel MCS-51 (8051): development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/intel_mcs51
Apache License 2.0
56 stars 45 forks source link

TypeError: float() argument must be a string or a number: #8

Closed zerog2k closed 6 years ago

zerog2k commented 6 years ago
[Tue Jun 19 23:16:03 2018] Processing stc15w408as (platform: https://github.com/platformio/platform-mcs51.git; board: stc15w408as)
--------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
TypeError: float() argument must be a string or a number:
File "/home/jens/.platformio/penv/local/lib/python2.7/site-packages/platformio/builder/main.py", line 165:
env.SConscript("$BUILD_SCRIPT")
File "/home/jens/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/home/jens/.platformio/packages/tool-scons/script/../engine/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/home/jens/.platformio/platforms/mcs51/builder/main.py", line 156:
target_firm = env.BuildProgram()
File "/home/jens/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/home/jens/.platformio/penv/local/lib/python2.7/site-packages/platformio/builder/tools/platformio.py", line 82:
env.PrintConfiguration()
File "/home/jens/.platformio/packages/tool-scons/script/../engine/SCons/Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "/home/jens/.platformio/penv/local/lib/python2.7/site-packages/platformio/builder/tools/pioplatform.py", line 136:
system_data.append("%s RAM (%s Flash)" % (util.format_filesize(ram),
File "/home/jens/.platformio/penv/local/lib/python2.7/site-packages/platformio/util.py", line 744:
filesize = float(filesize)
===================================================== [ERROR] Took 0.38 seconds =====================================================

looks related to https://github.com/platformio/platformio-core/issues/1458

seems like in our boards jsons, we'll need to specify upload.maximum_ram_size and upload.maximum_size, although not sure exactly what we would be using them for (not sure platform-mcs51 implements this).

zerog2k commented 6 years ago

@ivankravets do you have any tip on how upload section would/could/should be implemented by platform-mcs51? http://docs.platformio.org/en/latest/platforms/creating_board.html#json-structure says: upload settings which depend on the platform but doesn't seem immediately obvious to me how it would be used.

I was thinking maybe this is for some limits on code/ram size?, but in our case (sdcc), this already happens during build w/ options we have like (size_iram, size_xram, size_code, etc):

{
  "build": {
    "extra_flags": [
        ""
    ],
    "f_cpu": "11059200",
    "size_iram": 256,
    "size_xram": 256,
    "size_code": 4096,
    "size_heap": 128,
    "mcu": "mcs51",
    "cpu": "8051",
    "variant": "stc15w404as"
  },
  "frameworks": [
  ],
  "upload": {},
  "name": "stc15w404as",
  "url": "https://github.com/platformio/platform-mcs51/wiki",
  "vendor": "STC"
}
ivankravets commented 6 years ago

How does uploading work without PlatformIO? Could provide Makefile?

zerog2k commented 6 years ago

https://github.com/zerog2k/stc_diyclock/blob/master/Makefile#L32-L33 Generally, for stc mcus, stcgal (or oem STC-ISP app) detects target mcu and flashes accordingly. The ram/code size params are really only useful here during compilation, afaik.

Is there some doc which shows the boards/platforms/etc schemas, or otherwise explains what values are optional vs required, etc?

ivankravets commented 6 years ago

Yes, these options are requried

ivankravets commented 6 years ago

See refactored manifests https://github.com/platformio/platform-intel_mcs51/commit/a3928757cd835134d76ca34f701c00123208be6e