-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Wio-e5 / STM32WL wip * Stubbing some FS stuff out * Wio-e5 / STM32WL wip * Stubbing some FS stuff out * Wio-e5 / STM32WL wip * Stubbing some FS stuff out * Wio-e5 / STM32WL wip * Stubbing some FS stuff out * LittleFS compiles. Can't check with actual device. * make cppcheck happy again * Guard against accelerometer thread * Missed a spot * Upload via ST-LINK * Derive MAC address from UID * upload port * Trunk it * Guard it * Maybe fix the cache error on startup. * Latest RadioLib ref to fix SubGHZ * revert nasty Sub-GHz Hack * Boots and radio inits with RadioLib 6.0, LittleFS doesn't seem to work --------- Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com> Co-authored-by: GUVWAF <thijs@havinga.eu>
- Loading branch information
1 parent
1524c23
commit a491cee
Showing
25 changed files
with
1,153 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
[stm32wl5e_base] | ||
platform = platformio/ststm32@^15.4.1 | ||
platform_packages = platformio/framework-arduinoststm32 @ https://github.com/stm32duino/Arduino_Core_STM32.git#6e3f9910d0122e82a6c3438507dfac3d2fd80a39 | ||
platform = ststm32 | ||
board = generic_wl5e | ||
framework = arduino | ||
|
||
build_type = debug | ||
build_flags = | ||
|
||
build_flags = | ||
${arduino_base.build_flags} | ||
-Isrc/platform/stm32wl -g | ||
-DconfigUSE_CMSIS_RTOS_V2=1 | ||
-DVECT_TAB_OFFSET=0x08000000 | ||
|
||
build_src_filter = | ||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<mqtt/> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040> | ||
|
||
build_src_filter = | ||
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<mqtt/> -<graphics> -<input> -<buzz> -<modules/Telemetry> -<platform/nrf52> -<platform/portduino> -<platform/rp2040> | ||
board_upload.offset_address = 0x08000000 | ||
upload_protocol = stlink | ||
|
||
lib_deps = | ||
${env.lib_deps} | ||
jgromes/RadioLib@^6.0.0 | ||
https://github.com/kokke/tiny-AES-c.git#f06ac37fc31dfdaca2e0d9bec83f90d5663c319b | ||
https://github.com/littlefs-project/littlefs.git#v2.5.1 | ||
https://github.com/stm32duino/STM32FreeRTOS.git#10.3.1 | ||
|
||
lib_ignore = | ||
https://github.com/mathertel/OneButton#2.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "STM32WLE5JCInterface.h" | ||
#include "configuration.h" | ||
#include "error.h" | ||
|
||
#ifndef STM32WLx_MAX_POWER | ||
#define STM32WLx_MAX_POWER 22 | ||
#endif | ||
|
||
#ifdef ARCH_STM32WL | ||
|
||
STM32WLE5JCInterface::STM32WLE5JCInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, | ||
RADIOLIB_PIN_TYPE rst, RADIOLIB_PIN_TYPE busy) | ||
: SX126xInterface(hal, cs, irq, rst, busy) | ||
{ | ||
} | ||
|
||
bool STM32WLE5JCInterface::init() | ||
{ | ||
RadioLibInterface::init(); | ||
|
||
lora.setRfSwitchTable(rfswitch_pins, rfswitch_table); | ||
|
||
if (power == 0) | ||
power = STM32WLx_MAX_POWER; | ||
|
||
if (power > STM32WLx_MAX_POWER) // This chip has lower power limits than some | ||
power = STM32WLx_MAX_POWER; | ||
|
||
limitPower(); | ||
|
||
int res = lora.begin(getFreq(), bw, sf, cr, syncWord, power, preambleLength, tcxoVoltage); | ||
|
||
LOG_INFO("STM32WLx init result %d\n", res); | ||
|
||
LOG_INFO("Frequency set to %f\n", getFreq()); | ||
LOG_INFO("Bandwidth set to %f\n", bw); | ||
LOG_INFO("Power output set to %d\n", power); | ||
|
||
if (res == RADIOLIB_ERR_NONE) | ||
startReceive(); // start receiving | ||
|
||
return res == RADIOLIB_ERR_NONE; | ||
} | ||
|
||
#endif // ARCH_STM32WL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include "SX126xInterface.h" | ||
|
||
#ifdef ARCH_STM32WL | ||
|
||
/** | ||
* Our adapter for STM32WLE5JC radios | ||
*/ | ||
class STM32WLE5JCInterface : public SX126xInterface<STM32WLx> | ||
{ | ||
public: | ||
STM32WLE5JCInterface(LockingArduinoHal *hal, RADIOLIB_PIN_TYPE cs, RADIOLIB_PIN_TYPE irq, RADIOLIB_PIN_TYPE rst, | ||
RADIOLIB_PIN_TYPE busy); | ||
|
||
virtual bool init() override; | ||
}; | ||
|
||
// https://github.com/Seeed-Studio/LoRaWan-E5-Node/blob/main/Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.c | ||
static const float tcxoVoltage = 1.7; | ||
|
||
/* https://wiki.seeedstudio.com/LoRa-E5_STM32WLE5JC_Module/ | ||
* Wio-E5 module ONLY transmits through RFO_HP | ||
* Receive: PA4=1, PA5=0 | ||
* Transmit(high output power, SMPS mode): PA4=0, PA5=1 */ | ||
static const RADIOLIB_PIN_TYPE rfswitch_pins[3] = {PA4, PA5, RADIOLIB_NC}; | ||
|
||
static const Module::RfSwitchMode_t rfswitch_table[4] = { | ||
{STM32WLx::MODE_IDLE, {LOW, LOW}}, {STM32WLx::MODE_RX, {HIGH, LOW}}, {STM32WLx::MODE_TX_HP, {LOW, HIGH}}, END_OF_MODE_TABLE}; | ||
|
||
#endif // ARCH_STM32WL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.