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

Add SOFTSERIAL support on RX4/TX4 for MATEKF405 target #2842

Merged
merged 1 commit into from
Apr 4, 2018

Conversation

shellixyz
Copy link
Collaborator

Pull request for the softserial mod provided by @MATEKSYS in #2841.

Closes #2426 and #2841.

@digitalentity
Copy link
Member

Where are PA0 and PA1 on the board? @MATEKSYS ?

@shellixyz
Copy link
Collaborator Author

Looks like it is the hardware UART4 pins there:
matekf405_rx4tx4

//#define SOFTSERIAL_1_TX_PIN PA0 //TX4
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_RX_PIN PA1 //RX4
#define SOFTSERIAL_1_TX_PIN PA0 //TX4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a clash between USE_SOFTSERIAL1 and USE_UART4 - they use the same pins. If softserial is enabled UART4 should be removed from the list of UARTs on this target.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the goal was to keep the possibility to use one or the other. Can't the two coexist meaning if nothing is configured on UART4 enabling SS1 and using it instead would work ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about the scenario when user will configure both. This needs to be prevented.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A solution could be to add targets replacing UART4 with softserial. MATEKF405_1SS and MATEKF405OSD_1SS.

Copy link
Contributor

@MATEKSYS MATEKSYS Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Use one or the other. UART4 can work as normal UART if users don't choose "Enable CPU based serial ports" in configurator. Tested it already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shellixyz I think no need to add more targets. Now it is a good solution. . 5xUarts are still available for non-Frsky users. 4xUarts+1xSoftserial for Frsky users after enable softserial. We will add this guide in our FC page. in BF there are some targets use this type of hack on UART pins also.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, F4 telemetry_inversion = OFF by default. F722 telemetry_inversion = OFF default also. Need to set them = ON to get Frsky telemetry working. can telemetry_inversion be defined as ON by default in firmware.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
I have tried getting telemetry to work on UART4 (TX4) to no avail.
I have tried D4R-II and X8R.
Attached is the dump.
Can someone help me figure out what I didnt do right?
INAV.txt

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ogocology Since you want to use soft serial for smartport I guess you connected your receiver without the uninversion hack so your issue is probably that you need telemetry_inverted = OFF. It means normal expected inversion. So for smartport it means inverted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its working now with telemetry_inverted = OFF.
I also got servo working on s6 pad for camera tilt servo.

I remain grateful to all who consistently strive to make this level of support available (and FREE).

Cheers!

@digitalentity digitalentity added this to the 1.9.1 milestone Feb 27, 2018
@stronnag
Copy link
Collaborator

stronnag commented Apr 2, 2018

Another vote of approval for this PR from Olivier_C https://www.rcgroups.com/forums/showpost.php?p=39441097&postcount=18845

@digitalentity if you could kindly offer some guidance on the naming resolution for #2954 please, then the board documentation can be updated and both PRs merged.

@digitalentity
Copy link
Member

I'm ok with merging this PR. My internet connection is flaky at best (in China now), so please, merge this and ServoS6 PR as you deem both ready.

@stronnag stronnag merged commit 41386a2 into iNavFlight:development Apr 4, 2018
@stronnag
Copy link
Collaborator

stronnag commented Apr 4, 2018

merging per @digitalentity's advice

@Ogocology
Copy link

Ogocology commented May 7, 2018 via email

@shellixyz
Copy link
Collaborator Author

@Ogocology Great ! The behavior of telemetry_inverted has changed recently. Before 1.9.1 it meant telemetry is inverted. Now it means telemetry is inverted from normal. So now you only need to change it when you have a non-standard wiring. The Matek product page needs to be updated. Happy flying !

@fiam
Copy link
Member

fiam commented May 7, 2018

@Ogocology if you can post the link to the incorrect information, that'd be great. I'm sure @MATEKSYS is interested in fixing the doc error.

@Ogocology
Copy link

@fiam My bad. I have read so much on the issue i wasn't sure where i got that information.
It actually was few posts above from @MATEKSYS
Information on the product page clearly states 'INAV 1.9.1 or newer, Softserial1_TX on TX4 pad for Frsky Smartport if CPU based serial port is enabled.
telemetry_inversion = OFF by default in 1.9.1 or newer. it works'.

I apologise for the mixup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants