Forum Replies Created
-
AuthorPosts
-
supportKeymaster
Hi,
The “init mode failed” message is shown by OpenOCD when it has opened a handle to the ST-Link device, but the device refused the initialization command. This can be an indication of an old firmware used on your ST-Link. Can you try updating the firmware using the ST firmware update tool? If this does not help, please share the current state of the problem:
Does the settings testing always fail or just sometimes?
Does debugging work (always/sometimes/never)?
What exact problems are you experiencing with FLASH loading?supportKeymasterHi,
Based on your listing, VisualGDB should not attempt to use armeabi-v7a. Are you using normal debugging, or the Debug Custom APK option? What is the output of the VisualGDB Launcher Output in the Output window? Can you reproduce the problem on a smaller project and send us the entire project so that we could reproduce it on our side?
supportKeymasterHi,
First of all, please check that the flags.mak has been saved and successfully deployed to the Linux machine. If it has been deployed, double-check the Makefile. The following lines are responsible for using INCLUDE_DIRS:
CFLAGS += $(addprefix -I,$(INCLUDE_DIRS)) CXXFLAGS += $(addprefix -I,$(INCLUDE_DIRS)) ... $(BINARYDIR)/%.o : %.cpp $(all_make_files) |$(BINARYDIR) $(CXX) $(CXXFLAGS) -c $< -o $@ -MD -MF $(@:.o=.dep)
If the Makefile looks correct, but INCLUDE_DIRS is still ignored, you can experiment with it by modifying CXXFLAGS/INCLUDE_DIRS directly from the Makefile. If overriding the value at some line has no effect, most likely it is overridden somewhere after that line.
supportKeymasterHi,
Can you run the “tree /f” command in the project directory and attach the output here?
supportKeymasterHi,
The -g flag won’t slow down your program (as long as you keep the -O2 option), but will increase the binary size by putting debug symbols in it (that can be removed later by running the strip tool). However in the debug configuration it’s recommended to turn off the optimization (replace -O2 with -O0) as it will make debugging much easier (e.g. stepping through code can look semi-random with -O2 due to code reuse). We recommend using “-O2 -ggdb” options for the release build and the “-O0 -ggdb” options for the debug build.
supportKeymasterHi,
Please remove the
libsarmeabi-v7a directory if you are not building the armeabi-v7a target. Then VisualGDB will automatically switch to using armeabi. supportKeymasterHi,
It’s hard to tell from just this statement, but looking at the preprocessor output (expansion of #define statements) should most likely provide a clear answer. Run “gcc
-E file.c -o file.e” and then examine file.e (search for main() there as the file will be huge due to expanded #include directives). If the output is not helpful, please post the line that causes the error here. supportKeymasterHi,
From a quick look this looks more like a GDB issue. The ‘break all’ simply sends a Ctrl-C event to GDB. You can try experimenting with the set follow-fork-mode command or go to the Custom Debug steps page of VisualGDB Project Properties and override the ‘Break All’ action with a ‘killall -s INT ‘ command to send a SIGINT to all instances you’re debugging.
August 5, 2014 at 20:34 in reply to: Evaluating VisualGDB: some issues, thoughts and questions #3115supportKeymasterHi,
First of all, thank you for the detailed feedback. The possibility to use a custom toolchain was designed as a fallback scenario, so it indeed may be quite cumbersome. Based on your inputs we should be able to improve it in the next release. As a temporary workaround, you can manually configure it using the instructions below.
1. VisualGDB is very conservative about changing toolchains because accidentally using a wrong toolchain (e.g. the one with an older version of GCC or mixing the toolchains that have hardfp/softfp enabled by default) can cause VERY hard-to-diagnose problems. GDB simply crashing at random times could be the least of the problems. Hence the normal GUI does not allow changing it. Now if you’re familiar with all the pitfalls and are willing to experiment with the toolchains at your own risk, you can easily configure VisualGDB to recognize them.VisualGDB identifies toolchains by a toolchain ID (unique for the specific toolchain build) and the GNU target ID (e.g. arm-eabi). BSPs and debug methods are bound to a specific GNU target ID. Once a project is created, it is bound to a specific toolchain ID. Once you import a custom toolchain, VisualGDB will generate a unique ID for it and save it under HKCUSoftwareSysprogsVisualGDBThirdPartyToolchains. The toolchain summary will be saved to the toolchain.xml file inside the toolchain folder. The project will refer to the toolchain by its ID (the .vgdbsettings file points to an embedded profile file that in turn contains the toolchain ID).
If you want to switch a project to a new toolchain, please do the following:
a. Replace the generated toolchain GUID in toolchain.xml with a more human-readable ID
b. Edit the embedded profile file (e.g. lpc.xml or mcu.xml in the project directory) to refer to a new ToolchainID.
c. Open VisualGDB Project Properties and change the CPU type to something else and back. VisualGDB will regenerate all settings files to use the new toolchain.Please ensure to rebuild your project after you do that. Also ensure you don’t mix code built with different toolchains.
2. The segger J-Link will only appear for the arm-eabi toolchains. If your toolchain uses a different ID (e.g. arm-none-abi or arm-elf), please edit its toolchain.xml to have
arm-eabi . You can specify the GNU target ID when you are importing the toolchain.3. If you don’t need the BSP, you can simply create a custom project. The only thing that you’ll need to specify manually is the linker script. Let us know if this is too inconvenient.
4. We have added the NXP LPC support fairly recently and don’t provide the hardware register layout yet. As a workaround you can generate a description file yourself. The easiest way to do this is to create an STM32 project and look into the stm32.xml file. If will contain a reference to a MCUDefinitionFile (in %LOCALAPPDATA%VisualGDBEmbeddedBSPsarm-eabicom.sysprogs.arm.stm32). You can use that file as a template for generating one for your MCU. Once you generated it, simply add a reference to it in the embedded profile file. Let us know if you need a C# sample for generating the definition files.
5. Yes, VisualGDB uses toolchain IDs (that are stored intoolchain.xml and referred to from .xml). Please ensure that the ID is the same on all machines. 6. We could add support for combining error message information from different lines, but that would cause confusion with multi-thread builds when several compiler instances are producing output. Would making a basic wrapper (e.g. using PERL) around the IAR compiler that will simply concatenate those lines be a viable solution for you instead?
7. We made it a global XML setting in assumption that the regex alternative syntax allows extending the GCC rules so that they will work for both GCC and the other compiler. If that does not work for you, we can add a per-project option as well.
8. We use the generated rules for sources with extra path because we could not find a reasonable way to make generic templates for those (given that the .o files go to the debug/release directories and don’t stay with the source files). If you have an idea how to achieve it efficiently, feel free to share it with us. Note that we generate the rules based on the templates at the end of the Makefile however, so editing the templates and then changing the source list will propagate your changes to all rules.
9. Thanks for letting us know, we will fix this in the next release.
10. We currently only support file exclusion for Android projects. In the long term we are planning to replace GNU Make with MSBuild-based building (like in vs-android). In the short term we recommend using the filter-out statements as a workaround.
11. Yes, the new engine is based on clang and won’t have that issue. As a workaround you can replace #ifdef _MSC_VER with something like #ifdef WINDOWS_BUILD and define WINDOWS_BUILD inside #if defined(_MSC_VER) & !defined(__GNUC__). As VisualGDB defines __GNUC__ via gcc_.h, this will allow distinguishing between the real Windows build and VisualGDB. This is in our planned fix list, however as the workaround is fairly simple, the priority for it is relatively low. Let us know if it is too annoying.
supportKeymasterHi,
Do you see the same behavior if you select the “LibUSB-WinUSB” driver via the Driver Tool?
supportKeymasterHi,
Our build is using the source code from the official 0.8.0 release with the only modification being the Windows 8.1 fix (the package includes a patch file with all our changes to the source).
Could you please confirm that the original OpenOCD works with your hardware but our one does not given the same command-line arguments and driver?August 3, 2014 at 17:16 in reply to: How do I set environment variables for the debugged process #3322supportKeymasterHi,
The custom remote console does not affect Android emulator options. It simply allows running a custom program and showing its output inside Visual Studio. E.g. if your program produces output via a TCP port, you can specify telnet
: as the custom console and you will be able to see the output.
VisualGDB does not start Android emulator automatically. Instead it can launch the AVD Manager to let you launch it manually. If you want to override the environment that goes to the emulator, you need to either override the Visual Studio environment, or run the AVD Manager with the modified environment manually.supportKeymasterHi,
Sorry, we tried reproducing it on our hardware (ST-Link v1 and v2) and could not get the problem. It looks like OpenOCD may not fully support st-link v2.1 at this point. Does the Texane/STLink tool work for your hardware?
supportKeymasterHi,
We use a special build of OpenOCD that contains a workaround to the LibUSB problem on Windows 8.1 (the source code modifications are included in the libusb_workaround.patch file together with the package). You mentioned that running the x64 OpenOCD manually works. Does running our build manually from %LOCALAPPDATA%VisualGDBEmbeddedDebugPackagescom.sysprogs.arm.openocd work as well?
The KARL – should read back as 0x03, not 60 02 00 00 message comes from the texane/stlink tool and it looks like it gets printed unconditionally:
static void init_code_breakpoints(stlink_t *sl) { memset(sl->q_buf, 0, 4);
stlink_write_debug32(sl, CM3_REG_FP_CTRL, 0x03 /*KEY | ENABLE4*/);
printf("KARL - should read back as 0x03, not 60 02 00 00n");
stlink_read_debug32(sl, CM3_REG_FP_CTRL);
for(int i = 0; i < CODE_BREAK_NUM; i++) {
code_breaks.type = 0;
stlink_write_debug32(sl, CM3_REG_FP_COMP0 + i * 4, 0);
}
}Most likely, it is safe to ignore this message.
supportKeymasterHi,
VisualGDB supports IntelliSense by providing configuration and compatibility definitions to the Visual Studio IntelliSense engine. However, some GCC-specific constructs still confuse it and cause false positives. We are currently developing an independent clang-based IntelliSense engine that will solve that problem. As a temporary workaround, you can right-click on the errors window and disable IntelliSense errors completely.
-
AuthorPosts