STM32WLE5 'Failure To Execute Command'
I am experimenting with the STM32WLE5 and the embedded SX126 LoRa-radio. (aka SubGHz)
I simply reset the SubGHz, then read its status, and this always returns a 'Failure To Execute Command' (according to section 13.5.1 GetStatus from SX126 datasheet) or when referring to the RM0461 reference manual, the GetStatus can be found in section 4.8.5 'Communication status information commands'
Here is the code :
SET_BIT(RCC->CSR, RCC_CSR_RFRST); // Activate Reset
HAL_Delay(10U);
CLEAR_BIT(RCC->CSR, RCC_CSR_RFRST); // Release Reset
HAL_Delay(250U);
uint8_t commandData[64] { 0 }; // contains parameters when sending a command to the SX126x
uint8_t responseData[64] { 0 }; // contains results when reading from SX126x
HAL_SUBGHZ_ExecGetCmd(&hsubghz, RADIO_GET_STATUS, responseData, 1);
uint8_t chipMode = (responseData[0] & 0x70) >> 4;
uint8_t commandStatus = (responseData[0] & 0x0E) >> 1;
theLog.snprintf("chipMode = [%02X], commandStatus = [%02X]\n", chipMode, commandStatus);The response is :
chipMode = [02], commandStatus = [05]and commandStatus = 05 means
0x5: Failure to execute command : The command was successfully processed, however the chip could not execute the command; for instance it was unable to enter the specified device mode or send the requested dataOn the other hand, there does not seem to be any commandStatus value for 'OK'.
Please explain how to correctly interprete this status..