Skip to content

Invalid condition when checking the chip mode? #1009

@Maddocrus

Description

@Maddocrus

Describe the bug
Hello plz check this:
..\MCCI LoRaWAN LMIC library\src\lmic\radio_sx126x.c
line 209 :

// ----------------------------------------
// GetStatus        **  Chapter 13 GetStatus
#define SX126x_GETSTATUS_CHIPMODE_MASK 0x07 // Bits 6:4
#define SX126x_CHIPMODE_STDBY_RC       0x02
#define SX126x_CHIPMODE_STDBY_XOSC     0x03
#define SX126x_CHIPMODE_FS             0x04
#define SX126x_CHIPMODE_RX             0x05
#define SX126x_CHIPMODE_TX             0x06

..\MCCI LoRaWAN LMIC library\src\lmic\radio_sx126x.c
Problem here that will always TRUE->
Line 1160:

   // Sleep needs to be entered from standby_RC mode 
     if ((getStatus() | SX126x_GETSTATUS_CHIPMODE_MASK) != SX126x_CHIPMODE_STDBY_RC) {
        setStandby(STDBY_RC);
    }
    setSleep(0);
    return 1;

Environment

  • CPU STM32f103
  • Radio SX1262

Expected behavior

Normally, the response is 0x22 and I expect that the code will not turn on the one that is already active every time.

Screenshots

Image

Additional context

This condition occurs several times.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions