Skip to main content
Associate II
March 20, 2025
Solved

Zigbee application stuck at M0 callback

  • March 20, 2025
  • 1 reply
  • 1008 views

Hi!
I am trying to reproduce some examples and got stuck at simple sensor.

The example code is working fine on my P-Nucleo-wb55, but if I am trying to reproduce i with CubeMX i've got failed

Code is simply stuck at 

void shci_cmd_resp_wait(uint32_t timeout)
{
UNUSED(timeout);
UTIL_SEQ_WaitEvt(1U << CFG_EVT_SYSTEM_HCI_CMD_EVT_RESP);
return;
}

I’ve tried to compare example ioc file and mine and can't find something

 

Could, someone, please help me find what I've missed?

Best answer by Ouadi

Hi,

From the IOC file, I noticed that the traces are not set correctly, so the program get stuck in the DbgTrace func.

When enabling Traces for Zigbee, please enable also the circular buffer as follow :

Ouadi_0-1742999707539.png

After generating the project, make sure to call the func Init_Debug() in MX_APPE_Init() to initialize the UART.

Hope this helps.

Best regards,

Ouadi

1 reply

OuadiBest answer
Technical Moderator
March 26, 2025

Hi,

From the IOC file, I noticed that the traces are not set correctly, so the program get stuck in the DbgTrace func.

When enabling Traces for Zigbee, please enable also the circular buffer as follow :

Ouadi_0-1742999707539.png

After generating the project, make sure to call the func Init_Debug() in MX_APPE_Init() to initialize the UART.

Hope this helps.

Best regards,

Ouadi

_Garacio_Author
Associate II
March 26, 2025

Hm...thank you!
It really works!

It's strange, but if I use Init_Debug() inMX_APPE_Init(), I should fix the autogenerated MX_USART1_UART_Init from static to exportable function and move the definition to main.h.

CubeMX generates it as static function thus it can't be used from another file and I should fix it every time I have regenerate the code

Technical Moderator
March 27, 2025

Hi,

 MX_USART1_UART_Init is already called in the main and has not to be called in the app_entry.c, We will fix this issue in the upcoming release of CubeMX.

Best regards,

Ouadi