Skip to main content
meghasb
Associate III
June 5, 2025
Question

Error in Release Mode Build: "unterminated variable reference" in subdir.mk

  • June 5, 2025
  • 1 reply
  • 268 views

Hi all,

I'm facing an issue while building my STM32 project in Release mode, but everything compiles fine in Debug mode.

The following error appears during the Release build:
Middlewares/usbx/UX_Network_Driver/subdir.mk:19: *** unterminated variable reference. Stop.
make: *** [makefile:85: all] Error 2

There are no issues in any of the other source or header files. This only occurs in the subdir.mk under the USBX network driver middleware.

I would like to understand:

  • What could be the root cause of this error?

  • Why it occurs only in Release mode and not in Debug mode?

  • What steps can I take to resolve this?

Any guidance or suggestions would be greatly appreciated.

Thanks in advance!

1 reply

Technical Moderator
June 18, 2025

Hello @meghasb 

Did you clean before re-build in release mode?

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question.Saket_Om"