• AVR Freaks

Hot!Debugging Error - Failed while sending cmd_SET_PERIPHERAL_FREEZE com

Page: 12 > Showing page 1 of 2
Author
Rowlandski
#@>=11
  • Total Posts : 247
  • Reward points : 0
  • Joined: 2008/08/28 02:09:14
  • Location: UK - Herts
  • Status: offline
2013/10/02 04:28:22 (permalink)
0

Debugging Error - Failed while sending cmd_SET_PERIPHERAL_FREEZE com

Update regarding:
Programming...
Programming/Verify complete
Failed while sending cmd_SET_PERIPHERAL_FREEZE command
 
I’m using MPLABX v1.90, Win7, PIC18F4685 and a RealICE.
I have lifted all the devices pins, apart from pins:
1 – nMCLR,    11 – Vdd,         12 – Vss,         31 – Vss
32 – Vdd,         39 – PGC,       40 - PGD
I can Build Project ok.
I can Make and Program Device ok.
But, when Programming Device for Debugging I get error:
Programming/Verify complete
Failed while sending cmd_SET_PERIPHERAL_FREEZE command
 
I would appreciate any suggestions / questions / comments.
Rowland
 
 
My configuration bits are as follows:
// PIC18F4685 Configuration Bit Settings
#include <p18F4685.h>
// CONFIG1H
#pragma config OSC = IRCIO67    // Oscillator Selection bits (Internal oscillator block, port function on RA6 and RA7)
#pragma config FCMEN = OFF      // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled)
#pragma config IESO = OFF       // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled)
 
// CONFIG2L
#pragma config PWRT = OFF       // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = OFF      // Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software)
#pragma config BORV = 3         // Brown-out Reset Voltage bits (VBOR set to 2.1V)
 
// CONFIG2H
#pragma config WDT = OFF        // Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit))
#pragma config WDTPS = 32768    // Watchdog Timer Postscale Select bits (1:32768)
 
// CONFIG3H
#pragma config PBADEN = OFF     // PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset)
#pragma config LPT1OSC = OFF    // Low-Power Timer 1 Oscillator Enable bit (Timer1 configured for higher power operation)
#pragma config MCLRE = ON       // MCLR Pin Enable bit (MCLR pin enabled; RE3 input pin disabled)
 
// CONFIG4L
#pragma config STVREN = ON      // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset)
#pragma config LVP = OFF        // Single-Supply ICSP Enable bit (Single-Supply ICSP disabled)
#pragma config BBSIZ = 1024     // Boot Block Size Select bits (1K words (2K bytes) Boot Block)
#pragma config XINST = OFF      // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode))
 
// CONFIG5L
#pragma config CP0 = OFF        // Code Protection bit (Block 0 (000800-003FFFh) not code-protected)
#pragma config CP1 = OFF        // Code Protection bit (Block 1 (004000-007FFFh) not code-protected)
#pragma config CP2 = OFF        // Code Protection bit (Block 2 (008000-00BFFFh) not code-protected)
#pragma config CP3 = OFF        // Code Protection bit (Block 3 (00C000-00FFFFh) not code-protected)
#pragma config CP4 = OFF        // Code Protection bit (Block 4 (010000-013FFFh) not code-protected)
#pragma config CP5 = OFF        // Code Protection bit (Block 5 (014000-017FFFh) not code-protected)
 
// CONFIG5H
#pragma config CPB = OFF        // Boot Block Code Protection bit (Boot block (000000-0007FFh) not code-protected)
#pragma config CPD = OFF        // Data EEPROM Code Protection bit (Data EEPROM not code-protected)
 
// CONFIG6L
#pragma config WRT0 = OFF       // Write Protection bit (Block 0 (000800-003FFFh) not write-protected)
#pragma config WRT1 = OFF       // Write Protection bit (Block 1 (004000-007FFFh) not write-protected)
#pragma config WRT2 = OFF       // Write Protection bit (Block 2 (008000-00BFFFh) not write-protected)
#pragma config WRT3 = OFF       // Write Protection bit (Block 3 (00C000-00FFFFh) not write-protected)
#pragma config WRT4 = OFF       // Write Protection bit (Block 4 (010000-013FFFh) not write-protected)
#pragma config WRT5 = OFF       // Write Protection bit (Block 5 (014000-017FFFh) not write-protected)
 
// CONFIG6H
#pragma config WRTC = OFF       // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected)
#pragma config WRTB = OFF       // Boot Block Write Protection bit (Boot block (000000-0007FFh) not write-protected)
#pragma config WRTD = OFF       // Data EEPROM Write Protection bit (Data EEPROM not write-protected)
 
// CONFIG7L
#pragma config EBTR0 = OFF      // Table Read Protection bit (Block 0 (000800-003FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR1 = OFF      // Table Read Protection bit (Block 1 (004000-007FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR2 = OFF      // Table Read Protection bit (Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks)
#pragma config EBTR3 = OFF      // Table Read Protection bit (Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks)
#pragma config EBTR4 = OFF      // Table Read Protection bit (Block 4 (010000-013FFFh) not protected from table reads executed in other blocks)
#pragma config EBTR5 = OFF      // Table Read Protection bit (Block 5 (014000-017FFFh) not protected from table reads executed in other blocks)
 
// CONFIG7H
#pragma config EBTRB = OFF      // Boot Block Table Read Protection bit (Boot block (000000-0007FFh) not protected from table reads executed in other blocks)
 
post edited by rowlandwhiffin - 2013/11/05 04:32:12
#1

36 Replies Related Threads

    WVFishFearMe
    Starting Member
    • Total Posts : 44
    • Reward points : 0
    • Joined: 2008/11/12 13:17:52
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/02 05:17:53 (permalink)
    0
    Have same problem sporadically under win8, 64bit, and real ice. Hitting reset uC button seems to get it back on the tracks.
    Also,  when I forget to power up the target board, the IDE reports built and programmed when it did not program. 
    IDE About:

    Product Version: MPLAB X IDE v1.90
    Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
    System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (mplab)
     
    Hmmm... not really packing an amd64, running intel core i7.

     
     
    #2
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/02 05:53:33 (permalink)
    0
    Thanks for the information.
     
    I've tried "reset" on the RealICE, but still have the same issue.
     
    I'm currently using; Win7 (64bit), Intel Core i5. I am also using C18 compiler.
     
    I've even created a vero board with a PIC18F4685 on it, with one LED, in the hope i can actual do some debug.... I'll know in 20 mins.
     
    My code is is down to a couple of lines now, in the hope I have done something stupid.
     
    I'm now trying to find some sample code for a PIC18F4685 using C18, in the hope I can actually start doing something....
     
    ANY INFO OR HELP PLEASE!!!
     
    Regards,
     
    Rowland
    #3
    JMH08
    Super Member
    • Total Posts : 440
    • Reward points : 0
    • Joined: 2008/02/11 14:19:16
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/14 13:45:27 (permalink)
    0
    We believe this is a firmware problem but it is never reliably reproducible for us. Can you reproduce it every time? What firmware version are you using? Would you be willing to send us a log of the issue?
     
    To get you going, I would suggest trying a different version of the firmware. Our guess is that there is a race condition in the firmware and if the cmd_SET_PERIPHERAL_FREEZE command is called too quickly, after the previous command, problems can occur.
    #4
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/21 10:29:35 (permalink)
    0
    Thanks for your reply.
     
    Firmware version - I'm not sure what you mean?
    Yes I can reproduce this every time unfortunately...  I now have a vero board with a PIC18F4685,  basic set up with an LED / push button. I can program the device, power up and the switch turns LED on/off... but i can not run in debug.
     
    I'm happy to send you want ever you want...
     
    I'll try a different firmware version if you point me in the right direction.
     
    Regards,
     
    Rowland
    #5
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/21 10:32:12 (permalink)
    0
    C:\Program Files (x86)/Microchip/MPLABX/mplab_ide/mplablibs/modules/ext/REALICE.jar/RIFW_012913.jam
     
    ICE firmware.... what should i use?
    #6
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/22 03:29:00 (permalink)
    0
    Update.
     
    I have purchased a second REAL ICE, as I need to resolve this issue ASAP.
     
    I have used a different PC (win7) with MPLABX v1.9 and the new REAL ICE and cable.
     
    I'm using a basic board with only a switch and an LED, schematic attached.
     
    I can program the device and it'll run - switch turns LED on/off.... but debug will not run and gives the same error:
    Failed while sending cmd_set_peripheral_freeze command.
     
    I have also "packaged" up my basic test program and it's attached.
     
    I'm more than happy to send logs / data or try any suggestion to resolve this issue.
     
    So, I now have two complete independent systems that have this error....
     
    Files in public dropbox:
     
    https://www.dropbox.com/sh/vnfegu4aig8z7rf/5TXQRYxlkG
     
     
     
    Regards,
     
    Rowland
     
     
     
    post edited by rowlandwhiffin - 2013/10/22 03:41:49
    #7
    RISC
    Super Member
    • Total Posts : 5572
    • Reward points : 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/22 12:35:27 (permalink)
    0
    Hi,
     
    there is little possibility that 2 real-ice are defective...
    Can you please recheck all your connections using this recommended connection circuit.
    Do you have the older version of MPLAB 8.xx also installed on your PC ?
    Please use the following freeware : USBdeview and check that you see your real-ice properly installed and the S/N (Real-Ice must be connected). Let us know the result
     
    regards
    #8
    GentleRV
    New Member
    • Total Posts : 29
    • Reward points : 0
    • Joined: 2013/09/08 00:11:29
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/26 19:52:21 (permalink)
    +1 (1)
    The PGM pin is with a resistor of 100 K to Ground?
    The MCLR line has a diode in series with the 5 V and a resistor from 10k?
    #9
    JMH08
    Super Member
    • Total Posts : 440
    • Reward points : 0
    • Joined: 2008/02/11 14:19:16
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/30 15:41:40 (permalink)
    0
    I have tried your project and cannot reproduce the problem. However, I did change the oscillator setting to internal RC instead of the HS setting you have in your code. Can you change to internal RC and see if that makes any difference. I doubt it will but I want to eliminate all variables.
     
    Assuming that the oscillator change did not fix the problem, here's how you can log the incident. Go to the Tools menu and select Options. next select Embedded and choose the diagnostics tab. At the top you will see a logging level drop down box. Change that to FINEST. Below that, you see a browse box which indicates where the log file will be saved. Browse to wherever you want to save it. Click OK on the dialog and try to debug the device. As soon as the error occurs close down MPLAB entirely. Go the directory where you saved you log file and either move the file to another directory or rename it. This is because as soon as you restart MPLAB, it will reopen the log file and start logging again, which will overwrite the previous logging session.
     
    If you place the log file up on dropbox and let me know when it's ready, I will look at it. Note that the only file you need to send me is the one with the exact name that you specified when you created the file. The logging process creates many files with similar names with extensions like .1 and .lck. These are all temporary files created by the java logging mechanism that aren't useful to me. Once you've safely removed or renamed the log file, make sure to start up MPLAB again and turn logging off. Logging is a very time and memory intensive process. If you leave it on, it will severely degrade MPLAB's performance.
    #10
    DEKTRON
    Super Member
    • Total Posts : 1183
    • Reward points : 0
    • Joined: 2003/11/07 12:35:05
    • Location: Calne, Wiltshire, England
    • Status: offline
    Re:Programming Device for Debugging Error 2013/10/30 15:57:13 (permalink)
    +1 (1)
    It's a long shot but a few suggestions maybe  worth a try - change the VDD decoupling capacitor from 47uF to 10uF, and change the MCLR Pull-up resistor from 4K7 to 10K. I would not expect a hardware problem to cause that error message though... also use a different USB port on the PC, try a different or shorter  USB cable, don't connect the Real Ice to a USB hub... consider making a project in MPLAB-8 and see if that's any different using the same source files (use driver switcher to change the Real Ice driver if you do)  - Phil
    #11
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/11/01 08:52:28 (permalink)
    0
    JMH08,
     
    I have done as you requested...
     
    The file is, Finest MPLABX debug.rar
     
    Regards,
     
    Rowland
     
    #12
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/11/01 09:02:22 (permalink)
    0
    I've added a second one, as I wasn't sure about the first.
     
    I have left all the files... thought it would be better.
     
    Regards,
     
    Rowland
    #13
    JMH08
    Super Member
    • Total Posts : 440
    • Reward points : 0
    • Joined: 2008/02/11 14:19:16
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/11/04 12:54:17 (permalink)
    0
    I have retrieved your logs and gone through them. They definitely show the problem but don't really give my any clues as to why it is happening. Can you please download MPLAB X 1.95 and try that. I'm trying to determine if a firmware change makes any difference and 1.95 will have newer firmware. Make sure That your project is set to Use the latest firmware. If everything is set up right you will notice new firmware being downloaded the first time you connect to the REAL ICE.
     
    If that doesn't make a difference I can try sending you a patch that will put a delay right before the peripheral freeze command is sent to the REAL ICE. I think it's likely that there is a race condition in the firmware and if the peripheral freeze command is called too quickly it can cause problems. I am not the firmware engineer, so this is just a guess but I don't know what else it could be.
    #14
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/11/28 03:28:17 (permalink)
    0
    JMH08,
    Sorry for delay, been on other projects.
     
    I'm still running MPLABX 1.90, and did get it to debug ok for a while. I then had a break for a week or so, and today have wired system board to kit to run debug and now i get this (&*&^%$, Failed while sending cmd_SET_PERIPHERAL_FREEZE command error again.
     
    BTW, i have tried various ICE drivers a few weeks ago.
    I'd like to try that patch if you still have it?
     
    Regards,
     
    Rowland
     
    #15
    JMH08
    Super Member
    • Total Posts : 440
    • Reward points : 0
    • Joined: 2008/02/11 14:19:16
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/12/02 15:00:10 (permalink)
    0
    I've created the patch. Unfortunately, my code base is far enough out of date with MPLAB X version 1.90 that the patch will not work with it. It will work with MPLAB X 2.0 which will be out shortly. When it comes out I will send you the patch.
    #16
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/12/05 02:50:31 (permalink)
    0
    Thanks JMH08,
     
    Will this patch work on version 1.95? I need to debug the system this week.
     
    Or will version 2 be out this week?
     
    Regards,
     
    Rowland
    #17
    JMH08
    Super Member
    • Total Posts : 440
    • Reward points : 0
    • Joined: 2008/02/11 14:19:16
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/12/05 12:07:00 (permalink)
    +1 (1)
    No, I'm sorry but it won't work with 1.95. As for 2.0 It will not likely be out this week. Hopefully next week.
    #18
    JMH08
    Super Member
    • Total Posts : 440
    • Reward points : 0
    • Joined: 2008/02/11 14:19:16
    • Location: 0
    • Status: offline
    Re:Programming Device for Debugging Error 2013/12/13 09:41:10 (permalink)
    0
    rowlandwhiffin,
    I can send you the patch any time. Please let me know where you would like me to send it to. You can send me a private message if you'd rather not publicize your email.
     
    2.00 is still in testing so I can't say for sure when it will be released. We'd like to release by tomorrow but it all depends on testing. However, I can send you the patch now and you can apply it when 2.0 is available.
    #19
    Rowlandski
    #@>=11
    • Total Posts : 247
    • Reward points : 0
    • Joined: 2008/08/28 02:09:14
    • Location: UK - Herts
    • Status: offline
    Re:Programming Device for Debugging Error 2013/12/18 05:14:57 (permalink)
    0
    Hi JMH08,
     
    Any news on MPLABX ver 2?
    I'm working over xmas, any change I can have the patch ready for the release of MPLABX V2?
     
    Regards,
     
    Rowland
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5