Skip to content
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

Support for Flysky Paladin PL18 module FRM301 (SX1281). #1062

Open
porfiheli opened this issue Nov 6, 2021 · 19 comments
Open

Support for Flysky Paladin PL18 module FRM301 (SX1281). #1062

porfiheli opened this issue Nov 6, 2021 · 19 comments
Labels
enhancement 🪄 New feature or request

Comments

@porfiheli
Copy link

porfiheli commented Nov 6, 2021

Hello everyone. Thanks for the great work with ELRS.

I have bought for a couple of weeks a Flysky Paladin PL18. The handset is great. It is really likely that it will get in the near future EdgeTx. I would like to use it with the ExpressLRS receivers. I disassembled the external module (FRM301) and tried to find out the schematics. I have the Flysky Noble NB4 too and as far as i can say, the RF module (internal) has the same layout. The AFHDS3 receivers have the same RF module but the layout must be different.

  • The RF Module (FS-HF200) is based on the Semtech SX1281. Pictures of the module.
  • The uC is the STM32F030C8T6.
  • HSE 12 MHz.

Would it be possible to port the code from another stm32 tx like the FM30 or Ghost? I would like to help coding but i don't have much experience and i don't know if the uC has enough memory.

I suppose that for support this new target a new variant would be needed in /src/variants/ and in boards a new one should be added, right? If someone could help me to get this module supported would be really appreciated.

image


Here the schematics. If something is missing i can try to trace the pinout.

2021-11-06 FRM301 Schematics.pdf
Instead of commenting "I want this too", consider leaving a 👍 instead, to reduce spam and clutter

@porfiheli porfiheli added the enhancement 🪄 New feature or request label Nov 6, 2021
@porfiheli
Copy link
Author

RCC configuration.
2021-11-09 Clock Configuration stm32f030c8t6

@porfiheli
Copy link
Author

Sport Connection is like that:

image

I suppose that i have to set UART1 as half-duplex and inverted, right? @CapnBry you did the port for the FM30 TX. Could you please help me with this module? I get no crfs communication between the module and the handset.

Maybe the 8kB ram of the f030 are not enough for elrs tx code? i had to change the min stack size from 0x1000 to 0x400 to fit in the ram. (_Min_Stack_Size = 0x400)

@CapnBry
Copy link
Member

CapnBry commented Nov 16, 2021

Does the F030 have builtin hardware inversion? Does the handset do inversion? In the FM30 it is an F103 so all the muxing of the data and inversion is handled with external circuitry and we use GPIOs to toggle the inverter and direction. You're probably going to need to get a scope on it and figure out what side isn't doing what it is supposed to. I don't think I'd be able to help without the hardware though.

@porfiheli
Copy link
Author

porfiheli commented Nov 16, 2021

Thanks @CapnBry for the fast reply.

In the reference manual page 628 is the uart control register. If it is in the st documentation, the hardware inversion should be available. Externally there is no other hardware, the sport is connected through 2 in series resistor to rx and tx pin of uart1. I will try to check it with the scope to see what is happening.

image
image

/******************  Bit definition for USART_CR2 register  *******************/
#define  USART_CR2_ADDM7                     ((uint32_t)0x00000010)            /*!< 7-bit or 4-bit Address Detection */
#define  USART_CR2_LBDL                      ((uint32_t)0x00000020)            /*!< LIN Break Detection Length */
#define  USART_CR2_LBDIE                     ((uint32_t)0x00000040)            /*!< LIN Break Detection Interrupt Enable */
#define  USART_CR2_LBCL                      ((uint32_t)0x00000100)            /*!< Last Bit Clock pulse */
#define  USART_CR2_CPHA                      ((uint32_t)0x00000200)            /*!< Clock Phase */
#define  USART_CR2_CPOL                      ((uint32_t)0x00000400)            /*!< Clock Polarity */
#define  USART_CR2_CLKEN                     ((uint32_t)0x00000800)            /*!< Clock Enable */
#define  USART_CR2_STOP                      ((uint32_t)0x00003000)            /*!< STOP[1:0] bits (STOP bits) */
#define  USART_CR2_STOP_0                    ((uint32_t)0x00001000)            /*!< Bit 0 */
#define  USART_CR2_STOP_1                    ((uint32_t)0x00002000)            /*!< Bit 1 */
#define  USART_CR2_LINEN                     ((uint32_t)0x00004000)            /*!< LIN mode enable */
#define  USART_CR2_SWAP                      ((uint32_t)0x00008000)            /*!< SWAP TX/RX pins */
#define  USART_CR2_RXINV                     ((uint32_t)0x00010000)            /*!< RX pin active level inversion */
#define  USART_CR2_TXINV                     ((uint32_t)0x00020000)            /*!< TX pin active level inversion */
#define  USART_CR2_DATAINV                   ((uint32_t)0x00040000)            /*!< Binary data inversion */
#define  USART_CR2_MSBFIRST                  ((uint32_t)0x00080000)            /*!< Most Significant Bit First */
#define  USART_CR2_ABREN                     ((uint32_t)0x00100000)            /*!< Auto Baud-Rate Enable*/
#define  USART_CR2_ABRMODE                   ((uint32_t)0x00600000)            /*!< ABRMOD[1:0] bits (Auto Baud-Rate Mode) */
#define  USART_CR2_ABRMODE_0                 ((uint32_t)0x00200000)            /*!< Bit 0 */
#define  USART_CR2_ABRMODE_1                 ((uint32_t)0x00400000)            /*!< Bit 1 */
#define  USART_CR2_RTOEN                     ((uint32_t)0x00800000)            /*!< Receiver Time-Out enable */
#define  USART_CR2_ADD                       ((uint32_t)0xFF000000)            /*!< Address of the USART node */

I can get it inverted in stm32cubeide.

image

@CapnBry
Copy link
Member

CapnBry commented Nov 16, 2021

Should be doable then. We use those flags on F3 to do inversion in software so should be the same code. I just wasn't sure if the F0 had it or not.

@porfiheli
Copy link
Author

I get communication with the module but the lua script take sometimes a lot of time to load completely.

IMG_20211125_224833

@SUPANOOB-ZA
Copy link

Hi there,
Just to clarify, did you manage to get ELRS to work using the TX ?

@gagarinlg
Copy link

I would be very interested in getting a firmware for the FRM301 that does ELRS. My PL18 runs on EdgeTX.

@gagarinlg
Copy link

gagarinlg commented Sep 2, 2022

I got the old PR updated and now two people have PL18 running EdgeTX with working ExpressLRS 3 on the FRM301

@porfiheli
Copy link
Author

porfiheli commented Sep 2, 2022

Hi @gagarinlg , nice to read that it is working now. I had unfortunately no time to finish the project. I will try to update my PL18 to Edge-TX and then will update the FRM301, will be great to have ExpressLRS 3 with the PL18 :-)

@gagarinlg
Copy link

It is all experimental right now!
There is a manual available to bring EdgeTX on the PL18:
https://github.com/EdgeTX/edgetx/wiki/Flashing-EdgeTX-to-Flysky-PL18-or-Paladin-EV

@SUPANOOB-ZA
Copy link

@gagarinlg please help me flash ELRS to the flysky FRM302 .... what do I need to do?

@gagarinlg
Copy link

@gagarinlg please help me flash ELRS to the flysky FRM302 .... what do I need to do?

It does not work since I rebased to the 3.x version of the code.

@zandorsp
Copy link

zandorsp commented Dec 16, 2022

I have the Flysky Noble NB4 too and as far as i can say, the [RF module](https://fccid.io> /N4ZFG400/Internal-Photos/Internal-photos-4221605) (internal) has the same layout. The AFHDS3 receivers have the same RF module but the layout must be different.

* The RF Module (FS-HF200)  is based on the Semtech SX1281. [Pictures of the module](https://fccid.io/N4ZFTR1000/Internal-Photos/Internal-Photos-4057548).

* The uC is the STM32F030C8T6.

* HSE 12 MHz.

The new Flysky EL18 https://www.flysky-cn.com/el18-specifications will have a internal AFDHS3 too and may work.

@gagarinlg
Copy link

It should be possible, but RAM might be an issue.
I have started porting the code to the Flysky EL18 RF part.

@PlanetSnurfer
Copy link

Pls let us know, how the porting to the internal Modul of EL18 is going. I would try it immediately.

@PlanetSnurfer
Copy link

It should be possible, but RAM might be an issue.
I have started porting the code to the Flysky EL18 RF part.

Do you have any news?

@ishampadron
Copy link

I have an EL18 and I would be open to testing if there is a path to get ELRS in the internal module.

@richardclli
Copy link

richardclli commented Jun 13, 2024

New development about ELRS for Flysky TX modules will be followed here:

#2778

You may feel interesting @ishampadron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🪄 New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants