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

Failed to return ES_WIFI_STATUS_OK of function ES_WIFI_HardResetModule #89

Open
AReducer opened this issue Jun 5, 2024 · 3 comments
Open
Assignees
Labels
bug Something isn't working internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system projects Projects-related (demos, applications, examples) issue or pull-request. wifi WiFi-related issue or pull-request

Comments

@AReducer
Copy link

AReducer commented Jun 5, 2024

Caution
At the return point of ES_WIFI_HardResetModule

return (ret > 0) ? ES_WIFI_STATUS_OK : ES_WIFI_STATUS_ERROR;

It requires the return value of Obj->fops.IO_Init (i. e. if it's set, SPI_WIFI_Init) as ret >0. However, when mode passed to SPI_WIFI_Init is ES_WIFI_RESET, it calls SPI_WIFI_ResetModule and return its return value. The called reset module function only has two possible of return values, 0 or -1. So, the ES_WIFI_HardResetModule can only return the case of ES_WIFI_STATUS_ERROR.

ES_WIFI_Status_t ES_WIFI_HardResetModule(ES_WIFIObject_t *Obj)
{
  int ret = 0;
  LOCK_WIFI();
  if (Obj->fops.IO_Init != NULL)
  {
    ret = Obj->fops.IO_Init(ES_WIFI_RESET); // SPI_WIFI_Init
  }
  UNLOCK_WIFI();
  return (ret > 0) ? ES_WIFI_STATUS_OK : ES_WIFI_STATUS_ERROR;
}

Describe the set-up

  • stm32L475 discovery board
  • STM32 System Workbench

Additional context
change it to ret == 0 may address this issue.

@ALABSTM ALABSTM added projects Projects-related (demos, applications, examples) issue or pull-request. bug Something isn't working wifi WiFi-related issue or pull-request labels Jun 7, 2024
@RJMSTM
Copy link
Contributor

RJMSTM commented Jun 10, 2024

Hello @AReducer,

I've tested the application, and everything appears to be functioning correctly. Could you please provide more specific details about the problem you're encountering? Any additional information would be helpful to understand and address the issue more effectively.

Regards,

@RJMSTM RJMSTM added the needs clarification Needs clarification from user label Jun 10, 2024
@AReducer
Copy link
Author

Obj->fops.IO_Init is called as

then it return SPI_WIFI_ResetModule 's return value rc

rc is 0 to be successful.

thus, ret here is 0 to be successful case. But it returns ES_WIFI_STATUS_ERROR. Shall it return ES_WIFI_STATUS_OK?

return (ret > 0) ? ES_WIFI_STATUS_OK : ES_WIFI_STATUS_ERROR;

@AReducer AReducer reopened this Jun 10, 2024
@RJMSTM RJMSTM added internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system and removed needs clarification Needs clarification from user labels Jul 5, 2024
@RJMSTM
Copy link
Contributor

RJMSTM commented Jul 5, 2024

ST Internal Reference: 185903

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 projects Projects-related (demos, applications, examples) issue or pull-request. wifi WiFi-related issue or pull-request
Projects
Development

No branches or pull requests

3 participants