bojanpotocnik / cmake-uvision-syncer Goto Github PK
View Code? Open in Web Editor NEWCMake ⇄ µVision project file synchronizer
License: MIT License
CMake ⇄ µVision project file synchronizer
License: MIT License
I noticed that exception 'NoneType' object has no attribute 'split' comes out if Aads/VariousControls/MiscControls
is empty.
Line
Line 414 in 049524c
text(...).split()
but text()
can be NoneType
if Aads/VariousControls/MiscControls
is empty.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?
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.
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$
Thank you in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.