STM32 XCP via CAN bus - "Parser::describeSymbol xcpDummyDoubleVariable is not a global variable" error
Show older comments
Greetings,
while trying to follow this example:
I counldn't even connect to my board (STM32F4**). Flashing was done correctly and CAN bus was correctly configured. The CAN communication and interface is configured as following:


The error that keeps poping up is:
DWARF Parser internal error: Parser::describeSymbol xcpDummyDoubleVariable is not a global variable
What I've tried:
- I've tried modifying a linker to include a "xcpDummyDoubleVariable" variable Adding a "xcpDummyDoubleVariable" to a header "main.h" file inside stm32 cube project
Error is displaying while trying to connect to a board:

Does anyone have any experiance with this kind of issue? If the XCP via CAN bus is working for you, what is the your Matlab version?
Accepted Answer
More Answers (1)
Saurav Shandilya
on 7 Oct 2025
Edited: Torsten
on 7 Oct 2025
1 vote
The issue is most likely because compiler optimization would be removing xcpDummyDoubleVariable as part of optimization. This issue is documented in an external bug report
Please check following:
- Make sure to use "Monitor & Tune" button and not the "build" or "Build,Deploy & Start" button
- If above step do not resolve, check for compiler optimization. Open Model Settings -> Code Generation. Expand "Toolchain details" and check of -0 flag for C Compiler. You can set "Build configuration" to "Specify" and manually set optimization to -O0.
Do let us know if this resolves the issue.
If the problem still persists, contact MathWorks Technical Support and share the generated code folder, model and ioc file.
5 Comments
Luka
on 8 Oct 2025
Saurav Shandilya
on 8 Oct 2025
Hi @Luka
Did you clicked "connect" after performing "Monitor & Tune" ?
If you click on "connect" after performing "Build, Deploy & Start", you will likely see the build error because required files for XCP functionality will not get generated.
Saurav Shandilya
on 8 Oct 2025
@Luka this can happen if in External Mode Communication Interface is set to Serial instead of CAN.
As you intend to use External mode over CAN, ensure following
External Mode
- Communication Interface is "CAN"
- Host interface is "Simulink"
Please read and follow all steps as mentioned in
Luka
on 8 Oct 2025
Categories
Find more on Embedded Coder Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

