pic32prog: add a documentation on how to update PICkit3#9260
pic32prog: add a documentation on how to update PICkit3#9260kYc0o merged 1 commit intoRIOT-OS:masterfrom
Conversation
dist/tools/pic32prog/doc.md
Outdated
| Flashing on Linux using pickit-3 | ||
| ================================ | ||
|
|
||
| Allow flashing a pic32-wifire from linux using https://github.com/sergev/pic32prog |
There was a problem hiding this comment.
Hmm... yeah, maybe this needs a rewording, or just remove "Allow".
There was a problem hiding this comment.
Flashing another firmware on the pickit-3 allows that.
I could go for "Update the pickit-3 firmware to allow flashing..."
There was a problem hiding this comment.
I think it would be better to have something a little more descriptive. E.g. "Go to https://github.com/sergev/pic32prog and download the PIC32 programmer software"?
There was a problem hiding this comment.
It will be automatically built by the RIOT build system (like edbg).
There was a problem hiding this comment.
Ahhhh, now I understand the sentence.... the link isn't supposed to be followed, but just used as a noun here... Ok... then maybe use some markdown magic here instead ;-):
This document describes how to enable flashing a pic32-wifire from linux using [pic32prog] with a PICkit-3
<!-- .... at the bottom of the document -->
[pic32prog]: https://github.com/sergev/pic32prog
dist/tools/pic32prog/doc.md
Outdated
|
|
||
| ### Setup Windows VM | ||
|
|
||
| You can download a free 90 days valid windows virtualbox image from: |
There was a problem hiding this comment.
That's only if you need to change the firmware of your pickit3 (usually you'll need), and it can only be done under windows.
There was a problem hiding this comment.
I know this, but it isn't clear from this document.
There was a problem hiding this comment.
I could add a global summary at the beginning explaining what should be done and how:
- Update pickit-3 firmware to allow flashing from linux
- Updating the firmware should be done from a windows computer
- This tutorial will explain how to do it from a virtual machine.
There was a problem hiding this comment.
I do net think it would then be necessary to repeat it after if explained at the beginning.
miri64
left a comment
There was a problem hiding this comment.
Some initial comments while trying out the process (won't finish today).
dist/tools/pic32prog/doc.md
Outdated
| * optional: set an empty password in Settings-Accounts | ||
| * optional: Create a shared folder with your host machine. I run an offline | ||
| windows machine so download everything from my host. | ||
| * Install Virtualbox Guest-additions for USB support (reboot) |
There was a problem hiding this comment.
I think this could need some details. I know how to do that, but someone who never worked with VirtualBox (or VMs in general) might not know what to do here.
dist/tools/pic32prog/doc.md
Outdated
| * optional: Create a shared folder with your host machine. I run an offline | ||
| windows machine so download everything from my host. | ||
| * Install Virtualbox Guest-additions for USB support (reboot) | ||
| * USB add both 'microchip' usb as USB1 devices |
There was a problem hiding this comment.
I think this could need some details. I know how to do that, but someone who never worked with VirtualBox (or VMs in general) might not know what to do here.
dist/tools/pic32prog/doc.md
Outdated
| * optional: disabled network | ||
| * Start and login with password: Passw0rd! | ||
| * optional: set an empty password in Settings-Accounts | ||
| * optional: Create a shared folder with your host machine. I run an offline |
There was a problem hiding this comment.
I think this could need some details. I know how to do that, but someone who never worked with VirtualBox (or VMs in general) might not know what to do here.
dist/tools/pic32prog/doc.md
Outdated
|
|
||
| * Create a machine in virtualbox in File-Import Appliance. | ||
| * optional: disabled network | ||
| * Start and login with password: Passw0rd! |
There was a problem hiding this comment.
My VM (MSEdge - Win10.ova) started without password prompt.
There was a problem hiding this comment.
Ok I will remove it. It is explained on the microsoft page anyway.
dist/tools/pic32prog/doc.md
Outdated
| I downloaded a Windows 10 virtualbox image | ||
|
|
||
| * Create a machine in virtualbox in File-Import Appliance. | ||
| * optional: disabled network |
There was a problem hiding this comment.
I think this could need some details. I know how to do that, but someone who never worked with VirtualBox (or VMs in general) might not know what to do here.
There was a problem hiding this comment.
I will remove the parts about networking and shared folder as these are just because it is not required to connect your windows to the internet and that I tend to not connect them without antivirus but it should not be the problem of the tutorial.
dist/tools/pic32prog/doc.md
Outdated
| * optional: Create a shared folder with your host machine. I run an offline | ||
| windows machine so download everything from my host. | ||
| * Install Virtualbox Guest-additions for USB support (reboot) | ||
| * USB add both 'microchip' usb as USB1 devices |
There was a problem hiding this comment.
It's unclear here, that this enabling USB is only possible, when the machine is shut down.
dist/tools/pic32prog/doc.md
Outdated
| * Run `setup.exe` | ||
| * Run PICkit3 | ||
| * Tools/Download PICkit Operating System | ||
| * Select c://Program Files/Microchip/PICkit3/PK3OSV020005.hex |
There was a problem hiding this comment.
The application seems to stall during this process.
There was a problem hiding this comment.
It should be fixed by permanently registering the usb device to auto-reattach it.
dist/tools/pic32prog/doc.md
Outdated
| * Connect the chipKIT-Wi-Fire to USB | ||
| * Connect the PICkit3 to JP1 ICSP holes | ||
| * https://docs.creatordev.io/wifire/guides/wifire-programming/ | ||
| * The Arrow `▶` goes into the hole number 1 (a hole with a square around it) |
There was a problem hiding this comment.
Hole? You probably mean port or pin ;-).
| * Tools/Download PICkit Operating System | ||
| * Select c://Program Files/Microchip/PICkit3/PK3OSV020005.hex | ||
| * Device should be flashed there will be a message saying the board is found | ||
| * Turn off your VM |
There was a problem hiding this comment.
The application is crashing when exiting. Maybe calm the reader down, that this is "normal" ;-).
| Programmer for Microchip PIC32 microcontrollers, Version 2.0.221 | ||
| Copyright: (C) 2011-2015 Serge Vakulenko | ||
| Adapter: PICkit3 Version 2.0.5 | ||
| Processor: MZ2048EFG100 (id 1720E053) |
There was a problem hiding this comment.
I still get No target found. here :-(
There was a problem hiding this comment.
It was a permissions problem after all. Maybe also add a line above that the udev rules need to be adapted:
ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="900a", MODE="664", GROUP="plugdev
|
@miri64 Thank you for the thorough review. I tried to address all your comments in separate commits. |
| * Shutdown the virtual machine | ||
| * In the virtual machine settings, go to USB: | ||
| * Select "Enable USB Controller" with "USB 1.1" | ||
| * Click the small '+' sign on the right and add the Microchip devices. |
There was a problem hiding this comment.
(The device needs to be plugged in for this)
dist/tools/pic32prog/doc.md
Outdated
| permission issue. | ||
|
|
||
| Add yourself to the `plugdev` group, add the following `udev` rule and reboot. | ||
| (Find a tutorial if you do not know how to do this). |
There was a problem hiding this comment.
RTFM is not very friendly. Especially since explaining that you need to add the rule to a file in /etc/udev/rules.d is just as short ;-)
There was a problem hiding this comment.
Yeaaaaahhh you are right.
There was a problem hiding this comment.
I checked my files and found that I had mplab udev rules, that is why it was detected on my computer.
They had some wildcard values for idProduct and found this other website talking about rules for these devices: http://en.microstickplus.com/mplabx-on-linux
So I put the link and only use idVendor as selection.
|
I guess adding the binary file |
miri64
left a comment
There was a problem hiding this comment.
Some minor nits, some stuff that still isn't quite ironed out, but overall I think if this is fixed (and the binary file removed), we can merge.
|
|
||
| It will require flashing a specific firmware on the PICkit3. | ||
| As this can only be done from a Windows computer, that not many Linux users | ||
| have, the following steps explain how to setup a Windows VirtualBox virtual |
There was a problem hiding this comment.
This document contains several spellings of VirtualBox (capitalization differs). Please decide on one (I prefer the canonical spelling).
There was a problem hiding this comment.
Updated all to VirtualBox.
dist/tools/pic32prog/doc.md
Outdated
|
|
||
| * Install Virtualbox | ||
| * Add yourself to the 'vboxusers' group | ||
| `sudo usermod -a -G vboxusers your_username` |
There was a problem hiding this comment.
Rendered this looks a little bit weird due to the missing newline.
dist/tools/pic32prog/doc.md
Outdated
|
|
||
| * PICkit3-Programmer http://ww1.microchip.com/downloads/en/DeviceDoc/PICkit3%20Programmer%20Application%20v3.10.zip | ||
|
|
||
| Adapted from the README (on Windows 10 machine .NET 4.00 is already installed) |
There was a problem hiding this comment.
The context of this sentence isn't clear to me (maybe because it is missing a subject or a colon at the end?)
dist/tools/pic32prog/doc.md
Outdated
|
|
||
| https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ | ||
|
|
||
| I downloaded a Windows 10 virtualbox image |
There was a problem hiding this comment.
Who is "I" (once people only see the markdown in the repo, people might wonder)?
dist/tools/pic32prog/doc.md
Outdated
| * Run PICkit3 | ||
| * Tools/Download PICkit Operating System | ||
| * Select `c://Program Files/Microchip/PICkit3/PK3OSV020005.hex` | ||
| * Device should be flashed there will be a message saying the board is found |
There was a problem hiding this comment.
Please rephrase, this sentence is lacking grammatical structure.
dist/tools/pic32prog/doc.md
Outdated
|
|
||
| https://github.com/sergev/pic32prog | ||
|
|
||
| Run it without the board connected |
dist/tools/pic32prog/doc.md
Outdated
| USBID pin: controlled by port | ||
| ``` | ||
|
|
||
| pic32prog firmware.hex |
There was a problem hiding this comment.
Maybe write somewhere here, that this is the actual flashing step.
|
I tried to address all remarks and looked at the rendered text too: https://github.com/cladmi/RIOT/blob/pr/pic32/doc/dist/tools/pic32prog/doc.md |
miri64
left a comment
There was a problem hiding this comment.
Minor grammar nit left. Please fix and squash immediately.
dist/tools/pic32prog/doc.md
Outdated
|
|
||
| * PICkit3-Programmer http://ww1.microchip.com/downloads/en/DeviceDoc/PICkit3%20Programmer%20Application%20v3.10.zip | ||
|
|
||
| The steps were adapted from the archive README: |
To use pic32prog, the PICkit3 must be updated with a scripting mode firmware. This describes how to do it on Linux using a windows VM (free).
|
Done |
|
Is this ready to merge? |
|
Yes, just let Murdock have another go at this. |
|
Murdock agrees. Go! |
Contribution description
To use pic32prog, the PICkit3 must be updated with a scripting mode firmware.
This describes how to do it on Linux using a windows VM (free).
I did what was described here: #6092 (comment)
Future work
Issues/PRs references
#6092 (comment)
Documents #9259