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

TypeError converting project, possibly related to being generated by STM32Cube #1

Open
ablaylock opened this issue May 11, 2019 · 1 comment
Assignees

Comments

@ablaylock
Copy link

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

@bojanpotocnik bojanpotocnik self-assigned this May 12, 2019
@bojanpotocnik
Copy link
Owner

Quick fix would be to change
device_id=int(text(tco, "DeviceId")),
in line 367 to
device_id=int(text(tco, "DeviceId")) if text(tco, "DeviceId") else None,.

Thank you for your issue, this project is basically made by trial-and-error, but I only used Nordic nRF5 SDK files for testing (that's what I needed this tool for). I will try to generate a few projects using STM32Cube and update during the week.
Moreover, I also posted to Keil forum in hope to get a useful response and sort it all out systematically.

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

2 participants