Forum Replies Created
-
AuthorPosts
-
January 11, 2026 at 04:46 in reply to: Is it possible to export BSP compiler flags to global scope? #37050
wtywtykk
ParticipantOk, my solution to this problem:
`get_target_property(BSP_COMPILE_OPTIONS BSP COMPILE_OPTIONS)
message(“Making compile flags global: ${BSP_COMPILE_OPTIONS}”)
add_compile_options(${BSP_COMPILE_OPTIONS})`December 25, 2025 at 06:15 in reply to: Is it possible to export BSP compiler flags to global scope? #37030wtywtykk
ParticipantHi,
I looked through add_bsp_based_executable, but didn’t find the CFLAGS, seems it’s inheriting the CFLAGS from BSP by target_link_libraries. I don’t want to use target_link_libraries because it exposes many unrelated bsp files to my library.
So I looked into find_bsp, it’s using _core_cflags to pass the flags, but it seems the variable is private. I added the following lines after find_bsp. It’s not printing anything.
message(STATUS “_core_cflags = ${_core_cflags}”)
Any idea about that? I don’t fully understand what the bsp code is doing, correct me if I’m wrong.
wtywtykk
ParticipantHi, Thanks for your reply, but the installer doesn’t look like a valid exe file. I can’t run it.
Os info:
Edition Windows 10 Pro
Version 2009
Installed on 4/16/2021
OS Build 19045.5965wtywtykk
ParticipantHi,
To clearify, by “restart” I mean the blue button from VS. and “reset” is the green button added by visual gdb.
My problem happens when I click “restart” (the one from VS). And I agree “reset” shouldn’t clear the content.
After some digging, I found the old content is actually cleared. What it not cleared it the content that received/buffered after I pause the window. They are shown to the window immeidately after unpause. I think this is not expected.
Reproduce:
- write a program that prints strng in main with some interval
- start the program, the string is shown in semihosting window
- pause the window, wait for a while
- restart the debugging(by the restart button or by stop then launch)
- quickly unpause
- you can see the data before restarting is added to the beginning.
Some other problems:
- when reading the semihosting with “gets”, restarting will show a error message “Object reference not set to an instance of an object.”
- resetting during reading will cause the semihosting to stuck/show some garbage data.
reproduce:
- run the following code. This program echos back the input line.
for (;;) { HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, GPIO_PIN_SET); HAL_Delay(500); HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, GPIO_PIN_RESET); HAL_Delay(500); puts("aaa\n"); char bb[128]; gets(bb); puts(bb); }2. the program should wait for input from semihosting
3. reset the mcu (if end debugging here, “Object reference not set to an instance of an object.” is shown)
4. type something
5. the mcu is stuck at gets (no echo is showed after pressing enter)
Thanks!
wtywtykk
ParticipantHi,
I want to use different config for the applications. So I use multiple find_bsp with different ALIAS. Is this the preferred way?
Also could you point out where “VS properties for the BSP item in Solution Explorer” is? I can’t find it in the property window(Right click->properties).
Regards,
Tianyi
wtywtykk
ParticipantHi,
My problem can be solved by using port 22.
The following is my environment.
Visual GDB version is 5.6R8
I’m using Embedded project, with a custom BSP. But the problem can be reproduced from regular STM32 BSP.
QEMU is the latest source code built with
../configure –enable-debug –disable-werror –target-list=”arm-softmmu” –without-default-features –enable-user
The config for remote gdb stub is in the first floor.
And here’s a video of the steps to reproduce the issue.
wtywtykk
ParticipantSeems that in full-custom mode I have to launch QEMU by myself or by some script since it only runs gdbstub on local computer.
But anyway, I’ve solved the problem by changing the SSH port to 22, so I can connect without the port in host name.
wtywtykk
ParticipantHi,
The public key is caused by ssh server config. And it’s working now.
For the target selection command, I’m still having trouble with “full-custom mode”. The target is always “local computer”. If I change it to SSH, it reverts to local computer when I click “Apply”.
Thanks
Attachments:
You must be logged in to view attached files.April 8, 2021 at 19:23 in reply to: "Before building" custom step missing "PATH" env variable #30321wtywtykk
ParticipantGreat! It works!
April 4, 2021 at 11:15 in reply to: "Before building" custom step missing "PATH" env variable #30304wtywtykk
ParticipantHi,
I added
<PropertyGroup>
<ExecutablePath>$(CommonExecutablePath)</ExecutablePath>
</PropertyGroup>to my vcxproj and it works. And would you add this by default in later updates? Not having PATH in custom steps is just surprising.
April 4, 2021 at 09:36 in reply to: "Before building" custom step missing "PATH" env variable #30302wtywtykk
ParticipantHi,
By clearing the VC++ Directories -> Executable Directories in regular VC projects, the problem can be reproduced.
And the description for Executable Directories:
Executable Directories
Directories in which to search for executable files. Corresponds to the PATH environment variable.So I believe the problem is VisualGDB setting this property blank. Setting this to $(CommonExecutablePath) would solve the problem.
wtywtykk
ParticipantHi,
It works, thank you!wtywtykk
ParticipantHello,
I encountered the color problem too. After installing the fix above, the colors were corrected. However, I can’t build the project now, and I got following messages:
1>C:\Program Files (x86)\Sysprogs\VisualGDB\MSBuild\Targets\external.targets(6,3): error MSB4018: The “LaunchVisualGDB” task failed unexpectedly.
1>C:\Program Files (x86)\Sysprogs\VisualGDB\MSBuild\Targets\external.targets(6,3): error MSB4018: System.TypeLoadException: Could not load type ‘VisualGDB.Builder.ISimpleFormattedBuildLogLineSink’ from assembly ‘VisualGDBCore, Version=5.5.1.1, Culture=neutral, PublicKeyToken=8f764369eb712693’.
1>C:\Program Files (x86)\Sysprogs\VisualGDB\MSBuild\Targets\external.targets(6,3): error MSB4018: at Sysprogs.build.tasks.shared.LaunchVisualGDB.Execute()
1>C:\Program Files (x86)\Sysprogs\VisualGDB\MSBuild\Targets\external.targets(6,3): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\Sysprogs\VisualGDB\MSBuild\Targets\external.targets(6,3): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()And following messages show up when I open the project:
error : Designtime build failed for project ‘C:\Users\163wt\Desktop\EmbeddedProject1\EmbeddedProject1\EmbeddedProject1.vcxproj’ configuration ‘Debug|VisualGDB’. IntelliSense might be unavailable.
Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.Regards
wtywtykk
ParticipantHi,
The workaround just works fine for me. My environment is: ARM toolchain 7.2.0/8.0.1/r3; STM32BSP 2019.06; OpenOCD 20190625-0.10.0
wtywtykk
ParticipantHi,
Bad news. The new syntax has some new problem. The “_sidata” symbol points to a wrong address when the “Ignore standard libraries (-nostdlib)” option is turned on in the project properties. I do find an solution to this (using LOADADDR() ), but I’m not confident about it. I’ll test my modification with my previous projects and some special cases.
However I suspect whether it’s worth taking the risk to change a stable code. May be the linker script should remain untouched.
-
AuthorPosts