Frequently Asked Questions
Q1: How can I switch between toolchains in NECTO Studio and log the active toolchain?
In NECTO Studio, you can switch between different toolchains (like GCC or mikroC AI) and log the currently active toolchain using the built-in logger. The example below shows how to configure logging, detect the active toolchain, and print the corresponding message every second:
/**
* @file toolchain_switch.c
* @brief Toolchain Switch Example for NECTO Studio
*
* This example demonstrates switching between different toolchains
* (GCC and mikroC AI) in NECTO Studio. The code logs the active toolchain
* using the logger module, printing the message every second.
*
* @author MIKROE
* @date 2025
*/
#ifdef PREINIT_SUPPORTED
#include "preinit.h" // Include pre-initialization if supported
#endif
// ------------------------------------------------------------------- INCLUDES
#include "log.h" // Logger library
#include <stdio.h> // Standard I/O functions
#include <string.h> // String manipulation functions
// ------------------------------------------------------------------ VARIABLES
static log_t logger; // Logger object declaration
// ------------------------------------------------------ APPLICATION FUNCTIONS
int main(void)
{
log_cfg_t log_cfg; /**< Logger configuration object */
/**
* Logger initialization.
* - Maps UART for logging.
* - Sets default baud rate to 115200.
* - Sets log level to LOG_LEVEL_DEBUG.
*
* @note If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC,
* you must manually define them for logging to work.
* See LOG_MAP_USB_UART macro for details.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " ); // Log initialization message
char toolchain_message[50]; // Array to hold toolchain message
/* Set the toolchain message based on the active compiler */
#ifdef __GNUC__
strcpy(toolchain_message, "Running with GCC toolchain");
#elif defined(__MIKROC_AI__)
strcpy(toolchain_message, "Running with mikroC AI toolchain");
#else
strcpy(toolchain_message, "Unknown toolchain");
#endif
/* Log the toolchain message every second */
while (1) {
log_printf(&logger, "%s\r\n", toolchain_message);
Delay_ms(1000);
}
return 0; // Return 0 (though the loop is infinite)
}
Explanation of the code snippet for Question 1:
- Logger Initialization:
LOG_MAP_USB_UART
maps the UART interface for logging, andlog_init
sets up the logger. - Toolchain Detection: The code checks for the
__GNUC__
or__MIKROC_AI__
macros to determine the active toolchain. - Message Logging:
log_printf
prints the toolchain message in the application output, and a 1-second delay prevents flooding the log.
For the testing purposes, open this code example, connect to some dev board, run Debug (F9
on your keyboard)By switching the toolchain in NECTO Studio’s project settings, you’ll see the corresponding message in the Application Output window.
Q2: What are the system requirements for NECTO Studio?
- A: NECTO Studio requires Windows 10 or later, macOS 11 Big Sur or later, or a recent Linux distribution.
Q3: How do I update NECTO Studio?
- A: Updates can be downloaded and installed directly within the IDE by navigating to
Help
->Check for Updates
.
Q4: Can I import projects from other IDEs?
- A: Yes, NECTO Studio supports importing projects from various formats. Use the Open option and follow the prompts to import your existing projects.
Q5: How do I add new libraries to my project?
- A: Use the
Library Manager
to search for and add libraries to your project. Ensure you have the necessary dependencies installed and properly configured.
Q6: How can I get support if I encounter an issue?
- A: Utilize the support resources available. For urgent issues, contact MIKROE directly via email or phone.
Q7: Is there a way to collaborate with other developers on NECTO Studio projects?
- A: Yes, you can use Planet Debug, remote hardware feature integrated within NECTO Studio, to collaborate with other developers on your projects.
Q8: How do I customize the appearance of NECTO Studio?
- A: Navigate to
File
->NECTO Preferences
to customize the appearance.
Q9: Can I use NECTO Studio offline?
- A: No, NECTO Studio cannot be used offline.
Q10: How do I use the AI Code Completion feature in NECTO Studio?
- A: AI Code Completion suggestions will appear as you type. Just enable them by navigating to
File
->NECTO Preferences
->Miscellaneous settings
and enable Use TabNine code completion
. You can also trigger it manually by pressing Ctrl+Space.
Q11: How can I configure my project to use a different compiler?
- A: During project setup, use the
Setups
Wizard to select the desired compiler. You can also change the compiler settings later in the project properties.
Q12: What are the supported programming languages in NECTO Studio?
- A: NECTO Studio primarily supports C and C++ for embedded development, leveraging the mikroSDK 2.0 framework (for C programming language).
Q13: How do I manage multiple projects in NECTO Studio?
- A: You can open and manage multiple projects within the same workspace. Use the Project Explorer to switch between projects and manage their files. Just make sure to right-click on the project and select "Set active project".
Q14: Can I debug remotely using Planet Debug?
- A: Yes, you can use the Planet Debug feature to debug your code on remote development boards hosted by MIKROE free of charge!
Q15: How do I integrate third-party libraries with NECTO Studio?
- A: Third-party libraries can be integrated by including them in the project’s library path and adding the necessary headers and source files to your project.
Q16: What should I do if NECTO Studio crashes or freezes?
- A: Try restarting the IDE and your computer. If the issue persists, check for updates or reinstall NECTO Studio. For further assistance, contact MIKROE support.
Q17: How can I automate my build process in NECTO Studio?
- A: You can create custom build scripts using
CMake
. Just make sure to right-click on the project and selectChange Project configuration
. Now, you are able to modify theSteps
section.
Q18: What is the best way to learn NECTO Studio for beginners?
- A: Start with the official NECTO Studio documentation and tutorials. Additionally, explore the example projects provided within the IDE by selecting
Code
icon on the toolbar located on the left side of NECTO Studio, and selectingPackage Manager
to learn from huge ammount of examples.
Q19: Are there any keyboard shortcuts for refactoring code?
- A: Yes, NECTO Studio offers various keyboard shortcuts for refactoring, such as
Ctrl+Shift+R
for renaming symbols.
Q20: How do I access the Command Palette?
- A: Press
Ctrl+Shift+P
to open the Command Palette, where you can access a wide range of commands and features within NECTO Studio.
Q21: What should I do if I encounter a build error related to missing files?
- A: Verify that all necessary files are included in your project and correctly referenced in your
CMakeLists.txt
file. Use theLibrary Manager
to ensure all required libraries are added.
Q22: How can I set breakpoints and watch variables in NECTO Studio?
- A: During a debugging session, click in the left margin of the editor to set breakpoints. Use the Watch window to watch specific variables and their values.
Q23: Why to migrate from PRO IDE to NECTO Studio?
- A: Just watch this YouTube episode down below for the proper answer.