The Harmony 3 Framework is Microchip's current supported environment for development.
Which is not saying much :-(
The sample projects are not nearly as well developed as the Harmony 2 Framework.
- There are no sample projects for many of the older boards, e.g. PIC32MX or PIC32MZ_EF_Curiosity
- Sample projects for Atmel boards are available (Atmel was bought by Microchip in 2016)
- all networking projects have UART2 support for debugging (good)
- no networking projects have USB (bad)
- no USB projects have UART2 (bad)
- using the Microchip Harmony Configurator 3 to add components to projects effectively broke them, either by making them no compile or not work once compiled (very bad)
Since I need to have a networking project for PIC32MZ_EF_SK that has UART2 and USB working at the same time, that was the first problem.
After about a dozen attempts, I figured out what was being broken to prevent compiles, what was being broken to prevent the minimal projects from working after that. And then managed to get a simple USB function added via MHC3 that didn't break the otherwise working network project. And then managed to get that to enumerate as a USB device without breaking networking....
In theory, I should now be able to add USBLAN to it. And then look at adding support for the PIC32MZ_EC_SK and PIC32MZ_EF_Curiosity boards.
After about a dozen attempts, I figured out what was being broken to prevent compiles, what was being broken to prevent the minimal projects from working after that. And then managed to get a simple USB function added via MHC3 that didn't break the otherwise working network project. And then managed to get that to enumerate as a USB device without breaking networking....
In theory, I should now be able to add USBLAN to it. And then look at adding support for the PIC32MZ_EC_SK and PIC32MZ_EF_Curiosity boards.
In some respects the changes to the project setup for Harmony 3 are good. In Harmony 2, projects pointed at the base code in the Harmony 2 library. Which made the configuration xml file a nightmare. As it consistently put in relative file links instead of absolute. Which made publishing for other people problematical, as they would have to have a similar filesystem set up for the projects. Fixing the xml manually was problematic as mplab x would consistently break them again.
In Harmony 3, MHC3 copies the libraries required into the project itself. Which allows each project to be self-contained (except when running MHC3 itself as it needs to be able to find the Harmony 3 files etc.)
In practice, the current MHC3 is buggy in the extreme. Simply opening a sample networking project (e.g. web_net_server_nvms), verifying that it compiles and works and then re-generating the code produces code that does not compile. Some components having been removed (system command and debug).
Fixing those to be able to compile produces something that loads but does not work as the system clocks have been changed in plib_clck.c so that the ethernet module no longer initializes.
Fixing that restored the project to working status.
Then using MHC3 to add USB (e.g. HID Basic), did not add anything to the application layer. I had to dig into the USB device sample projects to copy and integrate the application USB code.
But at least I now have a working PIC32MZ_EF_SK networking project (i.e. httpnet web page functional across Ethernet), with debug output on UART2, and enumerating as a Basic HID device.
In Harmony 3, MHC3 copies the libraries required into the project itself. Which allows each project to be self-contained (except when running MHC3 itself as it needs to be able to find the Harmony 3 files etc.)
In practice, the current MHC3 is buggy in the extreme. Simply opening a sample networking project (e.g. web_net_server_nvms), verifying that it compiles and works and then re-generating the code produces code that does not compile. Some components having been removed (system command and debug).
Fixing those to be able to compile produces something that loads but does not work as the system clocks have been changed in plib_clck.c so that the ethernet module no longer initializes.
Fixing that restored the project to working status.
Then using MHC3 to add USB (e.g. HID Basic), did not add anything to the application layer. I had to dig into the USB device sample projects to copy and integrate the application USB code.
But at least I now have a working PIC32MZ_EF_SK networking project (i.e. httpnet web page functional across Ethernet), with debug output on UART2, and enumerating as a Basic HID device.
No comments:
Post a Comment