How do I undo changes in the Clocks configuration tool?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I undo changes in the Clocks configuration tool?

Jump to solution
2,514 Views
Grandfather
Contributor II

To discover configuration limits for some clock parameters I fiddled with various settings in the Clocks configuration tool. Now I'd like to revert the changes and clear the "Update Code" state. How do I do that?

1 Solution
2,416 Views
Petr_H
NXP Employee
NXP Employee

Hi,

I have reproduced the problem with the icon not changing back to grey when there are no changes after the undo command and will report it to the developers and we'll try to fix it in the next releases. Thank you for reporting it.

Please note that the configuration is not written to the disk after every change, only when you do File > Save or you config the Update code dialog. I strongly recommend to not rely on undo feature but save the configuration or confirm the update code to save the changes to disk, when you have it in the state you would like to keep or revert to. The undo feature has limited history (by default 10 steps) and is lost when you close the tool.

If you have the files with content corresponding to the state you would like to return to, it's possible to revert to this state by using File > Import and then select MCUXpresso Config Tools / Import Configuration (if you have the saved configuration in the .mex file) or Import Source (if you have only the previously generated source file containing YAML comments block).

If you are using config tools integrated in MCUXpresso IDE, it's also possible to get the previously overwritten versions of files by using Local history feature. It's accessible from context menu of each file.

Best regards
Petr Hradsky
Config Tools Team

View solution in original post

8 Replies
1,936 Views
danielholala
Senior Contributor II

Hi @Grandfather ,

Thank you for your report. Your observation is true for all Config Tools, i.e., also for Peripheral Tool and Pins Tool. These tools provide no easy means to discard all pending changes and reload the "*.mex" file. I wonder why NXP forgot to implement this function.

In any of the Config Tools, I'm using the following workaround to discard all pending changes and reload the "*.mex" file:

As a prerequisite, you need to have a second project open.
Then, if you want to discard all changes, you simply switch to the second project using the project drop down menu in the toolbar:

danielholala_0-1668672627438.png

This will trigger a window asking whether you would like to save your current configuration of the first project.
Press "No" button.
This will load the "*.mex" file of the second project. 
Now use the drop down menu to select your first project again.
This will load the "*.mex" file of the first project. 
The "Update Code" icon should be in grey color now (except if the *.mex file had been created by an older version of the Config Tool).

Hope that helps.

0 Kudos
2,455 Views
Grandfather
Contributor II

I tried the undo, but the "Update Code" flag doesn't seem to reset at any point so it wasn't clear that I'd undone back to my starting state.

0 Kudos
2,447 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi 

I tested "undo" and "update code" on my side. but didn't find problem. see attached video. I tested CLKOUTDIV setting.

Best Regards

Jun Zhang

 

0 Kudos
2,439 Views
Grandfather
Contributor II

Your video shows the issue. At the 5 second mark you make a change and the "Update Code" button goes green. At 12 seconds you click undo and the /2 value changes back to /1, but the "Update Code" button remains green. This is the issue.

The issue that prompted me to post this topic was that I had been working in a project for some time and had used the clock configuration tool multiple times - there was significant history. While I was working in the code someone asked me a question about the clock configuration so I opened the tool and we made numerous changes to test an idea we were playing with unrelated to the code I was actually working on. When we had finished playing I found I couldn't identify the state of the clock system before I opened the tool - at no point during undo/redo did the "Update Code" button reset.

I couldn't simply revert the .mex file to the last committed revision because I had made changes since that commit I wanted to keep. I had no way to be confident of restoring the clock configuration to the state before we tried the experiment.

0 Kudos
2,417 Views
Petr_H
NXP Employee
NXP Employee

Hi,

I have reproduced the problem with the icon not changing back to grey when there are no changes after the undo command and will report it to the developers and we'll try to fix it in the next releases. Thank you for reporting it.

Please note that the configuration is not written to the disk after every change, only when you do File > Save or you config the Update code dialog. I strongly recommend to not rely on undo feature but save the configuration or confirm the update code to save the changes to disk, when you have it in the state you would like to keep or revert to. The undo feature has limited history (by default 10 steps) and is lost when you close the tool.

If you have the files with content corresponding to the state you would like to return to, it's possible to revert to this state by using File > Import and then select MCUXpresso Config Tools / Import Configuration (if you have the saved configuration in the .mex file) or Import Source (if you have only the previously generated source file containing YAML comments block).

If you are using config tools integrated in MCUXpresso IDE, it's also possible to get the previously overwritten versions of files by using Local history feature. It's accessible from context menu of each file.

Best regards
Petr Hradsky
Config Tools Team

1,972 Views
danielholala
Senior Contributor II

Dear @Petr_H ,

On the topic of undoing changes in one of the configurations tools: 

How do I return to the previous configuration after changing the configuration in one of the configuration tools but before updating the code (or File > Save as)? Can I just close the project and reopen it?

Thanks.

 

0 Kudos
2,434 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @Petr_H 

Could you please help to confirm if this could be fixed?

Thanks,

Jun Zhang

0 Kudos
2,507 Views
Petr_H
NXP Employee
NXP Employee

Hi,

If you haven't closed the application yet, you can use the Edit > Undo command that reverts the configuration to the state before the last change. However, please note that there is some limit of previous states that are stored (by default it's 10).

If you have already used the Update Code command and confirmed overwriting the files on the disk, you need to restore the configuration to the previous state (either by using the undo command or by changing it manually) and then use the Update Code command again to write the files to the disk. 

If you'd like to discard all your changes and revert to the after-reset state of the processor or default board preset, you can also use the commands Clocks > Reset to board defaults / Reset to Processor defaults.

Regards

Petr Hradsky

Config Tools Team

0 Kudos