Stuck on first attempt using MPLAB X (PICkit4)


+ Reply to Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Thanks for the ideas. You got me started playing with the command window directly, noticed differences by playing with parameter syntax.

    I've removed the ".X" suffix on the folder as well as replace a SPACE for an UNDERSCORE; just to be sure. I get identical results from the powershell window and MCS+5.

    I've also added the -W option; my PIC is not powered. It's on the MeLabs 8-40 pin ZIF adapter PCB.

    Code:
    C:\MPLABX\v6.05\mplab_platform\mplab_ipe\ipecmd.exe -TSBUR223673449 -P16F877 -FK:\Project_v2\PBP\Test_1_16F877_Blinky\Blinky_16F877.HEX -E -M -OB -OL -OV -W -Y
    
    DFP Version Used : PIC16Fxxx_DFP,1.3.42,Microchip
    Selected Programming Tool Sno: 
    BUR223673449
    *****************************************************
    Transmission on endpoint 2 failed (err = -109)
    A communication error with the debug tool has occurred. The tool will attempt to recover momentarily. A log of the error was created at C:\Users\Papa\queuelogs\debugtool
    Connection Failed.
    Transmission on endpoint 2 failed (err = -109)
    *****************************************************
    Transmission on endpoint 2 failed (err = -109)
    A communication error with the debug tool has occurred. The tool will attempt to recover momentarily. A log of the error was created at C:\Users\Papa\queuelogs\debugtool
    Connection Failed.
    Transmission on endpoint 2 failed (err = -109)
    Erase Target Failed.
    I'm including a PDF of the log file.

    debugtool.pdf

    NOTE FOR THE NEXT PERSON: look at CommandLineReadmes.htm in C:\MPLABX\v6.05\docs; the very first item is IPECMD.EXE, and it states that it supports PK4. The ReadMe has a detailed list of command line options available for IPECMD.EXE.
    Last edited by Demon; - 7th April 2023 at 03:09.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    This worked in IPE, then I played with the options, and now it gives the same error in IPE.

    So I thought I might have bricked my 16F877 with either the E - Erase flash device or M - Entire region programmed (I'm new to these command line parameters, never had to touch that before).

    I tried without -E and -M on another 16F877; same error. So something else is going on.

    I put my first 16F877 on the Lab X-1 and it's still blinking; so it's not bricked.
    Last edited by Demon; - 7th April 2023 at 03:30.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    This is my post over on MeLabs support forum:

    Grabbing at straws, I had removed spaces in my folder names, didn't do anything; unplugged/plugged PK4, didn't do anything. I kept getting the same error from MCS+5 and from direct command line window.

    Desperate, so I did what any rinky-dink customer support would say and rebooted my PC ... and it worked.

    Code:
    DFP Version Used : PIC16Fxxx_DFP,1.3.42,Microchip
    Selected Programming Tool Sno:
    BUR223673449
    *****************************************************
    Connecting to MPLAB PICkit 4
    Currently loaded versions:
    Application version...........00.08.54
    Boot version..................01.00.00
    Script version................00.05.35
    Script build number...........86fedc5c2e
    Tool pack version ............1.13.1519
    PICkit 4 is supplying power to the target (5.00 volts).
    Target device PIC16F877 found.
    Device Revision Id *= 0x6
    Device Id = 0x9a0
    *****************************************************
    Erasing...
    Erase successful
    *****************************************************
    Calculating memory ranges for operation...
    Erasing...
    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0x3d
    configuration memory
    Programming/Verify complete
    *Program Report
    06-Apr-2023, 23:01:53
    Device Type:PIC16F877
    Program Succeeded.
    PK4 Verify Report
    06-Apr-2023, 23:01:53
    Device Type:PIC16F877
    *****************************************************
    The following memory area(s) will be verified:
    program memory: start address = 0x0, end address = 0x1fff
    configuration memory
    EEData memory
    User Id Memory
    Verification successful.
    Verify Succeeded.
    *****************************************************​
    I don't know why.


    This is my final command line:

    Code:
    -TSBUR223673449 -P$target-device$ -F$hex-filename$ -E -M -OB -OL -OV -W -Y

    Generic PK4 tool works just as well.

    Code:
    -TPPK4 -P$target-device$ -F$hex-filename$ -E -M -OB -OL -OV -W -Y


    Big thanks to Richard and Tumbleweed for their ideas, and to Ioannis for cheering me on.
    Last edited by Demon; - 7th April 2023 at 04:11.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    Very glad you did it!

    Remember to use MPLABX 5.35 assembler for PBP.

    Ioannis

  5. #5
    Join Date
    Aug 2011
    Posts
    453


    2 out of 2 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    All of the "Transmission on endpoint 2 failed (err = -109)" messages typically indicate that the PK4 wasn't fully updated.

    There are three parts to the firmware inside the PK4, and whenever you change MPLABX versions it's important that all three sections get updated to match the version of MPLABX you're using. This applies to a PK4 right out of the box since there's a good chance it was built with a different set of firmware than the version you're trying to use (you'd think a brand new one would work, but no).

    This is supposed to happen automatically, but on all the PC's I've ever used it doesn't... each time you open MPLABX IPE it'll update one part and then hang. You have to let it timeout, close MPLABX, reopen it and it'll proceed to the next part. It takes about three or four whacks at this until it finally loads all the firmware and magically everything works. During this process I've seen MPLABX produce almost every conceivable bogus error message you can imagine.

    That's why you'll see a lot of posts about rebooting, unplugging the tool, closing/reopening etc. It doesn't always happen quite the same way, but for me it's been this way since day one with MPLABX and ANY of the programming tools. It's even worse if you have one of the older tools (PK2, PK3) and you switch back and forth between the old MPLAB 8.92 and MPLABX.

    It's a good idea to make sure the tool isn't connected to your target hardware while it does this dance, just the USB cable.

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X

    I updated my summary in post #1. Spaces in the folder/filename will most definitely cause problems.

    I wasn't sure cause I was trying more than one thing at a time. But I am now; it just back and bit me. The command window just flashes and it's gone.

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: Stuck on first attempt using MPLAB X (PICkit4)

    Couldn't even find my own thread on how to get PK4 working with MCS+ ... D'OH!

    I can't stress enough the importance of NO SPACES IN FOLDERNAME AND FILENAME.

    Here's a pic of how to set the programmer for those that are visual (like me):

    Name:  PK4 settings.png
Views: 3408
Size:  46.9 KB
    Last edited by Demon; - 10th March 2025 at 20:35.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Replies: 19
    Last Post: - 16th May 2023, 17:06
  2. My serial to parallel attempt
    By johndoug in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th January 2013, 04:15
  3. Upgraded to MPLAB IDE 8.14 and now I'm stuck
    By BlueHairBob in forum General
    Replies: 2
    Last Post: - 20th August 2008, 01:15
  4. MPLAB Quickbuild stuck on
    By RichardBowser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th July 2006, 02:52
  5. First attempt at coding
    By bartman in forum mel PIC BASIC
    Replies: 0
    Last Post: - 10th November 2004, 17:52

Members who have read this thread : 10

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts