I found an interesting library ( GitHub - chandrawi/LoRaRF-Arduino: Arduino library for basic transmitting and receiving data using LoRa and FSK modulation ) allows you to communicate with the rfm module via spi.
looking at the manual of the card (stm32wl5) I found the internal pins of the SPI, in this case SUBGHZSPI ( Datasheet - STM32WLE5xx STM32WLE4xx - Multiprotocol LPWAN 32-bit Arm® Cortex®-M4 MCUs, LoRa®, (G)FSK, (G)MSK, BPSK, up to 256KB flash, 64KB SRAM)
the problem is that i still can’t initialize the lora module, can someone help me?
#include <BaseLoRa.h>
#include <SX126x.h>
#include <SX126x_driver.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial (PB7, PB6);
SX126x LoRa;
// Message to transmit
char message[] = "HeLoRa World!";
uint8_t nBytes = sizeof(message);
uint8_t counter = 0;
void setup() {
// put your setup code here, to run once:
mySerial.begin(9600);
mySerial.println("Begin LoRa radio");
SPIClass SPI_2(PA7,PA6,PA5); //mosi,miso,clk
LoRa.setSPI(SPI_2, 16000000); // 12MHz to 16MHz
// Begin LoRa radio and set NSS, reset, busy, IRQ, txen, and rxen pin with connected arduino pins
// IRQ pin not used in this example (set to -1). Set txen and rxen pin to -1 if RF module doesn't have one
// irqPin = PB3
int8_t nssPin = PA4, resetPin = PA11, busyPin = PA12, irqPin = -1, txenPin = -1, rxenPin = -1;
if (!LoRa.begin(nssPin, resetPin, busyPin, irqPin, txenPin, rxenPin)){
mySerial.println("Something wrong, can't begin LoRa radio");
}
mySerial.println("End setup");
}