Skip to main content
ChristophR
Associate III
November 8, 2019
Question

STM32CubeMX 5.4.0: code generation for TRACER_EMB fails when choosing USART2 as Uart Trace Source

  • November 8, 2019
  • 3 replies
  • 1419 views

Hi,

When choosing USART2 as "Uart Trace Source" for the TRACER_EMB the generated tracer_emb_conf.h file contains a Java backtrace, and the generated project cannot be built.

#define TRACER_EMB_USART_IRQHANDLER USART2_IRQHandler
#define TRACER_EMB_TX_AF_FUNCTION LL_GPIO_SetAFPin_0_7
 
Error: on line 185, column 6 in tracer_emb_conf_g0.ftl
Expecting a number here, found: valueNotSetted
The problematic instruction:
----------
==> if-else [on line 185, column 1 in tracer_emb_conf_g0.ftl]
----------
 
Java backtrace for programmers:
----------
freemarker.core.NonNumericalException: Error: on line 185, column 6 in tracer_emb_conf_g0.ftl
Expecting a number here, found: valueNotSetted

I have attached the full STM32CubeMX project file, and the generated tracer_emb_conf.h.

As a workaround I use the LPUART, code generation works in this case.

Best regards,

Christoph

This topic has been closed for replies.

3 replies

Khouloud ZEMMELI
ST Employee
November 8, 2019

​Hello @Christoph Rüdisser​ 

Thanks for the feedback, Issue will be fixed in the next release.

We are deeply sorry for any inconvenience this may have caused.

Best Regards,

Khouloud

ChristophR
Associate III
November 8, 2019

Thanks.

More things which took me some time to figure out:

  • I had to select the LL driver for the LPUART in the advanced settings in the "Project Manager" tab in STM32CubeMX. Only then I could get TRACER_EMB to work with the LPUART, by default the HAL driver was selected.
  • The calls to the tracer interrupt handlers in stm32g0xx_it.c were not generated by CubeMX. I have added the following:
void DMA1_Channel2_3_IRQHandler(void)
{
 /* USER CODE BEGIN DMA1_Channel2_3_IRQn 0 */
#if defined(_TRACE)
 TRACER_EMB_IRQHandlerDMA();
#endif /* _TRACE */
 /* USER CODE END DMA1_Channel2_3_IRQn 0 */
void USART3_4_LPUART1_IRQHandler(void)
{
 /* USER CODE BEGIN USART3_4_LPUART1_IRQn 0 */
#if defined(_TRACE)
 TRACER_EMB_IRQHandlerUSART();
#endif /* _TRACE */
 /* USER CODE END USART3_4_LPUART1_IRQn 0 */

Shouldn't these things also be done by STM32CubeMX? If not, some documentation / implementation guide would be really helpful!

Best regards,

Christoph

Khouloud ZEMMELI
ST Employee
November 8, 2019

​I'll share your request with team.

Regrads,

Khouloud