-
Notifications
You must be signed in to change notification settings - Fork 95
[ST-Link - uvision5] generating uvoptx file #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I changed back to original state because I can't see where/how it is used. And the tests failed because of my first changes there. |
project_generator/tools/uvision.py
Outdated
| 'Utilities': { | ||
| 'Flash2': 'STLink\\ST-LINKIII-KEIL_SWO.dll', | ||
| }, | ||
| 'OptxFile' : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to organize this dictionary. Utilities is for uvproj file, thus shall be under uvproj and OptxFile should be under uvopt? Mixing two different file options within one dictionary might lead to confusion later. I had to search for usage of OptxFile to see if it's applied to uvproj or optx :-)
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean something like this?
'st-link': {
'uvproj' : {
'TargetDlls': {
'Driver': 'STLink\\ST-LINKIII-KEIL_SWO.dll',
},
'Utilities': {
'Flash2': 'STLink\\ST-LINKIII-KEIL_SWO.dll',
},
}
'uvopt' : { (or maybe better 'uvoptx' because it is used only for Keil uvoptx files)
'DebugOpt' : {
'nTsel' : '11',
'pMon': 'STLink\\ST-LINKIII-KEIL_SWO.dll',
},
'SetRegEntry' : {
'Key' : 'ST-LINKIII-KEIL_SWO',
},
},
}
uvoptx_dic['ProjectOpt']['Target']['TargetOption']['DebugOpt']['nTsel'] = self.definitions.debuggers[debugger_name]['uvopt']['DebugOpt']['nTsel']
uvoptx_dic['ProjectOpt']['Target']['TargetOption']['DebugOpt']['pMon'] = self.definitions.debuggers[debugger_name]['uvopt']['DebugOpt']['pMon']
uvoptx_dic['ProjectOpt']['Target']['TargetOption']['TargetDriverDllRegistry']['SetRegEntry']['Key'] = self.definitions.debuggers[debugger_name]['uvopt']['SetRegEntry']['Key']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. we use x prefix for uvision5, if this is common one, lets stay without x .
Yes, that was the idea, to provide dic per file, to know where goes what
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the possibility to check if it is a common one: I don't have Keil4.
For me the new principle looks logical. I was not very satisfied with my first proposal but didn't had a better idea.
|
Reference for files for uvision : http://www.keil.com/support/man/docs/uv4/uv4_b_filetypes.htm ,
We need to provide those, correct?
Looks like but we shall generate it and make sure it works with uvoptx. Thus my question is: what information from |
The method should return path + files. It's used externally to request where the project files are and what files were generated . For instance for one tool it could be /path/projectfiles and file.1, file.2, file.3 . An application could do further processing like open file.3 (path + file) and start a debug session. If this is not documented within Tool API, we should add it + wiki. Please create an issue if that's the case |
|
I just checked an ARCH_MAX (STM32F407 with CMSIS-DAP). There the optx file is not needed. So the best would be to generate it for all. The NUCLEO_F411RE was only a test for me - see what happens when a mcu doesn't provide the new, additional debugger options. |
|
Here is a minimal, manual minimised optx file:
The last option is debugger dependend. So we need debugger dependend options in the mcu yaml files. Maybe something like: |
|
+1 for providing the minimal set. The problem with this uvoptx is that to get this info: You need to open debugger settings, switch debugger and open the tab with trace, than the info gets polluted (WTF 😭 ). Anyway, the info above I shared is from Trace tab, the rest -F is about flash algo (we care about generic MCU stuff at the moment). That seems to me it matches the uvproj settings I see minimal uvoptx shall be generated ,but still trying to find out the minimal data we need. I would guess that only |
project_generator/tools/uvision.py
Outdated
| } | ||
|
|
||
| # use first debugger from Keil5 debugger selection combo box as default debugger | ||
| debuggers_default = 'ulink2-me' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wan't the default one cmsis-dap? also set in the dicts for uvproj above (=default template)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just used the first entry as default. Of course we can use cmsis-dap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets align template + this setting. if it was cmsis-dap, lets use that for now (that's default debugger also for progen def)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done.
|
I'll run some tests tomorrow, the changeset looks fine |
|
LGTM, will integrate soon |
please see issue #391
an additional PR with some definitions belongs to this: PR project-generator/project_generator_definitions#95
extension of mbed not necessary - no additional template necessary
I tested with mbed and exporting of NUCLEO_F446RE, NUCLEO_F446ZE, NUCLEO_F401RE, NUCLEO_F411RE and NRF51_DK