Coder Social home page Coder Social logo

cmake-uvision-syncer's People

Contributors

bojanpotocnik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmake-uvision-syncer's Issues

Exception if Aads/VariousControls/MiscControls is empty

I noticed that exception 'NoneType' object has no attribute 'split' comes out if Aads/VariousControls/MiscControls is empty.
Line

mc.strip() for mc in text(to_taa_a, "VariousControls/MiscControls").split(",")

calls text(...).split() but text() can be NoneType if Aads/VariousControls/MiscControls is empty.
Maybe the same exception can happen somewhere else.

C++ support

Hello,

We use C++ and we get this weird error. Is C++ support available or is this another problem?

(base) wlan-145-94-230-99:cmake-uvision-syncer-master 2 mihaivo$ python3 main.py  /Users/mihaivo/Desktop/DARE/Stratos-IV/Software/bvc
Using µVision5 Project File '/Users/mihaivo/Desktop/DARE/Stratos-IV/Software/bvc/bvc.uvprojx'
Traceback (most recent call last):
  File "main.py", line 879, in <module>
    main()
  File "main.py", line 852, in main
    uvp = UVisionProject.new(project_path)
  File "main.py", line 455, in new
    ) for target in xproj.xpath("Targets/Target")
  File "main.py", line 455, in <listcomp>
    ) for target in xproj.xpath("Targets/Target")
  File "main.py", line 437, in <genexpr>
    ) for to_taa in target.xpath("TargetOption/TargetArmAds")
  File "main.py", line 409, in <genexpr>
    ) for to_taa_c in to_taa.xpath("Cads")
AttributeError: 'NoneType' object has no attribute 'split'
(base) wlan-145-94-230-99:cmake-uvision-syncer-master 2 mihaivo$ 

bvc.uvprojx.zip

Thank you in advance!

Problem converting stm32f103c8 Keil project (bluepill)

Hi,

First of all, thanks for a great tool, I think it would be great to have an option of converting Keil project to cmake. There are many options to convert CubeMX projects but for Keil that is the only one I found, I hope some work on this would continue.

I am trying to convert the following proj.zip.

At first, I had problems like:

Traceback (most recent call last):
  File "/stm32/cmake-uvision-syncer/main.py", line 883, in <module>
    main()
  File "/stm32/cmake-uvision-syncer/main.py", line 856, in main
    uvp = UVisionProject.new(project_path)
  File "/stm32/cmake-uvision-syncer/main.py", line 459, in new
    ) for target in xproj.xpath("Targets/Target")
  File "/stm32/cmake-uvision-syncer/main.py", line 459, in <listcomp>
    ) for target in xproj.xpath("Targets/Target")
  File "/stm32/cmake-uvision-syncer/main.py", line 441, in <genexpr>
    ) for to_taa in target.xpath("TargetOption/TargetArmAds")
  File "/stm32/cmake-uvision-syncer/main.py", line 413, in <genexpr>
    ) for to_taa_c in to_taa.xpath("Cads")
  File "/stm32/cmake-uvision-syncer/main.py", line 295, in strict_bool
    value = text(element, name, nullable=nullable)
  File "/stm32/cmake-uvision-syncer/main.py", line 285, in text
    raise ValueError(f"Only one '{name}' tag per tree is supported, {len(value)}  found")
ValueError: Only one 'uGnu' tag per tree is supported, 0  found

which I have solved by manually adding <uGnu>0</uGnu> to "Cads" section in .uvprojx file.

Then I got:

Traceback (most recent call last):
  File "/stm32/cmake-uvision-syncer/main.py", line 883, in <module>
    main()
  File "/stm32/cmake-uvision-syncer/main.py", line 856, in main
    uvp = UVisionProject.new(project_path)
  File "/stm32/cmake-uvision-syncer/main.py", line 459, in new
    ) for target in xproj.xpath("Targets/Target")
  File "/stm32/cmake-uvision-syncer/main.py", line 459, in <listcomp>
    ) for target in xproj.xpath("Targets/Target")
  File "/stm32/cmake-uvision-syncer/main.py", line 441, in <genexpr>
    ) for to_taa in target.xpath("TargetOption/TargetArmAds")
  File "/stm32/cmake-uvision-syncer/main.py", line 413, in <genexpr>
    ) for to_taa_c in to_taa.xpath("Cads")
AttributeError: 'NoneType' object has no attribute 'split'

which I solved by adding

if value[0].text is None:
    return ""

return value[0].text

to line 283 (text(..) function) in main.py.

Finally, now I am having:

Traceback (most recent call last):
  File "/stm32/cmake-uvision-syncer/main.py", line 883, in <module>
    main()
  File "/stm32/cmake-uvision-syncer/main.py", line 856, in main
    uvp = UVisionProject.new(project_path)
  File "/stm32/cmake-uvision-syncer/main.py", line 532, in new
    ) for file in xproj.xpath("RTE/files/file")
  File "/stm32/cmake-uvision-syncer/main.py", line 532, in <listcomp>
    ) for file in xproj.xpath("RTE/files/file")
  File "/usr/lib/python3.6/enum.py", line 293, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.6/enum.py", line 535, in __new__
    return cls._missing_(value)
  File "/usr/lib/python3.6/enum.py", line 548, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'header' is not a valid Category

What would be the problem and how I can approach to solving it?

TypeError converting project, possibly related to being generated by STM32Cube

I am trying to use your project to make a cmake file out of a uVision file that was generated from STM32Cube. When I run the main.py script on the project I get the following output:

Using µVision5 Project File 'G:\Users\allenb\Project\tim2_pwm\MDK-ARM\tim2_pwm.uvprojx'
Traceback (most recent call last):
File "main.py", line 879, in <module>
main()
File "main.py", line 852, in main
uvp = UVisionProject.new(project_path)
File "main.py", line 455, in new
) for target in xproj.xpath("Targets/Target")
File "main.py", line 455, in <listcomp>
) for target in xproj.xpath("Targets/Target")
File "main.py", line 376, in <genexpr>
) for to in target.xpath("TargetOption")
File "main.py", line 369, in <genexpr>
) for tco in to.xpath("TargetCommonOption")
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

I have attached the project if that is helpful and would be happy to contribute to debugging however I can.

problem.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.