-
Notifications
You must be signed in to change notification settings - Fork 1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SoftwareSerial #627
Conversation
Signed-off-by: Frederic Pillon <[email protected]>
DIYMROE STM32F407VGT to DIYMORE STM32F407VGT
Library can provide a precompiled library. See precompiled option here: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format The .a(archive)/.so(shared object) file must be located at: `src/{build.mcu}` So the `build.mcu` could not contain `fpu` and `float-abi` options and 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-point options are set. `build.flags.fp` has been added to contain floating-point options if any. Fixes stm32duino#606 Signed-off-by: Frederic Pillon <[email protected]>
Mistake on the silkscreen of the board. Vendor is https://www.diymore.cc. https://www.diymore.cc/products/stm32f4-discovery-stm32f407vgt6-microcontroller-32bit-flash-mcu-arm-cortex-m4-core-development-board?_pos=1&_sid=68a700bf4&_ss=r= Signed-off-by: Frederic Pillon <[email protected]>
Hi @armint, |
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.
In order to do like arduino with its SoftwareSerial,
could you move the files
from
cores\arduino
to
libraries\SoftwareSerial\
@ABOSTM Thank you for the review! I have modified the code to address the issues |
…re_STM32 into SoftwareSerial2
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 | ||
} else if (tx_bit_cnt > 10 + HALFDUPLEX_SWITCH_DELAY) { |
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 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) )
Tested it with Nucleo F103
(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)) |
Hi @armint, |
Closed by #645 |
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