Can you try targeting the .NET Framework version 3.5 in the Project Properties and checking if it works?
In the above screenshot, my platform toolset is v141 because I'm using VS 2017, in your case since it is VS 2019, v142 is fine. Don't change that.
I could only import the CyBootloaderUtils project. I get this error when trying to import the application project:
Looks like VS Studio 2017 doesn't WPF applications targeting .NET Core 3 from what I found here. Should try it out on VS 2019.
Meanwhile, let me know if specifying the .NET Target Framework solves the problem for you.
Thanks for the Target Framework tip.
I found the ".NET Target Framework Version" option under Advanced > C++/CLI Properties.
It had nothing in the field, and it looks like the setting only takes effect if "Common Language Runtime Support" is set. So I set it to ".NET Core Runtime Support (/clr:netcore)"
Now I need a TargetFramework value that actually works. Most things I try either result in a "Not Recognized" Error thrown on build.
Setting "netcoreapp3.0" for some reason throws the following (it thinks I'm targeting 3.5?):
Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 3.5. Either target .NET Core 3.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.5.
Not sure why it thinks netcoreapp3.1 == .NET Core 3.5...
Visual Studio problems...
The reason I asked you try that is because a user had a similar problem and it was solved after using .NET Framework 3.5. You can find that thread here: USB bootloader dll
I'm not able to open the WPF application for some reason, the project load fails.
Anyways, regarding the error, revert back the changes and try these steps:
(1) In Solution Explorer, open the right-click menu for the WPF project and then choose Properties.
(2) In the left column of the Properties window, choose the Application tab.
(3) Change the .NET Framework to 3.5
Repeat the same steps for the BootloaderUtils project as well.
Run the WPF application now and let me know if it works.
This is not an option for me in settings, this is a .NET Core project:
Changing to .NET Framework would likely mean having to create a new project unless I'm misunderstanding (which is possible, I'm not terribly experienced working in C#/.NET).
Reverting back to Framework also goes against the idea of what this project was for, which was mostly to experiment with trying to build a bootloader using .NET Core rather than Framework. This is for cross-platform reasons. .NET Core is meant to be cross-platform rather than having to use something like mono to emulate the .NET Framework on linux.
If it's not doable then it's not doable, but it's going to probably start getting annoying having the bootloader utils locked to older versions of .NET.
At this point maybe I'll just see if I can port bootloader utils to a C# managed library.
1 of 1 people found this helpful
If you require the bootloader host application that is cross-platform, I would suggest looking at the source code of dfuh-tool which we provide with ModusToolbox. After installation, you can find it in this path: "ModusToolbox\tools_2.2\dfuh-tool\sample_code".
It is created using Qt Creator, you can modify it as per requirement. Written using C++.
Hope this helps
Thanks for the tip, I will look into dfuh-tool. I assume it follows the same bootloader protocol as the one included with Creator?
P.S. I actually did undertake porting the bootoader host utilities to C# .NET as documented in the thread below:
Just yesterday I was able to successfully load a PSoC5 on the CY8CKIT-050 with the ported library, so it actually seems to be coming along fairly well.
I assume it follows the same bootloader protocol as the one included with Creator?
The dfuh-tool that comes packaged with ModusToolbox only works with PSoC6 devices. This is because it supports only .cyacd2 file format. Please look at the documentation present in the doc folder of the tool to get more information on this. Since the source code is made available, it should be fairly easy to modify it to work for .cyacd files. So, the answer is yes, its the same, but requires slight modifications to make it work for .cyacd format.
Just yesterday I was able to successfully load a PSoC5 on the CY8CKIT-050 with the ported library
Glad to hear that you got it working. It would be nice if you could also share your work here so that other users can also benefit from it!