-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards: heltec_wifi_lora32_v2: enable lora #51404
boards: heltec_wifi_lora32_v2: enable lora #51404
Conversation
This enables the support for the Semtech SX1276 chip on board (see the pinout[1] and schematic[2] documents). The chip is connected to SPI as follow: | PIN | GPIO | | ---- | -------| | CS# | GPIO18 | | CLK | GPIO5 | | MOSI | GPIO27 | | MISO | GPIO19 | | RST# | GPIO14 | Additionally, the LoRa DIO PINs are connected as follow: | PIN | GPIO | | ---- | -------| | DIO0 | GPIO26 | | DIO1 | GPIO35 | | DIO2 | GPIO34 | _Note_: The first three DIO PINs are connected to the ESP32 MCU only. [1]: https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.1.pdf [2]: https://resource.heltec.cn/download/WiFi_LoRa_32/V2/WIFI_LoRa_32_V2(868-915).PDF Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
spim3_default: spim3_default { | ||
group1 { | ||
pinmux = <SPIM3_MISO_GPIO19>, | ||
<SPIM3_SCLK_GPIO5>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to stay consistent across other ESP32 boards by defining the pinmux
node the same way, i.e. including the CS#
PIN.
But adding the SPIM3_CSEL_GPIO18
to the group breaks the SPI communication and I do not know why.
Maybe someone can explain me what is wrong?
However, I guess it makes sens to leave it undefined. It is setup via the cs-gpio
from the spi3
node.
Also, all the PINs are connected directly from the ESP32 to the SX1276 without any pull-up or pull-down (according to the schematics).
Can someone explain to me if I should add output-low
or up or bias-pull-down
or up?
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be pleased if someone can give some tips about what I mentioned above to make sure this is the right solution. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gportay Hi,
However, I guess it makes sens to leave it undefined. It is setup via the cs-gpio from the spi3 node.
Regarding the CS pin, you are correct, it is already there in cs-gpio
.
You can keep output-low;
in the MOSI pins as well. It sets this pin as output with low level.
About the gpio/dio connected between ESP32 and SX1762, the SX1762 datasheet does not mention that a pull-up is required in those pins, so it seems you are good as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good. I don't have a board to test it though.
This change is now upstream[1]. [1]: zephyrproject-rtos/zephyr#51404
Dear Maintainers,
This PR enables and defines the lora node (Semtech SX1276) connected through the SPI, including the first three DIO PINs.
One can compile and test LoRa on an Heltec WiFi LoRa32 V2 board.
For example:
First build:
Then, enable
CONFIG_SPI
,CONFIG_LORA
,CONFIG_LORA_SX127X
via themenuconfig
:Finally, flash and run:
On first board:
On second board:
Regards,
Gaël
This enables the support for the Semtech SX1276 chip on board (see the pinout1 and schematic2 documents).
The chip is connected to SPI as follow:
Additionally, the LoRa DIO PINs are connected as follow:
Note: The first three DIO PINs are connected to the ESP32 MCU only.
Signed-off-by: Gaël PORTAY gael.portay@gmail.com