platformio / builder-framework-mbed

ARM mbed build script for PlatformIO Build System
http://platformio.org/frameworks/mbed
Apache License 2.0
4 stars 17 forks source link

bugfix: was not working in python3.9 #25

Closed SubaruArai closed 3 years ago

SubaruArai commented 3 years ago

the version of intelhex was too old.

issue: #22

valeros commented 3 years ago

Hi @SubaruArai ! This problem was already resolved some time ago, but the changes wasn't mirrored in this repository. Have you bumped into any issues with Python 3.9 lately?

SubaruArai commented 3 years ago

@valeros Thank you, I didn't expect such a fast response!

Yes, I did encounter it. Here are my environments:

Here are my steps to reproduce:

  1. install platformio from the Extensions tab
  2. start a new project using the following config:
    • board = nucleo_f303k8
    • framework = mbed
  3. see error occur

or, after the generation:

  1. cd into that generated folder
  2. pio run
  3. see error occur, ending with
    File "C:\Users\someone\.platformio\packages\framework-mbed\platformio\package_deps\py3\intelhex\compat.py", line 60:
    array_tobytes = getattr(array.array, "tobytes", array.array.tostring)
valeros commented 3 years ago

That's strange, but I cannot reproduce the problem on Python 3.9.4. What version of the ststm32 platform is installed in your system? Could you please attach the entire log when you're trying to compile?

SubaruArai commented 3 years ago

@valeros After your response I tried a few things and I think I found the root cause.

  1. Turns out the ststm32 version was quite old, 8.0.0 on both platforms that I tested, which seemed to be the root cause.
    • the version of framework-mbed tied was 6.60200.200722, which contained the problem.
  2. Updating ststm32 to 14.1.0 fixed it, pio run showed using framework-mbed 6.60900.210318.
  3. After clean reinstalling platformio (also deleting ~/.platformio), the issue disappeared, using ststm32@14.1.0.

So, it was a problem of me using a too old library. My bad, and thank you for your fast response and patience!