Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add SoftwareSerial#627

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
armint wants to merge18 commits intostm32duino:masterfromarmint:SoftwareSerial
Closed

Conversation

@armint
Copy link

Summary

Add SoftwareSerial for STM32 boards.

This PR adds SoftwareSerial support for STM32 boards. The code was based on the SoftwareSerial implementation from the lpc176x arduino port and adapted for STM32. It uses the recently added HardwareTimer code for timing. The timer to be used can be defined in variant.h by defining TIMER_SERIAL. When no TIMER_SERIAL is defined it will use the simplest timer available.
Tested and working on STM32F446ZE and STM32F401RE. Works with existing SoftwareSerial example code. Tested at 9600 and 115200 baud by communicating with hardware serial interfaces and by logic analyser.

Fixes#267

uzi18, vladkozlov69, and pkourany reacted with thumbs up emojivladkozlov69 reacted with heart emoji
Library can provide a precompiled library.See precompiled option here:https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-formatThe .a(archive)/.so(shared object) file must be located at: `src/{build.mcu}`So the `build.mcu` could not contain `fpu` and `float-abi` optionsand should only contain `cortex-mx` value.Else Arduino IDE, instead of searching `cortex-mx`, searches`cortex-mx -mfpu=fpv4-sp-d16 -mfloat-abi=hard` if floating-pointoptions are set.`build.flags.fp` has been added to contain floating-point options if any.Fixesstm32duino#606Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@ABOSTM
Copy link
Contributor

Hi@armint,
Thank you for this pull request.
It looks really interresting, and I will make a deep review into your code.

Copy link
Contributor

@ABOSTMABOSTM left a comment

Choose a reason for hiding this comment

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

In order to do like arduino with its SoftwareSerial,
could you move the files
from
cores\arduino
to
libraries\SoftwareSerial\

@armint
Copy link
Author

@ABOSTM Thank you for the review! I have modified the code to address the issues

@fpistmfpistm added this to the1.7.0 milestoneSep 5, 2019
active_out =nullptr;
// When in half-duplex mode, we wait for HALFDUPLEX_SWITCH_DELAY bit-periods after the byte has
// been transmitted before allowing the switch to RX mode
}elseif (tx_bit_cnt >10 + HALFDUPLEX_SWITCH_DELAY) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that if 5 bits are required you need (

  • HALFDUPLEX_SWITCH_DELAY * OVERSAMPLE (old style when send() check if (--tx_tick_cnt <= 0))
  • (HALFDUPLEX_SWITCH_DELAY * OVERSAMPLE) - 1 (new style with if (--tx_tick_cnt < 0) )

@stas2z
Copy link
Contributor

Tested it with Nucleo F103
57600 cause errors

15:58:03.187 -> _S recv: 1111111111111111111111111 : 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 0D 0A 15:58:03.319 -> MS recv: 111111111111111111111111"�� : 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 22 1A 14 15:58:03.319 -> S2 recv: 1111111111111111111111111 : 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 0D 0A

(where S is what was recieved from user console, MS - Software serial recieved from hardware serial, S2 - hardware serial received from software serial, serials are hardwired on the board (rx->tx))
at 115200 board doesn't boot at all

@ABOSTMABOSTM mentioned this pull requestSep 9, 2019
@ABOSTM
Copy link
Contributor

Hi@armint,
Thanks a lot for the job you have done. We really appreciate your contribution.
As it looks like you don't want to spend much more time on this, I takeover the SoftwareSerial.
So I created a new PR#645, based on your PR.
I keep you as the author as you made all the job, and you are welcome to comment on my PR if you want.

@fpistm
Copy link
Member

Closed by#645

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fpistmfpistmfpistm left review comments

+1 more reviewer

@ABOSTMABOSTMABOSTM requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

@armintarmint

Labels

abandonedNo more work on thisarduino compatibilityenhancementNew feature or request

Projects

None yet

Milestone

1.7.0

Development

Successfully merging this pull request may close these issues.

SoftwareSerial needed

5 participants

@armint@ABOSTM@stas2z@fpistm@dds90

[8]ページ先頭

©2009-2025 Movatter.jp