Skip to content

[SX128x] initialization failed at Raspberry Pico 2 W #1877

Description

@AlexanderBykin

Describe the bug
Can't initialize SX1280 at Raspberry Pico 2 W.
Library expects something wrong as it can be seen at logs.
Same code work fine at Raspberry Pico W.

Debug mode output

[1.747630] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.753251] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.770368] RLB_DBG: SX128x not found! (1 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[1.775588] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[1.783894] RLB_DBG: Expected string: �
[1.798577] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.802511] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.819615] RLB_DBG: SX128x not found! (2 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[1.824793] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[1.833124] RLB_DBG: Expected string: �
[1.847806] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.851740] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.868842] RLB_DBG: SX128x not found! (3 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[1.874012] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[1.882351] RLB_DBG: Expected string: �
[1.897030] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.900961] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.918059] RLB_DBG: SX128x not found! (4 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[1.923228] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[1.931568] RLB_DBG: Expected string: �
[1.946247] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.950177] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.967278] RLB_DBG: SX128x not found! (5 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[1.972447] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[1.980785] RLB_DBG: Expected string: �
[1.995466] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[1.999397] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.016498] RLB_DBG: SX128x not found! (6 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[2.021666] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[2.030005] RLB_DBG: Expected string: �
[2.044685] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.048616] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.065713] RLB_DBG: SX128x not found! (7 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[2.070880] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[2.079219] RLB_DBG: Expected string: �
[2.093902] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.097832] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.114932] RLB_DBG: SX128x not found! (8 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[2.120100] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[2.128438] RLB_DBG: Expected string: �
[2.143117] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.147046] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.164147] RLB_DBG: SX128x not found! (9 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[2.169318] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[2.177655] RLB_DBG: Expected string: �
[2.192335] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.196266] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/Module.cpp:291
[2.213366] RLB_DBG: SX128x not found! (10 of 10 tries) RADIOLIB_SX128X_REG_VERSION_STRING:
[2.218625] RLB_DBG: 000001f0: 53 58 31 32 38 30 20 56 33 41 20 41 39 42 35 00  SX1280 V3A A9B5.
[2.226961] RLB_DBG: Expected string: �
[2.240612] RLB_DBG: No SX128x found!
[2.241083] RLB_DBG: -2 at /Volumes/dev/projects/RadioLib/src/modules/SX128x/SX128x.cpp:36
failed, code -2

To Reproduce
Minimal Arduino sketch to reproduce the behavior. Please use Markdown to style the code to make it readable (see Markdown Cheatsheet).

Sketch that is causing the module fail

#define SPI_PORT spi1
#define SPI_MISO 12 // RX
#define SPI_MOSI 11 // TX
#define SPI_SCK 10
#define RADIO_NSS 15
#define RADIO_RST 20
#define RADIO_BUSY 21
#define RADIO_DIO1 14

static PicoHal *radioHal = new PicoHal(SPI_PORT, SPI_MISO, SPI_MOSI, SPI_SCK);
static SX1280 radio = new Module(radioHal, RADIO_NSS, RADIO_DIO1, RADIO_RST, RADIO_BUSY);

printf("[SX1280] Initializing ... \n");
int state = radio.begin();
if (state != RADIOLIB_ERR_NONE)
{
    printf("failed, code %d\n", state);
    return (1);
}
printf("success!\n");

Expected behavior
Module successfully initialized.

Additional info:

  • MCU: Raspberry Pico 2 W
  • Pico C++ SDK: 2.3.1
  • Wireless module type: SX1280
  • VSCode: 1.139.0
  • Library version: 7.7.1 (latest commit [ef715e1])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions