Implementing a LoRaWAN End Node on STM32F407G-DISC1 using SX1262 – I-CUBE-LRWAN not available in STM32CubeMX
Hi ,
I generated a new STM32F407 project using STM32CubeMX.
However, I cannot find I-CUBE-LRWAN under Software Packs or Middleware for the STM32F407G-DISC1 board.
From what I understand, CubeMX only exposes I-CUBE-LRWAN for certain STM32 devices such as:
- STM32WL series
- B-L072Z-LRWAN1 Discovery Kit
- Some STM32L0/L4 examples
but not for STM32F407.
Because of this, I am unsure about the correct integration method.
What I have Done
- Created a new STM32F407G-DISC1 project in STM32CubeMX.
- Configured the required peripherals (SPI, UART, GPIO, RTC, etc.).
-
Added the SX1262 driver from the following repository:
- Identified and copied the required I-CUBE-LRWAN source files into my STM32F407 project.
- Resolved most of the compilation errors after integrating the middleware.
- Successfully built the project.
Although the project now builds successfully, I am still unsure whether the middleware has been ported correctly because the LoRaWAN stack does not appear to initialize or send a Join Request correctly and the tera term log is not appear.
1. Is I-CUBE-LRWAN officially supported on the STM32F407?
Can the STM32F407 run the complete I-CUBE-LRWAN stack, or is the middleware officially intended only for STM32WL devices and selected STM32L0/L4 evaluation boards?
2. Why is I-CUBE-LRWAN not visible in STM32CubeMX?
Is this expected behavior for STM32F407 devices? Should the middleware appear after installing additional software packages, or is it intentionally unavailable for this MCU family?
3. Is manual porting the recommended approach?
Since CubeMX does not generate an STM32F407 project with I-CUBE-LRWAN automatically, is the recommended method to:
- manually copy the middleware source files,
- adapt the BSP,
- implement the required hardware abstraction layer,
- and integrate everything into a CubeMX-generated STM32F407 project? Or is there another recommended approach?
4. Is there any official STM32F4 reference example?Is there any official example or application note demonstrating:
- STM32F407
- STM32F4 series
- SX1262
- I-CUBE-LRWAN
- LoRaWAN End Node
-
that could be used as a reference for porting?
5. Which platform-specific files typically require modification?When porting I-CUBE-LRWAN to STM32F407, which platform-dependent files should be adapted?
- SPI interface
- RTC implementation
- Timer utilities
- Low-power manager
- Radio board layer
- GPIO interrupt handling
- DIO1 interrupt handling
- Random number generation
- Critical section implementation
Are there any additional files or modules that usually require modification during the porting process?
6. Can the SX1262 library be used directly?Since I am already using the following SX1262 driver:
https://github.com/Saba-abiri/LORA1262
would you recommend adapting this driver to work with the I-CUBE-LRWAN radio interface, or should I replace it entirely with the radio driver included in the I-CUBE-LRWAN package?
If adapting the existing driver is the preferred approach, are there any reference implementations or examples available?
If anyone has successfully ported I-CUBE-LRWAN to an STM32F407 (or any STM32F4 device) using an SX1262 transceiver, I would greatly appreciate any guidance, documentation, example projects, or recommendations regarding the correct porting procedure.Any advice on integrating I-CUBE-LRWAN with a CubeMX-generated STM32F407 project would be very helpful.
Thank you for your time and support.
