Ok, I think I understand what's going on, now. @luni that link helped, thanks.
[Update 2 text fix: The "println" should be "printf" in here: "(It can also come after the `println`"]
Fact: The...
Type: Posts; User: shawn
Ok, I think I understand what's going on, now. @luni that link helped, thanks.
[Update 2 text fix: The "println" should be "printf" in here: "(It can also come after the `println`"]
Fact: The...
I'll add another interesting detail: The code compiles and operates fine for Teensy 3 with the Teensyduino IDE but not with PlatformIO. With PlatformIO, it complains of the missing `_write`. Maybe...
I should add: This works for Teensy 4 compilation but not for earlier versions, as the original poster stated about the unresolved reference to `_write`.
I wanted this same behaviour and found that this works for me, to replace `stdout`:
stdout = fwopen(&Serial, [](void *cookie, const char *buf, int count) {
return reinterpret_cast<Print...
[Thanks, Mr. Spolsky for the inspiration here: https://forum.pjrc.com/threads/63231-FastLED-with-Teensy-4-1-fast-parallel-DMA-output-on-any-pin]
Maybe some will find this useful. I've attached a...
Thanks, @PaulS. I just released TeensyDMX v4.1.0 and it works fine on the Teensy 4. I tested send, receive, and RDM. It should also be able to retransmit as you wish, per your question above.
...
I just released TeensyDMX v4.1.0: https://github.com/ssilverman/TeensyDMX/releases/tag/v4.1.0
Changes since v4.1.0-beta.2:
7- and 9-bit format support when using serial parameters to...
Check out some of the examples with TeensyDMX. It’s accessible through the Arduino IDE (or Teensyduino); just search for “TeensyDMX” in the Library Manager (v4.1.0-beta.2 is the current, but v4.1.0...
Released TeensyDMX v4.1.0-beta.2 with a few fixes: https://github.com/ssilverman/TeensyDMX/releases/tag/v4.1.0-beta.2
The changes:
Fixed NativeEthernet interoperability by changing from a...
I’m also about to release a new version that’s more interoperable with those libraries that use IntervalTimer.
The answer to the challenge is that STAT is a 32-bit register. Changing to uint32_t fixed the problem.
I believe I've found the problem. @Chendy, would you mind trying out the new 4.1.0-beta.1 release?
The changes in this release:
Detection for packets that are too long
This fix
Some README...
I'm still working at it. I'm having some trouble figuring out what's different between v4.0.0 and v4.1.0-beta in terms of what gets executed in the serial IRQ. The only thing that I can see thus far...
Hi, Chendy. Thanks for using the software. I was testing with a Teensy 4 today and it looks like receive is broken (well, at least for Serial3). I thought my latest change that altered the structure...
I just drafted a new release, v4.1.0-beta. It contains some major code changes where much of the #define-based code was replaced with code that's much more maintainable. If those that use the library...
I added Serial8 support for Teensy 4.1 in this branch: https://github.com/ssilverman/TeensyDMX/tree/teensy41-serial8
I'm going to let it marinate before committing to the main branch.
TeensyDMX works on Teensy 4.0 too. Are you referring to this one? https://github.com/ssilverman/TeensyDMX
I’ve tested https://github.com/ssilverman/TeensyDMX on a Teensy 4.0. Let me know if that library works for you instead.
Have you modified the BasicReceive example to fit what you need?
Thanks, @luni, for trying this out. I had to step away for a little while because it was frustrating. You're right that the program doesn't restart, but it does restart after it restarts with the...
According to https://www.pjrc.com/teensy/ the Teensy 2 pins are 5 volt.
All you said was that the "USB port is in use" and not "connected to the game". Don't forget you're asking questions of overly-detailed (well, I can only speak for myself here) engineers. I didn't...
Ah, I understand now. You’re using the USB port as the game controller connection. That wasn’t immediately clear to me because there’s several other ways it could have been physically connected. Many...
Yep. I misunderstood your question. Thanks for clarifying. Curious, what is the Teensy connected to via USB? Is it a situation where you could use a USB hub?
I’m happy to have a look. Can you provide a sketch that will reproduce this issue? Also, which Teensy and which version of TeensyDMX are you using?
The Teensy behaves as a proper USB serial device and doesn't need an adapter or converter. See this: https://www.pjrc.com/teensy/td_serial.html
Your computer should just see it connected as a comm...
It’s possible to have the Teensy emulate any of the DMX USB serial devices (eg. DMX USB Pro). As long as the software can find or be told the correct comm port (or device on OSX or Linux), then it...
Okay, I've found a much smaller program that reproduces the issue. There's no DMX, no external libraries, no buffers to overflow, and no dynamic memory allocation.
Run the program, notice the LED...
So here's what I've found so far. When I read or check availability from `Serial`, the program crashes/restarts. When I use an `elapsedMillis` timer to change the mode instead, it does not crash. A...
Well, this issue exists all the way back to v2.0.0 of the library. Humbug. At least the code base is simpler for trying to debug this or find a cause. :)
Note that I've tried on Teensyduino v1.48...
My process today is going to be bisecting through all the git commits to see where it fails. Thank heavens for git. You’re probably right that it’s not Serial, but I’d like to think it’s a clue....
Update: I adjusted the program so that it only does Serial input. There’s no Serial output calls. I still see the spontaneous crash/restart.
Thanks for having a look.
I see the same crash even if I don't use `unique_ptr`. Also, when it crashes, `Serial` output can no longer be trusted without a power cycle or program button reset (and...
Here’s some code I’ve been playing with to be a nice API for accessing bit-band regions, but also compile down to minimal instructions:...
I'd love some help diagnosing this weird issue. It's one of those cases where commenting out code that should have nothing to do with the error makes the code work, but uncommenting it makes the...
"bit mode" not "but mode" :/
I've released a beta version. Any questions, suggestions, and feedback welcome.
The link: https://github.com/ssilverman/TeensyDMX
In the interests of adding further explanation, here's why I was getting so-called RDRF notifications "after one character time". I wasn't. It was simply the IDLE condition firing too. RDRF doesn't...
Inspired by `digitalReadFast` and `digitalWriteFast` and how they can compile to just one instruction, I wanted to see if it was possible to access and change the bit-band memory regions using code...
Interesting. Do you have a link to the thread?
I’m also looking into EventResponder.
I’m pretty familiar with lots of the MCU UART spec, but I haven’t yet found why RDRF interrupts are halted...
Thanks for the reminders about interrupt priority divisions.
Experimentation aside, I'd still like to understand what must happen for an ISR to stop getting called just because there's a race...
Ah, I see. Do you think priority levels are the main issue causing any races? Maybe I can pursue changing the UART priority (or change the USB priority, whichever is lower to whichever is higher). Is...
Thank you for the suggestion. Here's the optimization results:
Smallest: ISR stops, Serial output stops
Debug: ISR stops, Serial output stops
Fastest: Serial output stops, ISR does not stop...
Some more information:
In `loop()`, I toggle a monitor pin depending on the state of the UART's RDRF flag. I see pulses in normal operation, but when the ISR is no longer getting called, I don't see...
This is exactly my question. I have no idea what is stalling the UART. I know when it stalls, but not why. So: What is stalling the UART? Your statement that I "check for the error condition or...
Experimentation update:
I've tried other ways to atomically check and reset `latch`; ISR still stops receiving: __disable_irq()/__enable_irq(), ATOMIC_BLOCK, and nothing (non-atomic). This tells...
I'm verifying that the ISR no longer gets called when the freeze happens by toggling the LED in that function instead of in `loop()`:
const bool isUART0 = (&hwSerial == &Serial1);
// The UART...
Experimenting with `Serial.availableForWrite()`, the program can run much longer and the output looks like it appears much faster. The program still freezes, but after many more bytes (most of the...
I was thinking that something like priority inversion might be happening. Good point about what `serial_putchar` does. I'll go explore that...
Also great point about checking...
First, I'm not using `loop()` in my main program. It's not relevant here and unrelated to 250kbaud, or any baud rate, for that matter. loop()/second isn't related to my question. In addition, loop()...
I’m still unclear what’s causing it to freeze on an LC but not on a 3.2. Your points do make sense, but they don’t address the main question.
The "real program" doesn’t actually Serial print this...