• AVR Freaks

Hot!Reception on endpoint 129 failed (err = -10121)

Author
Victor_Gorn
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/02/16 00:09:33
  • Location: Israel
  • Status: offline
2020/02/23 00:03:27 (permalink)
0

Reception on endpoint 129 failed (err = -10121)

Hello my Friends,
 
i am trying to debug my program in the PIC24FJ128GA010 on MPLAB X IDE v5.30 thru ICD4 but everytime get some errors.
The program is very short and simple to work with SPI2 EXTERNAL FLASH.
The harware has the power from ICD4, the hardware is pullups 3k to PGC1 and PGD1 and 47k to MCLR.
I can some times read and write/verify from/to IC, but usually i have problem with this also.
 
*****************************************************
// PIC24FJ64GA006 Configuration Bit Settings
**********************************************************************************
 
// CONFIG2
#pragma config POSCMOD = NONE          // Primary Oscillator Select (Primary oscillator disabled)
#pragma config OSCIOFNC = ON                // Primary Oscillator Output Function (OSC2/CLKO/RC15 functions as port I/O (RC15))
#pragma config FCKSM = CSDCMD            // Clock Switching and Monitor (Clock switching and Fail-Safe Clock Monitor are disabled)
#pragma config FNOSC = FRCPLL                // Oscillator Select (Fast RC Oscillator with PLL module (FRCPLL))
#pragma config IESO = OFF                          // Internal External Switch Over Mode (IESO mode (Two-Speed Start-up) disabled)
 
// CONFIG1
#pragma config WDTPS = PS1024              // Watchdog Timer Postscaler (1:1,024)
#pragma config FWPSA = PR32                   // WDT Prescaler (Prescaler ratio of 1:32)
#pragma config WINDIS = OFF                    // Watchdog Timer Window (Windowed Watchdog Timer enabled; FWDTEN must be 1)
#pragma config FWDTEN = OFF                  // Watchdog Timer Enable (Watchdog Timer is disabled)
#pragma config ICS = PGx1                           // Comm Channel Select (Emulator/debugger uses EMUC1/EMUD1)
#pragma config GWRP = OFF                       // General Code Segment Write Protect (Writes to program memory are allowed)
#pragma config GCP = OFF                           // General Code Segment Code Protect (Code protection is disabled)
#pragma config JTAGEN = OFF                    // JTAG Port Enable (JTAG port is disabled)
 
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
 
#include <xc.h>
 
 The output from ICD4 is:
 
**************  Programming is good sometimes  ********************
Connecting to MPLAB ICD 4...
 
Currently loaded versions:
Application version............01.06.28
Boot version...................01.00.00
FPGA version...................01.00.00
Script version.................00.03.33
Script build number............0540a22e50
ICD4 is supplying power to the target (3.25 volts).
Target device PIC24FJ64GA006 found.
Device Revision Id  = 0x3044
 
Calculating memory ranges for operation...
 
Erasing...
 
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x3ff
configuration memory
 
Programming/Verify complete
 
****************  Reading is good sometimes  ************************
The following memory area(s) will be read:
program memory: start address = 0x0, end address = 0xabfb
configuration memory
 
Read complete
 
****************  Debugging is always not good  ************************
Connecting to MPLAB ICD 4...
 
Currently loaded versions:
Application version............01.06.28
Boot version...................01.00.00
FPGA version...................01.00.00
Script version.................00.03.33
Script build number............0540a22e50
ICD4 is supplying power to the target (3.25 volts).
Target device PIC24FJ64GA006 found.
Device Revision Id  = 0x3044
 
Calculating memory ranges for operation...
 
Erasing...
 
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x3ff
configuration memory
 
A communication error with the debug tool has occurred. The tool will attempt to recover momentarily.
_____________________  Debugger Console _________________________
Launching
Programming target
Failed to program the target device
The debugger could not be started.  Terminating debug session.
User program finished
 
************ Program Device for Debugging is always not good   ********************
 
Connecting to MPLAB ICD 4...
 
Currently loaded versions:
Application version............01.06.28
Boot version...................01.00.00
FPGA version...................01.00.00
Script version.................00.03.33
Script build number............0540a22e50
ICD4 is supplying power to the target (3.25 volts).
Target device PIC24FJ64GA006 found.
Device Revision Id  = 0x3044
 
Calculating memory ranges for operation...
 
Erasing...
 
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x3ff
configuration memory
 
Reception on endpoint 129 failed (err = -10121)
A communication error with the debug tool has occurred. The tool will attempt to recover momentarily.
 
__________________________    SPI_EEPROM Program ________________________
Connecting to programmer...
Programming target...
The programmer could not be started: Failed to program the target device.
 
 
 
 
Please tell me what i am doing wrong, it should be so simple.
If You need some other info or tests, please tell me.
 
Thank You.
Regards
Victor
 
#1

10 Replies Related Threads

    Oleg
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2013/06/01 02:52:33
    • Location: 0
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/03/31 05:18:05 (permalink)
    0
    I have the same error before debugging starts:
    "Reception on endpoint 129 failed (err = -10121)
    protocol failure: In transfer Recovered
    ..."
     
    PICkit4 + PIC32MZ2048EFH064IPT+MPLABX v5.30
     
    Some times it is gone away... But, when starts, it's very annoying trouble. 
     
    What is it?
    post edited by Oleg - 2020/03/31 05:43:51
    #2
    Victor_Gorn
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/02/16 00:09:33
    • Location: Israel
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/01 00:00:19 (permalink)
    -1 (1)
    Hello Oleg,
    I got no answer here, but what I understood from all my googling this issue that problem is in ICD4 Debugger, it is not compatible 100% to MPLAB X IDE. 
    Take other debugger for your project or better change the controller to any other company, TI , ST, Renesas.
    I developed a lot with TI, it was easy, fast, greate support and working 100%.
    Goodluck my Friend
    #3
    crosland
    Super Member
    • Total Posts : 1936
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/01 06:20:14 (permalink)
    0
    VictorGorn
    I got no answer here, but what I understood from all my googling this issue that problem is in ICD4 Debugger, it is not compatible 100% to MPLAB X IDE.

    That would be surprising given that they are both from Microchip.
     
    change the controller to any other company, TI , ST, Renesas.

     
    Do you think that's helpful?
     
    Are you using the latest MPLAB X? Have you verified the ICD4 has the latest firmware?
     
    Have you tried powering the target separately? How much power does it need? Is it within the spec of the ICD4 to power the target?
     
    Have you tried different USB ports on the host? Are you using a USB hub?
     
    The IDE/drivers/tools are flaky but it's usually possible to get to a stable setup eventually.
     
    Have you opened a support ticket with Microchip? I would urge you to do so. The more people report these sort of issues the more likely they are to make their tools more robust.
    #4
    ric
    Super Member
    • Total Posts : 26942
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/01 16:09:23 (permalink)
    0
    VictorGorn
    ...
    the hardware is pullups 3k to PGC1 and PGD1 and 47k to MCLR.

    Pullups?
    Page 19 of the ICD4 User Guide specifically tells you NOT to have pullups on PGC and PGD.
    http://ww1.microchip.com/...S50002596D.pdf#page=19
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    Victor_Gorn
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/02/16 00:09:33
    • Location: Israel
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/02 00:32:13 (permalink)
    0
    Hello crosland,
    i am using:

    Product Version: MPLAB X IDE v5.30
    Java: 1.8.0_181; Java HotSpot(TM) 64-Bit Server VM 25.181-b13
    Runtime: Java(TM) SE Runtime Environment 1.8.0_181-b13
    System: Windows 10 version 10.0 running on amd64; Cp1255; iw_IL (mplab)
    User directory: C:\Users\eng\AppData\Roaming\mplab_ide\dev\v5.30
    Cache directory: C:\Users\eng\AppData\Local\mplab_ide\Cache\dev\v5.30\var
     

    ICD4 Currently loaded versions:
    Application version............01.06.28
    Boot version...................01.00.00
    FPGA version...................01.00.00
    Script version.................00.03.33
    Script build number............0540a22e50
    ICD4 is supplying power to the target (3.25 volts).
    Target device PIC24FJ64GA006 found.
    Device Revision Id  = 0x3044
     
    Have you tried powering the target separately? Yes, the same status.
    How much power does it need? Up to 100mA, it is nothing on scheme exept of microcontroller, I checked the power level with scope. No droping or reducing on power line.
    Is it within the spec of the ICD4 to power the target? It is the same with external power and internal.
    Have you tried different USB ports on the host? Yes, I tried to change ports on PC and changed PC also.
    Are you using a USB hub? No.
     
    It is empty schematic with only controller, the dedugger can sometimes write/read the target, i did all pullups as You asked, so why I can"t debug? 
    It is so simple, I am developing about 20 years, so why it is not working?
    It is company culture, if Microchip can release not tested products and by surprise or miracle it is not working for 100%, sometimes(debuging for example) is not working 100%.
    So why, I am the customer, need to do this work for Microchip, instead of rapid development, why I need to report to You, to report to support team of Microchip.
    Why I need work for Microchip bugs, I am working for Microchip, I will get some profit from this work???
    NOT, Not, NOT.
    May be I am wrong and I must to do it, but before I didn"t meet issues like this with TI, Rabbit, ST and others.
    For me it is new issue that I need to find bugs in your degugger.
    I am not talking about the fact , it took about month to post my issue here.
     
    In any case, i get no answer here untill I did some anti post, why?
     
    Regards
    Victor
     
    #6
    Oleg
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2013/06/01 02:52:33
    • Location: 0
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/02 01:32:36 (permalink)
    +1 (1)
    Hello! Thanks for answers!
    My problem is resolved.
    The reason was an unstable external clock source (KXO-V97 50.0MHz). After power-up, the generator did not always start correctly.
    So, when it(KXO-V97) did not start correctly, the PIC32MZ automatically started from the internal generator. After that, the programming procedure was correct. But, this was the cause of the debugger connection error and the following: 
    "Reception on endpoint 129 failed (err = -10121)
    protocol failure: In transfer Recovered
    ..."
     
    Therefore, I can assume that this error is due to a mismatch of the configuration bits setting to the real clock source.
     
     
     
    #7
    crosland
    Super Member
    • Total Posts : 1936
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/02 03:32:09 (permalink)
    +3 (3)
    VictorGorn
    It is empty schematic with only controller,

     
    Decouplers?
     
    So why, I am the customer, need to do this work for Microchip, instead of rapid development, why I need to report to You, to report to support team of Microchip.

     
    This forum is just users, not Microchip. I am telling YOU to report it to Microchip through the official ticket system. The more people do that, the more MC will realise the difficulties that people have.
     
    #8
    Victor_Gorn
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2020/02/16 00:09:33
    • Location: Israel
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/05 00:16:00 (permalink)
    -1 (1)
    Thank You, my Friend.
    Sorry about my speech, i was just disappointed by Microcheap product.
    I spent a lot of time and money on this ...t and got nothing.
    I passed to TI microcontroller that i worked before, for now it looks good for me.
    Please close my account here, i will not need it any more.
     
    Thank You again.
    Regards
    Victor
    #9
    ric
    Super Member
    • Total Posts : 26942
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/05 01:12:10 (permalink)
    0
    VictorGorn
    Please close my account here, i will not need it any more.

    Again, we are just users, we can't close your account.
    No-one from Microchip would bother.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #10
    ThorntonElectronics
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2020/04/28 07:44:39
    • Location: 0
    • Status: offline
    Re: Reception on endpoint 129 failed (err = -10121) 2020/04/30 04:29:26 (permalink)
    0
    Hi There,
     
    I was having this issue with every cable I used and multiple versions of MPLAB X IDE. With my Oscilloscope I could not see any information being sent along the clock and data lines.
     
    When I was not able to update the driver firmware MPLAB recommended that I try the hardware tool emergency boot firmware recovery inside of MPLAB's debug tab. This then fixed my device and I was able to program.
     
    I hope this helps someone else in the future.
    #11
    Jump to:
    © 2020 APG vNext Commercial Version 4.5