Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem converting stm32f103c8 Keil project (bluepill) #3

Open
podkiva opened this issue Feb 26, 2020 · 1 comment
Open

Problem converting stm32f103c8 Keil project (bluepill) #3

podkiva opened this issue Feb 26, 2020 · 1 comment
Assignees

Comments

@podkiva
Copy link

podkiva commented Feb 26, 2020

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?

@bojanpotocnik bojanpotocnik self-assigned this Feb 26, 2020
@enversultanov
Copy link

Hi!
Thanks for sharing this tool!
I'm having same issues as podkiva, any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants