• AVR Freaks

Helpful ReplyHot!Failed while sending cmd_SET_PERIPHERAL_FREEZE

Page: 123 > Showing page 1 of 3
Author
kgyuri
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2011/12/17 05:16:04
  • Location: Hungary
  • Status: offline
2013/08/11 05:34:24 (permalink)
0

Failed while sending cmd_SET_PERIPHERAL_FREEZE

Hi All!
MPLAB X (or REAL ICE) will drives me mad...
I have to freeze the timers while the program stops in debug.
When I try to step, or run to next breakpoint in debug mode, I always get the next error message:
"An Error occurred while running
Failed while sending cmd_SET_PERIPHERAL_FREEZE command"

I use dsPIC33EP256GP506,   MPLAB X v1.85,   Win 7   REAL ICE with only 12 cm data cable.
The phenomenon occours very often. On other PC too, with other USB port, or with other USB cable too.
Downloading the program to the PIC OK, read from PIC OK, but the communication in debug mode is very unstable. 
Thanks in advance for any idea!

Gyuri  
#1
Ran.CohenTawil
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2013/07/28 03:05:00
  • Location: 0
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/11 22:48:35 (permalink)
0

I have to freeze the timers while the program stops in debug.

 
in project properties (right click project):
Under configuration choose Real ICE
In the Option categories choose "Freeze Peripherals"
Select what peripherals you would like to freeze on break
 
Failed while sending cmd_SET_PERIPHERAL_FREEZE command

 
Not much information on that besides this post:
 
http://www.microchip.com/forums/m707793.aspx
 
seems like a problem whith freezing the peripherals when breaking the program, i would try to play with the "Freeze Peripherals" option, perhaps disabling all only to see if that solves the problem. seems like some sort of bug, do you have the latest version of MPLABX?
 
 
#2
kgyuri
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2011/12/17 05:16:04
  • Location: Hungary
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/12 09:16:47 (permalink)
0
Yes, I use the MPLAB X v1.85. This is the last version.  
Of course I know, how to set the "Freeze Peripherals". :)
I already played with this option. I checked in the peripherials I wanted to freeze, and later I checked all of them.
Nothing changed, the problem, and the error message occured as often as before.
Now I checked off all freeze of peripherials. After a few run-stop, and single step, the USB communication has been broken.
Amazing:
The Finish Debug, Reset, Continue buttons are active, but only the Finish Debug button works.The output window shows: "Running"But, the
"Setting software breakpoints......." and
"Setting software breakpoints complete." messages are missing.
The breakpoints became "Broken breakpoint". 

So, as it seems, it is a general USB communication problem in Debug mode. As the next:

Failed sending data on endpoint 2 (requested 2, sent 0)Connection Failed.If the problem persists, please disconnect and reconnect the REAL ICE to the USB cable.If this does not fix the problem verify that the proper MPLAB X USB drivers have been installed.

The drivers has to be good, installed with the MPLAB X, few hours before.I used the Driver switcher apparently. 
Except on MPLAB X/REAL ICE, I have nothing problem with my other USB devices.
As it seems, the debug communication is a critical part of the IDE.
Maybe the MPLAB X v8.xx will have been more reliable...

Yes, I have read that thread, and checked my config bits settings, but these are seems to be correct.
// DSPIC33EP256GP506 Configuration Bit Settings
#include <xc.h>

// FICD#pragma config ICS = PGD1               // ICD Communication Channel Select bits (Communicate on PGEC1 and PGED1)#pragma config JTAGEN = OFF             // JTAG Enable bit (JTAG is disabled)

// FPOR#pragma config ALTI2C1 = OFF            // Alternate I2C1 pins (I2C1 mapped to SDA1/SCL1 pins)#pragma config ALTI2C2 = OFF            // Alternate I2C2 pins (I2C2 mapped to SDA2/SCL2 pins)#pragma config WDTWIN = WIN25           // Watchdog Window Select bits (WDT Window is 25% of WDT period)

// FWDT#pragma config WDTPOST = PS32768        // Watchdog Timer Postscaler bits (1:32,768)#pragma config WDTPRE = PR128           // Watchdog Timer Prescaler bit (1:128)#pragma config PLLKEN = ON              // PLL Lock Enable bit (Clock switch to PLL source will wait until the PLL lock signal is valid.)#pragma config WINDIS = OFF             // Watchdog Timer Window Enable bit (Watchdog Timer in Non-Window mode)#pragma config FWDTEN = ON              // Watchdog Timer Enable bit (Watchdog timer always enabled)

// FOSC#pragma config POSCMD = NONE            // Primary Oscillator Mode Select bits (Primary Oscillator disabled)#pragma config OSCIOFNC = OFF           // OSC2 Pin Function bit (OSC2 is clock output)#pragma config IOL1WAY = ON             // Peripheral pin select configuration (Allow only one reconfiguration)#pragma config FCKSM = CSDCMD           // Clock Switching Mode bits (Both Clock switching and Fail-safe Clock Monitor are disabled)

// FOSCSEL#pragma config FNOSC = FRCDIVN          // Oscillator Source Selection (Internal Fast RC (FRC) Oscillator with postscaler)#pragma config IESO = ON                // Two-speed Oscillator Start-up Enable bit (Start up device with FRC, then switch to user-selected oscillator source)

// FGS#pragma config GWRP = OFF               // General Segment Write-Protect bit (General Segment may be written)#pragma config GCP = OFF                // General Segment Code-Protect bit (General Segment Code protect is Disabled)

:(
#3
kgyuri
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2011/12/17 05:16:04
  • Location: Hungary
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/12 12:44:51 (permalink)
+2 (2)
All of freeze checkboxes are unchacked, but the issue still attacks.
An Error occurred while runningFailed while sending cmd_SET_PERIPHERAL_FREEZE command

The USB connection is the weakest link of the MPLAB X - REAL ICE duo. In one moment works well, in the other fails. Why? Just because. 
The time lapse, the deadline nears, but I can't do my work. Instead, I have to fight with the development tools itself.
I have tried several USB cables, (two of them is "original Microchip") but the issues are independent from the cable. 
 
There have to be a few massive software bugs in the MPLAB X and/or REAL ICE programs.

We are complaining day by day, year by year, but nothing happens.see: http://www.microchip.com/...3&high=MPLAB+X+USB
There is no one smart programmer in the Microchip team, who could solve the problem.
There is nothing to do... We have to wait for the next, and next, and next versions.Maybe the v8.xx will more reliable. Maybe not.
 
#4
kgyuri
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2011/12/17 05:16:04
  • Location: Hungary
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/13 11:46:41 (permalink)
0
Me again. :)
I tried simple USB cables without ferrite bead untill now .
But now I found a big ferrite ring, and I threaded three times the cable thru the ferrite.
I experience, the communication definitely better.  Not perfect, but more acceptable.
 
My questions is:
Doesn't MPLAB X and/or REAL ICE checks (apparently) the integrity of received data frame?
If some noise disturbs the transferred data, the receiver performs the erroneous command, and apply the erroneous data?
Can lead an erroneous byte to the crash of the whole debug process? It would be interesting... 
#5
andersm
Super Member
  • Total Posts : 2741
  • Reward points : 0
  • Joined: 2012/10/07 14:57:44
  • Location: 0
  • Status: online
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/13 13:13:35 (permalink)
+1 (1)
Error checking is built into USB.
#6
kgyuri
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2011/12/17 05:16:04
  • Location: Hungary
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/13 13:48:58 (permalink)
0
Maybe. I don"t know the USB protocol itself,  but in this case how can a transfer error causes so big crash?
Why doesn't ignore the IDE and /or REAL ICE the erroneous message, and why doesn"t ask a repeated message?
 
TNKernel-PIC32, an open-source real-time kernel for the PIC32  It is about PIC32 kernel, but I have problem with a dsPIC33EP.

Moreover, I have to notice, in my application, no SMPS, no running motor,  no any serious noise source when the issue occurs.
Anyhow. I worked for many years with Silicon Labs controllers, and SiLabs and Keil IDE.  These kind of pronlems was absolutely unfamiliar for me. 
It is a Microchip tradition. The controllers are good, but the dev tools are inappropriate for efficient work.
#7
andersm
Super Member
  • Total Posts : 2741
  • Reward points : 0
  • Joined: 2012/10/07 14:57:44
  • Location: 0
  • Status: online
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/13 14:18:23 (permalink)
+2 (2)
kgyuriMaybe. I don"t know the USB protocol itself,  but in this case how can a transfer error causes so big crash?
Why doesn't ignore the IDE and /or REAL ICE the erroneous message, and why doesn"t ask a repeated message?

If there are a lot of transmission errors, is it meaningful to keep trying, possibly forever?
 
TNKernel-PIC32, an open-source real-time kernel for the PIC32  It is about PIC32 kernel, but I have problem with a dsPIC33EP.

The bit below the line is called a signature. It is automatically appended to every post.
#8
kgyuri
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2011/12/17 05:16:04
  • Location: Hungary
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/13 23:04:36 (permalink)
0

Ok, Andersm, I failed to notice Your signature. :)

Lot or few transmission errors, I dont know.To trying once or twice would be resonable. Forewer not of course.
I haven't got so many time.

But the questions are standing: 
Why not use the MPLAB X / REAL ICE more reliable error checking in the debug communication?
The program (165 kB) download and read are always successful. (!)Only the short debug communications are so unreliable. Why?
There is no serious noise source in my project and in my environment.The layout of PCB is good. Part placement, ground and power nets are correct.(I have designed more than 200 PCBs till now, at about third part with microcontrollers.) 
In my opinion, there have to be some problem in the debug communication. 
#9
JMH08
Super Member
  • Total Posts : 440
  • Reward points : 0
  • Joined: 2008/02/11 14:19:16
  • Location: 0
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/23 14:14:49 (permalink)
0
Kgyuri,
We have seen this problem before but as of yet, have been unable to reliably reproduce it. I will try your device and configuration bits combination and see if I can reproduce it.
#10
JMH08
Super Member
  • Total Posts : 440
  • Reward points : 0
  • Joined: 2008/02/11 14:19:16
  • Location: 0
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/26 12:28:48 (permalink)
0
I have not been able to reproduce the problem yet. Is there any chance you can provide some sample code that exhibits the problem?
#11
kgyuri
Starting Member
  • Total Posts : 43
  • Reward points : 0
  • Joined: 2011/12/17 05:16:04
  • Location: Hungary
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/08/28 08:59:38 (permalink)
0

JMH08,
I beg Your pardon, but I didn't look the forum in the last time.

My config bits were:
_FGS(GCP_OFF // Code Protect disabled   
 &GWRP_OFF) // Write Protect disabled  
         
_FOSCSEL(FNOSC_PRIPLL
 &IESO_OFF) // Start up with user-selected oscillator source

_FOSC(FCKSM_CSDCMD // Both Clock switching and Fail-safe Clock Monitor are disabled     
&OSCIOFNC_OFF // OSC2 is clock output     
&POSCMD_HS) // HS Crystal Oscillator Mode (Xtal 11,059Mc)

_FWDT(FWDTEN_ON // WDT enabled     
&WINDIS_OFF // WDT in non windowed mode      
&WDTPRE_PR128 //     
&WDTPOST_PS32768) //

_FICD(JTAGEN_OFF
&ICS_PGD1) // 

Since my last message I tested the MPLAB X with another REAL ICE, and an ICD3, but both of them produced the error.
(These debuggers are using perfectly with an other PC)
After that, I got a third REAL ICE, and miracle of miracles, it is working perfectly.
I worked with this till now, with very few problems.Now I put back the original REAL ICE, and it is working well also. 
(The MPLAB X is the same installation from the beginning of problem.)

At this moment, I can not reproduce the issue. 
I wouldn't like to attach the source code, it is more than 13 000 lines.(with blank lines and comments of course.)
#12
JMH08
Super Member
  • Total Posts : 440
  • Reward points : 0
  • Joined: 2008/02/11 14:19:16
  • Location: 0
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/09/04 16:12:02 (permalink)
0
Yeah, this is the same problem we are having. Whatever is causing this error is very finicky and we can't reliably reproduce it so we can't solve it.
#13
Rowlandski
#@>=11
  • Total Posts : 247
  • Reward points : 0
  • Joined: 2008/08/28 02:09:14
  • Location: UK - Herts
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2013/10/22 05:40:39 (permalink)
0
Hi,
 
I have this problem and I can repeat it....I actually have two PC's, two REAL ICEs.....
 
Regards,
 
Rowland
#14
EmbeddedDoctor
Starting Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2013/12/15 17:48:04
  • Location: 0
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2014/01/14 12:05:35 (permalink)
0
Occasionally, I have the same problem while using ICD3 on a dsPIC33EP512GM304.  I have the ICD3 connected to a simple demonstration board.  It runs of a simple 12V power adapter via a 3.3 V regulator.  The circuit has 100 ohm resistors on an 8 inch programming cable for damping.  (At design time, I was more concerned about an EMI or incorrect cable insertion than this noise issue.)
 
The only good news is that if I ignore the error, then everything carries on as normal.
 
Did anyone ever find a good solution for this problem?
#15
MFLET
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2014/02/05 08:21:30
  • Location: UK
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2014/02/20 07:22:59 (permalink)
0
Hi all,
 
I'm having the same problems, at least every other time I program/debug using a Real ICE with MPLABX V2.00, dsPIC33EP512GM306
 
Also fairly common to see the error "Connection Failed. If the problem persists, please disconnect and reconnect the REAL ICE to the USB cable. If this does not fix the problem verify that the proper MPLAB X USB drivers have been installed." - resolved only by unplugging Real ICE & occasionally restarting MPLAB.
 
I've used 10K MCLR' resistors with dsPIC33F's for years, tried reducing to 4.7K here with few benefits.
 
I realised I was using a USB extension, now going straight in, no benefit.
 
I do suspect it's noise related. If I remove a greedy radar module program success rate improves - though by no means enough to say "solved".
 
Keep on truckin'. Hurray.
 
M
 
#16
JMH08
Super Member
  • Total Posts : 440
  • Reward points : 0
  • Joined: 2008/02/11 14:19:16
  • Location: 0
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2014/02/28 13:22:58 (permalink)
0
We are definitely aware of, and investigating this problem. It seems to be most pronounced with 16-bit devices (pic24s and dsPIC33S). Our best guess right now is that it has something to do with our FPGA firmware code. It very rarely happens for us so it has been very difficult to track down but we are working on it. Sorry for the inconvenience. We will update the forum with any new developments.
#17
EFC
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2014/05/14 07:49:27
  • Location: 0
  • Status: offline
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2014/05/14 07:56:41 (permalink)
0
Similar problem, on-and-off, with dsPIC33 and ICD3.
Any progress?
#18
Guest
Super Member
  • Total Posts : 80500
  • Reward points : 0
  • Joined: 2003/01/01 00:00:00
  • Location: 0
  • Status: online
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2014/05/21 01:58:23 (permalink)
0
I can trigger the error by switching from POSCMOD_XT & FNOSC_PRI (I have a 20Mhz xtal) to POSCMOD_XT & FNOSC_PRIPLL & PLLDIV_DIV2 in my PIC config.
 
With the internal clock or 20Mhz xtal without PLLDIV it works every time but as soon as I double the frequency with the PLL I get this error.
 
I'm using PICKit3.
 
BR
Martin
#19
Guest
Super Member
  • Total Posts : 80500
  • Reward points : 0
  • Joined: 2003/01/01 00:00:00
  • Location: 0
  • Status: online
Re:Failed while sending cmd_SET_PERIPHERAL_FREEZE 2014/05/21 02:03:53 (permalink) ☄ Helpfulby yeyepig101 2014/09/23 08:25:42
0
Guest
I can trigger the error by switching from POSCMOD_XT & FNOSC_PRI (I have a 20Mhz xtal) to POSCMOD_XT & FNOSC_PRIPLL & PLLDIV_DIV2 in my PIC config.
 
With the internal clock or 20Mhz xtal without PLLDIV it works every time but as soon as I double the frequency with the PLL I get this error.
 
I'm using PICKit3.
 
BR
Martin


I'm using a PIC24Fj256GB110.
#20
Page: 123 > Showing page 1 of 3
Jump to:
© 2020 APG vNext Commercial Version 4.5