I would like to regularly switch between OpenOCD and Segger J-Link in one project. Whenever I e.g. switch from OpenOCD to Segger J-Link and then back all the OpenOCD setup is erased and set to default. Is there any way to keep the OpenOCD setup after switching to Segger J-Link and back?
The easiest would be to create a copy of your configuration and configure different debugging settings there. Then you can simply switch between the Debug and Debug_JLink configurations in Visual Studio. You can modify the second configuration to have the same output folder name as the first one – then you will avoid the necessity to build everything twice.
Thanks, works perfectly. I would just note for others that it is configuration in VisualGDB not in VS2015 Configuration Manager that should be changed. I started by adding configuration in Configuration Manager and ended with a mess 🙂
I see that Embedded Frameworks settings such as “Board type” is the same for all configurations. I cannot have custom board for one configuration and PCA10028 for another configuration. Can you confirm that?
Yes, the global settings like board type are managed per-project. However they are just convenient shortcuts for things stored in nrf5x.mak and debug.mak/release.mak, so you can simply take the -DPCAxxxx setting from nrf5x.mak and put it into per-configuration .mak files modifying each one individually. The only pitfall is that editing global settings in the GUI will regenerate the global .mak file.
The main reason why MCU settings are global for the project is because they define which sources from the SDK are put into the project. If we wanted to make it per-configuration, we would have to combine those lists from different configurations and exclude some of the files from some configurations, making the entire process significantly more complicated. So we decided to make the MCU-specific settings global and the usual settings like extra include paths per-configuration.