Page 1 of 1

Wiping old Code

Posted: Tue Feb 07, 2017 11:52 am
by Docara
Hi,

I'm messing around with an Ardiuno Uno - using both Xloader and FC to program it.

I've noticed if that part of some old code still runs after I've uploaded a new (shorter) file - is there a away to clear old the flash space

Thanks
MAtt

Re: Wiping old Code

Posted: Tue Feb 07, 2017 12:42 pm
by LeighM
Hi Matt,
That sounds like perhaps the device is not programming correctly, or your new program is not correctly written.
If your program is executing past it's end, then that is going to cause unpredictable results, whether the remaining flash space is erased or not.

Re: Wiping old Code

Posted: Tue Feb 07, 2017 1:31 pm
by Docara
Hi Leigh,

Thanks for the reply.

Solved - I have just realised that I had an unseen component (ADC Pot) on the dashboard from a deleted macro (and Component Macro)

To give you some feedback, I am using an LCD display with 5 buttons connected to an analogue line. I had assigned a variable for a Pot and used it in a macro to find out what values popped out when the buttons where pressed - all worked fine.

I deleted that macro without deleting the component and or variable, I accidentally left the declared ADC variable and the Pot dashboard panel component in place (both unused). I saved and uploaded some new code and found that when the buttons where pressed the LCD displayed garbage - pulled power, reopened project, tried different programmer (xloader) and even downloaded the 'proper' Arduino IDE to try to clear the Flash memory by burning a big program to the Arduino etc etc

Finally I found the left over Pot when I expanded the dash panel. It seems that the left over component, though not used with in the new code, had still been included and compiled in some form when the code was uploaded just by virtue of it 'being there'

Interestingly, I could not delete this left over component because it was still 'apparently' assigned to a Component Macro. I had to start completely from scratch - deleting the project to get things working properly again, I would imagine this highlights an issue for you guys??

Matt

Re: Wiping old Code

Posted: Tue Feb 07, 2017 3:21 pm
by medelec35
Hi Matt,
Docara wrote:Interestingly, I could not delete this left over component because it was still 'apparently' assigned to a Component Macro. I had to start completely from scratch - deleting the project to get things working properly again, I would imagine this highlights an issue for you guys??
If you have Project Explorer (View, Project Explorer) open, just select Components Icon from the top icons.
Right click on the component you wish to delete that's assigned to ADC component e.g.Pot_Color_Cap1:
Comp1.png
(8.05 KiB) Downloaded 2748 times
Select

Code: Select all

List Occurrences
.
Then all the places within flowchart where component macro has been added will be shown in a list.
All you do is double click on each listed item to show where its been added on the flowchart.


Martin

Re: Wiping old Code

Posted: Tue Feb 07, 2017 4:37 pm
by Docara
Thank you buddy