Comments (8)
I think @keithduncan had a similar issue. I'll do some digging.
from atsamd.
Try commenting line 190 w.rxc().set_bit
of hal/src/sercom/uart.rs
and let me know if that fixes it.
from atsamd.
Thanks for the suggestion. The above loopback example works if the INTSET.RXC bit is not set during init.
// sercom.usart().intenset.modify(|_, w| {
// w.rxc().set_bit()
// //w.txc().set_bit()
// //w.dre().set_bit()
// });
Does the atsamd crate define a SERCOM0 interrupt handler somewhere I can't find? Or does the first SERCOM0 interrupt go to the cortex-m-rt default handler infinite loop?
How can I define my own interrupt handler? The following didn't work for me.
use hal::interrupt;
#[interrupt]
fn SERCOM0() {
}
from atsamd.
Nah, I don't think you need to define an interrupt handler, I think I accidentally turned it on when I shouldn't have.
from atsamd.
Fixed with 06aa04d
from atsamd.
I found I had to use interrupts due to receives being asynchronous, it will depend on what you’re connecting to on the other end and whether it sends you any unsolicited bytes. You might run in to a receive overrun error if you don’t read the received bytes quick enough.
I’ve copied a serial example I used to test the sercom configuration into a gist.
I’m using interrupt reads in my project and am happy to keep this in my fork. Maybe the interrupt mode in use should be an argument to the UART constructor?
from atsamd.
I also had to use the external crystal for reliable communication with my modem (GenericClockController::with_external_32kosc
).
I also ended up hiding the UART serial interface behind a ring buffer. This made it easier to consume the asynchronous byte stream in the rest of my program and might be worth adding to the hal or another crate.
from atsamd.
I'd welcome improvements to the hal's uart rx routine.
from atsamd.
Related Issues (20)
- Is the ATSAMDA1 micro supported? HOT 3
- wio-terminal Wi-Fi examples broken by #542 HOT 13
- Read state of EIC pin HOT 1
- Example for standalone usage? HOT 7
- I2C slave mode support HOT 4
- Wrong GCLK used for Metro M4 and Grand Central Express USB
- Non-working implementation of eic::pin::ExternalInterrupt::id() HOT 2
- RTC peripheral can be used without configuring the RTC clock
- PACs need to be regenerated to remove lint diagnostic
- How can I use usb function on 0.15.0 or higher HOT 3
- `Spi` implementation relies on fragile timing HOT 4
- Add support for SAMC2x ? HOT 11
- Correct alternate for USB pins on some M4 BSPs? HOT 4
- `hal::sercom::uart::Config` could potentially check for the correct sercom clock HOT 2
- Allow a way to get >1 `impl Delay` type HOT 8
- pybadge support HOT 2
- How to keep the device in bootloader mode? HOT 3
- atsamd21e18a I2C HOT 6
- Unable to use cargo flash in the feather_m0 repo HOT 2
- Wio Terminal, eRPC communication, USART Overflow
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atsamd.