Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application hangs because MBMUXIF_LoraSendCmd() command stuck #80

Open
metaTinker opened this issue Mar 12, 2024 · 4 comments
Open

Application hangs because MBMUXIF_LoraSendCmd() command stuck #80

metaTinker opened this issue Mar 12, 2024 · 4 comments
Assignees
Labels
bug Something isn't working internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system lorawan LoraWAN-related issue or pull-request. projects Projects-related (demos, applications, examples) issue or pull-request.

Comments

@metaTinker
Copy link

metaTinker commented Mar 12, 2024

Setup

  • STM32WL55JC1 embedded on a custom PCB with other peripherals
  • STM32CubeIDE
  • Lora gateway - Multitech MTCDT3AC model with a built-in network server, join server, packet forwarder and gateway.
  • STM32CubeWL f/w version 1.3.0

Application hangs because MBMUXIF_LoraSendCmd() command stuck on Sem_MbLoRaRespRcv sometimes

I have an application built around LoRaWAN_End_Node_DualCoreFreeRTOS example provided in the firmware. My application on CM4 sends telemetry roughly every 4-5 minutes. It will run well for a few days and suddenly the MBMUXIF_LoraSendCmd() gets stuck waiting on Sem_MbLoRaRespRcv. Reading more on how dual-core system works I figured that if a response is not received through the IPCC channels, the semaphore is never released. This is a potential pitfall for me because my application requires telemetry to be sent continuously at the 4/5 minute rate.

I cannot think of reasons why a Resp might not have been received by the CM4 core for any telemetry send Cmd.

How to reproduce the bug

At this time, I cannot pinpoint how to reproduce this bug. In my view it happens randomly at different times. Sometimes the system runs for a few days and the bug occurs or sometimes it happens right away.

Additional context

I have set up an rtos queue to not bombard the send API with messages. However, my queue gets full when this issue and no messages are sent.

** Code Snippet **

void MBMUXIF_LoraSendCmd(void)
{
  /* USER CODE BEGIN MBMUXIF_LoraSendCmd_1 */

  /* USER CODE END MBMUXIF_LoraSendCmd_1 */
  if (MBMUX_CommandSnd(FEAT_INFO_LORAWAN_ID) == 0)
  {
    osSemaphoreAcquire(Sem_MbLoRaRespRcv, osWaitForever);
  }
  else
  {
    Error_Handler();
  }
  /* USER CODE BEGIN MBMUXIF_LoraSendCmd_Last */

  /* USER CODE END MBMUXIF_LoraSendCmd_Last */
}

** Additional Info/questions **
I think by design this system waits forever on this semaphore. If at all a response is not heard back, can we have some retry mechanism or show it as a communication error callback/ retry mechanism of some kind?

@ALABSTM ALABSTM added this to To do in stm32cube-mcu-fw-dashboard via automation Mar 14, 2024
@ALABSTM ALABSTM added bug Something isn't working projects Projects-related (demos, applications, examples) issue or pull-request. lorawan LoraWAN-related issue or pull-request. labels Mar 14, 2024
@RJMSTM
Copy link
Contributor

RJMSTM commented Mar 15, 2024

ST Internal Reference: 176222

@RJMSTM RJMSTM added the internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system label Mar 15, 2024
@RJMSTM RJMSTM moved this from To do to Analyzed in stm32cube-mcu-fw-dashboard Mar 15, 2024
@metaTinker
Copy link
Author

@RJMSTM any updates on this?

@metaTinker
Copy link
Author

@ALABSTM @RJMSTM is there any resolution to this?

@ALABSTM
Copy link
Contributor

ALABSTM commented May 27, 2024

Hi @metaTinker,

We got the point. We will get back to you when we have updates to share. This may take some time. Thank you for your comprehension.

With regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system lorawan LoraWAN-related issue or pull-request. projects Projects-related (demos, applications, examples) issue or pull-request.
Projects
Development

No branches or pull requests

3 participants