We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
anyone familiarize UV2 project should know there must be one *.Opt file for each project. who can tell me what's the function of this file? I guess Opt indicate "options", is it right? if it's right, then what kind of options? compile and link options?
"there must be one *.Opt file for each project." AFAIK, Only the .uv2 file is needed - it contains everything necessary to the Project You can lose the .opt file and still have all your Peoject settings. "who can tell me what's the function of this file?" Why not open it up & have a look?! The .opt contains things like what files were open, window positions, etc Remember that both the .uv2 and the .opt files should be considered "internal" to uVision - they are not there to be messed with by users! Hence the notice at the top of each file:
### uVision2 Project, (C) Keil Software ### Do not modify !
"You can lose the .opt file and still have all your Peoject settings." One "Project" setting that's in the .opt file and not the .uv2 is the Crystal Frequency. Note that this is used for information only, to allow the simulator to convert clock cycles to "real" times.
Why not open it up & have a look?! That's not as informative as you might hope. For example, you promptly run into cryptic lines like:
OPTFFF 1,1,4,0,0,0,0,0,<C:\Keil\C51\LIB\C51BL.LIB><C51BL.LIB> OPTFFF 1,2,2,0,0,0,0,0,<.\STARTUP.A51><STARTUP.A51> OPTFFF 1,3,1,385875968,0,0,0,0,<.\SysInfo.c><SysInfo.c> OPTFFF 1,4,1,0,0,0,0,0,<.\RootCmds.c><RootCmds.c> OPTFFF 1,5,1,0,0,0,0,0,<.\main.c><main.c>
"It is important to have a clean distinction between build information and individual, local IDE configuration for version control..." That is exactly how I came upon this! I was wondering why my projects kept defaulting back to 40MHz! :-( Having previously posted that the .opt was purely local IDE configuration (I might even have been told that by Keil), I thought I should add the update. "Also, when you version control your project, you typically will have read-only project files, and read-only files make uVision complain with a Yes/No modal dialog every time you change projects, which gets to be annoying." Indeed it does! I have complained here before about uVision's cavalier attitute when it comes to saving Project files. :-(
Since I am still using old version 3.x of uVision, I ran into this problem. I asked Keil/Arm. Unfortunately, I was told by the person who picked up my question that it is too old and he can't find information of it.
If you save this file in version control, it can be very annoying because every time you save a file in the IDE or do any configuration change and press the save button, this file will be changed - and most of the time the changes should be ignored.
By looking at the line details, you can tell the first 3 numbers are subdirectory, file id, type type.
There is one benefit of having the IDE generating this file - you can use it to verify if your IDE has all the configuration setup correct or not. So my practice is: I save this file in my version control. Every time I commit changes, I do a quick scan to see if everything is correct. However, I do not modify this file. If anything is wrong, I go back to the IDE to fix it.