STM32 XCP via CAN bus - "Parser::describeSymbol xcpDummyDoubleVariable is not a global variable" error

87 views (last 30 days)
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

Luka
Luka ungefär 16 timmar ago
Edited: Luka ungefär 16 timmar ago
Hi @Saurav Shandilya and everyone in the future!
I've figured it out on how to connect with XCP via CANbus!
All that was is that I needed to "Monitor & Tune" instead of using "Build" option when connecting to my system. There is however a bug that requires me to use USART3 when I clearly don't need it. It's a simple fix for just enabling it in the CubeMX and not using it :p
Now, I'm facing another problem...
My initial goal was to just use CAN bus in the future when deploying my embedded board inside the system. How SImulink STM32 library was configured is that...
----
I NEED TO FLASH THE "XCP" FIRMWARE TO MY BOARD EVERY TIME THAT I WANT TO CONNECT TO XCP VIA CAN BUS
----
I've tried to use "Monitor & Tune" for the first time and then proceed with just "Connect" afterwords (while not chaning the model) and the message that keeps poping up is:
  • 'XCP on CAN' transport layer is not supported.
Here is the image of the proof:
Is there a way to mitigate such behaviour so that I can flash my MCU once and monitor it without the STLink connected every time I want to do such a thing? If not, can I modify a flashing command of the Simulink model (or STM32 library) so the MCU is also flashed via CAN bus previously (I've read the STM32 Application Note, it's listed as a possible firmware writing method in the bootloader)?

More Answers (1)

Saurav Shandilya
Saurav Shandilya on 7 Oct 2025 at 9:06
Edited: Torsten on 7 Oct 2025 at 10:29
Hi @Luka,
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:
  1. Make sure to use "Monitor & Tune" button and not the "build" or "Build,Deploy & Start" button
  2. 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
Saurav Shandilya
Saurav Shandilya on 8 Oct 2025 at 14:58
@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
Luka on 8 Oct 2025 at 16:10
As you can see from the original question, I've configured external mode as following:
That's why I'm confused why is Simulink asking about USART3 when it's not selected as a desired communication interface :/

Sign in to comment.

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!