Watch variables not working in ICD

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Watch variables not working in ICD

Post by stewartbaker »

Hi,
Although I have managed to successfully connect FlowKit to my development and am able to step through a number of Flowcode programs,
I seem to have an issue with variables in the Watch window.

Changes in variable values are not reported in the Watch window neither do changes made in the WW appear to make any difference when running programs in the ICD mode.

I have tried very simple programs from flashing and LED to just changing a variable value, nothing changes...Everything else breakpoints etc seem to work OK.

I am running FlowCode V5.2 with the latest FlowKit drivers. The device is a 16F877A with a 4MHz crystal. Apart from LED's on PortC
nothing else is connected.

This is pretty basic stuff for ICD, and I would like to get to the bottom of the problem...

regards
Stewart

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Watch variables not working in ICD

Post by medelec35 »

Hi Stewart,
I believe there is an issue with arrays and strings only.
This has been is fixed when update 5.3 is released.
If your having issues with normal byte or int values, then it may be helpful if you can post your flowchart for someone to investigate

Martin
Martin

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

Hi Martin.
Thanks for your reply.

I saw the posts about there being a problem with strings in V5.2, so I only tried byte and bool.

I have attached one of my FlowCode programs with ICD watch window problems.
16F877A_LED_Flash.fcf
(8 KiB) Downloaded 350 times
Cheers
Stewart

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Watch variables not working in ICD

Post by medelec35 »

Hi Stewart,
Did you add variable to be watch 1st e.g
If you press F8 key so it starts in single step mode.
Then right click in variable window, and select add variable.
Jut like normal windows explorer menu, you can click top variable (if multiple variables), hold shift, then click bottom variable.
Or you can just select variable your interested in.
Select OK

Now just single step by keep pressing F8. or you can slow simulation down to observe values.

You may have already done this, but no variables were added to the variable window on flowchart you posted.
You can tell by looking at variable window when press F8. If it shows:
'Right-click to add a...' then no variables has been added.

ICD is working ok for me with EB006 programmer so it should work with flowkit just fine, I will test with flowkit on sat.

Martin
Martin

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

Hi Martin,
My problem is not with adding (or seeing) variables in the watch window.

When I am in the simulation mode I can add variables, see their values changing with the program, and also change
them manually

In ICD I can similarly add variables to the watch window, however their values do NOT change with the program,
and although I can change them in the box, it makes NO difference in the program being debugged.

I cannot understand why this is happening as the ICD is correctly stepping through the program (green box).

It is just this (important) bit that is not working. Hope V5.3 provides the answer...

regards
Stewart

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Watch variables not working in ICD

Post by medelec35 »

Hi Stewart,
That does appear to be a problem localised to your set-up.
ICD is working with Flowcode V5.2 via flowkit on my PC.
Variable in watch window are updated OK with correct value.
ICD var.png
(81.06 KiB) Downloaded 3300 times
Not sure why it's not working for you?
Only difference between mine and your flowchart is im using 19.66MHz xtal so changed configuration to suit.

Perhaps you you try running 5.2 flowcode install file, select uninstall when option is shown, then reinstall.

Just so others things are covered , if you do help and about flowcode, what type and version have you got?
Martin

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Watch variables not working in ICD

Post by DavidA »

Hello,

We are hoping to have 5.3 out by the middle of this week, so if you can hold on till the release of that, then try some of the updated ICD code, which may solve your problem, if not we can revisit the issue!

Thanks

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

Hi Martin,
Many thanks for your help. I think that there must be something different with my setup.

I tried using a 20MHz crystal to get close to what you are running, however the problem remains.

Rather than do a re-install, as the release of V5.3 is close I will wait for that as it addresses some ICD
issues. With any luck it will sort out this problem.

regards
Stewart

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

HI,
I was looking forward to the release of V5.3 to help me "bottom out" the problem, and be able to use my FlowKit as intended.

As the release has been delayed, please advise what I might try in the meantime. I do not intend to reinstall FlowCode...

Best regards
Stewart

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: Watch variables not working in ICD

Post by DavidA »

Hello Stewart,

Yes unfortuantely due to an internal issue found in the 5.3 release we had to push it back slightly, a 5.4 has been created and is undergoing internal testing at the moment, we hope to have this version out shortly, apologies for any inconvenience.

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

Hello David,
Thank you for your prompt response.

Will V5.4 allow me to change and see program changes to Watched variables in ICD using FlowKit ?

Best regards
Stewart

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

I was hoping to get to the bottom of this basic problem "soon". Obviously I was mistaken...

Stewart

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Watch variables not working in ICD

Post by JonnyW »

Hello.
Will V5.4 allow me to change and see program changes to Watched variables in ICD using FlowKit ?
Yes, you should be able to watch and edit all globals. In 5.2 this should still work, just not for array variables.

Jonny

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

JonnyW wrote:Hello.
Will V5.4 allow me to change and see program changes to Watched variables in ICD using FlowKit ?
Yes, you should be able to watch and edit all globals. In 5.2 this should still work, just not for array variables.

Jonny
Hello

Unfortunately, as I have reported in my previous posts - I can not...

So what next ?

Stewart

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Watch variables not working in ICD

Post by JonnyW »

Hello. This is an odd problem - have you changed your compiler settings at all?

I can only guess that some information in the COFF file - the data file containing the location of each variable - is not being generated correctly or is missing. I don't see why else just this information should be failing.

When you say the information is not displayed or read back, does it always show zero for the watch values, or is it a corrupt (random) value? if zero try writing a program where the global variable is initialised (in the variable setup) to a non-zero value and see if this makes a difference. If its a random number does this change when the chip is reset, when you recompile or never?

I am not a HW engineer so can't suggest any HW reasons why this must be failing, I'm afraid, but if its a SW issue then perhaps we can find what it is. As Martin says, this seems to be localised to your PC so perhaps is a driver issue, but I would then expect nothing to work, not just the variables, which use pretty much the same mechanism of communications as everything else.

Jonny

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

>Hello. This is an odd problem - have you changed your compiler settings at all?

I don't know how or why would I change those ?

>I can only guess that some information in the COFF file - the data file containing the location of each variable - is not being >generated correctly or is missing. I don't see why else just this information should be failing.

How do I find if a COFF file is being generated, and if it is correct ?

>When you say the information is not displayed or read back, does it always show zero for the watch values, or is it a corrupt >(random) value? if zero try writing a program where the global variable is initialised (in the variable setup) to a non-zero value and >see if this makes a difference. If its a random number does this change when the chip is reset, when you recompile or never?

The value is zero unless I change it, whereupon it stays at the new value. A program statement does not change the Watched variable i.e if I assign a value in the program it is not shown in the Watched variable. Likewise a change made to a Watched variable is not reflected in the program operation.

>I am not a HW engineer so can't suggest any HW reasons why this must be failing, I'm afraid, but if its a SW issue then perhaps we >can find what it is. As Martin says, this seems to be localised to your PC so perhaps is a driver issue, but I would then expect >nothing to work, not just the variables, which use pretty much the same mechanism of communications as everything else.

I don't think that this is a H/W problem.
In all other respects the PicKit ICD works as expected. It steps into and bypasses code, it responds to breakpoints.
As you say if it were a driver issue then I would expect nothing to work.

There is something very basic in Flowcode S/W- not working ....

Cheers
Stewart

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

A .cof file is being generated by the compiler, but Flowcode/Flowkit doesn't seem to recognise it...

Stewart

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Watch variables not working in ICD

Post by JonnyW »

Hello.

I do not have Flowkit at home and will not have access until Tuesday, but it may be that you will need to zip up all intermediate files generated by Flowcode and we can compare them with what is generated here.

What do you mean it is not recognised? Flowcode should not be able to load this in, but will load the file in the background when ICD is run. When I get access to Flowkit I can have a look in debug builds as to what is going on behind the scenes with your files and perhaps we can find the issue.

Jonny

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

JonnyW wrote:Hello.

I do not have Flowkit at home and will not have access until Tuesday, but it may be that you will need to zip up all intermediate files generated by Flowcode and we can compare them with what is generated here.
Jonny
Hello Jonny,
Thanks for your kind offer. I can certainly zip all the files generated and post them for comparison.
Do you need the ones that have my licence key information in the header e.g. *.msg.text ?
If so I will remove sensitive information before sending them.

B.T.W. what is the purpose of including a licence key in an assembler file header ?
JonnyW wrote: What do you mean it is not recognised? Flowcode should not be able to load this in, but will load the file in the background when ICD is run. When I get access to Flowkit I can have a look in debug builds as to what is going on behind the scenes with your files and perhaps we can find the issue.

Jonny
Sorry, applied the wrong terminology. Maybe "use" would have been better.

Best regards
Stewart

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Watch variables not working in ICD

Post by JonnyW »

Hello. No probs, its better to get to the root of problems like this. Just be aware that with different PCs, different setups, HW, etc there is a lot that can go wrong, so it is difficult to debug, but we'll do what we can. The most important thing is for us to be able to replicate the issue in the lab, otherwise it is very difficult to find the problem.
B.T.W. what is the purpose of including a licence key in an assembler file header ?
There is no sensitive information here - only part of the licence is given (similar to the last digits on a credit card being added to receipts). It helps organise and identify different builds when we are looking into issues and also is a security thing to help deter piracy. It can also help teachers who have to look at many students files identify what copy of Flowcode they are using.

Jonny

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

Hello Jonny,
Thank you for your explanation regarding the licence key. It now makes sense...

I have attached 2 zip files of the same LED flashing program. One with ICD and the other without.

I have verified this morning that the problem still exists with Watch Variables in ICD.

My hardware is very straightforward - only +5V and GND the standard ICD pins and an LED on PORTC.0 connected to the PIC.

If you are able to run these files OK with Flowcode V5.2, is it possible that the Firmware in the FlowKit MCU is suspect ?

Cheers
Stewart
16F877A_LED_Flash.zip
Without ICD
(74.18 KiB) Downloaded 215 times
16F877A_LED_Flash_ICD.zip
With ICD switched on
(134.18 KiB) Downloaded 209 times

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Watch variables not working in ICD

Post by JonnyW »

Hello there.

I have tested your program on the ICD - it seems to be working OK here. I have also compared the COFF files - aside from minor differences I would expect I cant see any differences in the generated programs between yours and what is generated here.

I tested on the EB006 with a 4MHz crystal and both the built-in ICD and Flowkit.

It is probably a daft question but are you only updating the variables when simulation is paused? ICD will not update the system when it is not.

I admit I am at a bit of a loss as to what the problem may be. ICD will report errors if it fails at any point so it does believe it is working OK. Perhaps your Flowkit has an issue? Is there any alternate HW you can test this with?

Jonny

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

Hello Jonny,
Many thanks for trying the files I sent. At least we know that my Flowcode has no problem generating the correct data.
JonnyW wrote:Hello there.
It is probably a daft question but are you only updating the variables when simulation is paused? ICD will not update the system when it is not.
Jonny
The variables are not updated when the simulation is paused or when the program is stepped into or over (F8,F8+Shift)
JonnyW wrote: I admit I am at a bit of a loss as to what the problem may be. ICD will report errors if it fails at any point so it does believe it is working OK. Perhaps your Flowkit has an issue? Is there any alternate HW you can test this with?
Jonny
If Flowkit did not connect or allow me to step through the program then I would be suspicious of my H/W. However as my H/W setup is very simple, I am beginning to think that there is an issue with Flowkit in it's retrieval/changing of ICD data to Flowcode.

Are there any tests that can be carried out to prove that data can be passed to and from Flowkit ?

Cheers
Stewart

stewartbaker
Posts: 116
Joined: Tue Jul 17, 2012 9:34 am
Been thanked: 18 times
Contact:

Re: Watch variables not working in ICD

Post by stewartbaker »

I have now tried the program with different H/W a 18F4620 instead of a 16F877A - same result.

Also tried under V5.4 - same result.

regards
Stewart

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Watch variables not working in ICD

Post by JonnyW »

Hello.

There must be something subtle between Flowkit and the HW. Just to clarify, it is a custom PCB you are using?

Have you tried running this in safe mode? We could do with finding out about the spec of your system - it has been mentioned that in the past anti-virus have caused problems. Also Flowkit uses USB2, are you using USB2 ports?

With the default settings Flowkit uses port B. We would expect ICD to fail outright if there were any issues but have you got a fully working and unobstructed port B?

You could try increasing the communication speed in the ICD settings to 1000 - this is a timeout that ICD will wait for a response for requests.

Also, going back to the values of the variables:
  • On start up the variables are always zero. Is this true for pre-initialised (to a non-zero value) variables too?
  • If you stop simulation and restart it do the variables retain their previous values or do they get reset to zero again?
  • Can you add a string variable - pre-initialised - and see the values of the string?
Thanks for any information,

Jonny

Post Reply