-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat(devboard): Add support for Teensy 3.x and 4.x #37
Conversation
This adds preliminary support for the Teensy 3.5 development board.
Right-oh, @Kristabel28. |
At first glance, it works!! Tried both the channels and telemetry examples. Thank you so much ^^ Is there anything specific you would like me to test? By the way, I am also up for testing all the other Teensy 3.x and 4.x as and when you need help :) |
Excellent. I will get to that over the coming days. Fingers crossed all goes well. |
This adds preliminary support for the Teensy 3.0 development board.
This adds preliminary support for the Teensy 3.1 development board.
This adds preliminary support for the Teensy 3.6 development board.
This adds preliminary support for the Teensy 4.0 and Teensy 4.1 development boards
@Kristabel28, I just finished adding the entire Teensy 3.x and Teensy 4.x range to CRSF for Arduino's Compatibility Table. Can you flash this PR on your dev boards and let me know how it goes? TIA. |
Hi @ZZ-Cat , real quick update. I can't seem to find a Teensy 3.6 right now (will take some digging), but I have acquired 3.2, 3.5, 4.0, 4.1. Preliminary testing of T3.2 and T4.0 suggests issues—it won't work out of the box, but it might be user error. Compiles and uploads fine, but when I monitor the serial output, I'm not getting anything. My first test with 4.0 just had no output, and after I inserted some print lines, it seems that the serial port opens successfully, but it never gets to printing "CRSF for Arduino initialization failed!". It just repeatedly Serial.prints the line before if (!crsf.begin()), which is weird because the setup() should only run once. I suspect that this means it is rebooting, and thus possibly a power issue(currently powering off USB only), but I will have to do further testing. Note that T4.0 is NOT 5V tolerant, which meant extra hardware to convert the logic levels, which means more points of potential errors. First test with 3.2 did not work out of the box, surprisingly, as it is basically a T3.5 with smaller footprint—most users treat these boards as identical. Compiled and uploaded fine, first test printed "CRSF for Arduino initialization failed!", and all following tests did not output anything. I've been sick for the past week (out of office = no access to hardware), so I haven't quite tested in detail, sorry! Will update you again :) |
This prints show what parts of `SerialReceiver::begin()` are returning false.
This provides insights into which UART port is being used, or whether-or-not a UART port was defined.
…lity Table. This displays what development board is detected, and whether-or-not it is compatible with CRSF for Arduino.
Yikes! Being sick is not fun. Take care of yourself first, yea?
That's weird. 🤔 If the board's pins aren't 5V tolerant, you don't need a logic level shifter. IIRC, all Crossfire and ExpressLRS receivers use 3.3 V logic levels on their UART Tx & Rx lines. If anything, those are the pins that aren't 5V tolerant (and, by extension need to be guarded with a level shifter if your development board uses 5V logic level).
I have given you some serial print messages in CRSF for Arduino's 👇 This is what I have on my end, with my Metro M4 Express. From here on out, this is our "known good state".
Again, that's strange. Other than that, the CRSF Protocol is dynamically allocated, along with its related telemetry interface. This is also why I have provided Serial Print messages in my latest commits here, because I really want to know what's happening "under the hood" here. 'Cause I'm not gonna lie: I'm scratching my head about this just as much as you. I have been coding (with the Arduino framework) since 2013, and this is the first time I am encountering this particular issue. So, let's figure this one out together, eh? |
Hi @ZZ-Cat , sorry for the delay I've never seen a Teensy 3.0 or 3.1 in my life, so I won't be able to test those for you. T3.2 claims to be incompatible. T3.5 works great! I've not managed to find a T3.6 lying around. I'll update you if I ever do, but it might not be likely as they are no longer in production. T4.0 and T4.1 work great! You were right about it working with 3v3. Very pleasant surprise, I can skip the logic level converter :> |
It's all good. On any of my Pull Requests, I have a grace period of 14 days after the last comment. If I haven't heard anything from the other person in over two weeks, it's safe to say that they won't respond, and I need to keep my project moving forward. Depending on the completion state of the Pull Request, I may merge it at my discretion and then keep an eye on my Issues tab to track any bugs that it may bring (if any, at all). The only reason why Teensy 3.2 is showing up as "Incompatible", is simply because it isn't populated in the compatibility table. IIRC, there's a bit of a crossover with Teensy 3.1 and 3.2. I assumed that Teensy 3.2 basically had the same preprocessor definitions as Teensy 3.1, so I didn't bother with populating it. At this point, I am considering only maintaining compatibility with Teensy 4.x, granted Teensy 3.x is obsolete (IE Discontinued by the manufacturer). So, I am weighing up the likelihood of keeping Teensy 3.x around or to simply drop it and only maintain compatibility with Teensy 4.x and later. |
Hi again @ZZ-Cat , I'm glad I didn't miss the 14 day mark! Really sorry about the delay, after I got back to office I was catching up with other work too. Once again I'm sorry for disappearing! I went to look at the library again, made a simple modification and 3.2 works now! The changes are as follows: CompatibilityTable.cpp:
Personally I feel that since it is not a lot of effort to keep the Teensies in the compatibility table, we can leave them in for now? Of course, this would be different if it required extra effort and code to maintain Teensy compatibility. I think that Teensy is a very widely used platform, and while T3.x is probably no longer being manufactured, there are still a lot of them out there, so it would be best to keep them in the compatibility table until some other incompatibility problem actually comes up, and it would take extra effort to keep T3.x. tl;dr: the only thing stopping us from using T3.x is the compatibility table, not actual incompabilities in the code, so we should keep the option open |
Right-oh. Tomorrow, I'mma go ahead and put that in, then merge the PR. Thank you so much for helping me out, here. Anything else crops up down the line, don't hesitate to sing out, yea? |
hey, just to let you know https://github.com/Kristabel28/CRSFforArduino/blob/ZZ-Cat/issue36/examples/channels/channels.ino |
Excellent! =^/,..,^= Have a read through this on how to submit the changes in your fork as a Pull Request back to CRSF for Arduino. If you're still unable to do that right off the bat, I may need to add you as a collaborator first. In order for a Pull Request to be merged into the Main-Trunk, all of the commits in said Pull Request need to be signed/verified. This is an extra layer that I have in place to ensure code legitimacy - IE The code is coming from trusted sources. Personally, I don't use the Serial Plotter (which is why the channel data wasn't optimised for that in the first place). Also, I consciously limited the number of RC channels that are printed to the Serial Monitor to eight (instead of the full sixteen channel capability), because I use PuTTY for my "Serial Monitor". On my end, printing all sixteen channels doesn't fit well on my screen (even though my screen resolution is 1920x1080). In the library itself, I brought out all sixteen RC channels, so that if anyone needs to use them, they are there. If you like, I do have a discussions tab here, if you would like to carry the conversation on over there, after I have merged this Pull Request. |
This adds preliminary support for the Teensy 3.2 development board. PlatformIO sees Teensy 3.1 and Teensy 3.2 as the same board, whereas the Arduino IDE sees them as two separate boards. This commit prevents the Compatibility Table from causing a false negative when CRSF for Arduino is compiled for Teensy 3.2 in the Arduino IDE.
… development boards.
Overview
This Pull Request adds support for Teensy development boards.
Tasks
The following lists the boards that are being added to CRSF for Arduino's Compatibility Table:
So far, only
Serial1
is used, because this is in early stages of development and board support takes priority.Options to use other UART ports may be added in future, if requested.
Additional notes
Regarding Teensy 3.x:
With this being said, I have decided to add support for the entire Teensy 3.x and 4.x range.
Initially I was only going to support Teensy 4.0 and later and not bother with Teensy 3.x due to it being discontinued. However, I have since changed my mind on this. I am adding full support for all Teensy 3.x development boards with caveats:
If you compile CRSF for Arduino for one of the Teensy 3.x boards, you will see a compilation warning stating that these boards have been discontinued and that Teensy 4.0 (and later) is recommended for new projects.
If and when PJRC fully discontinues their entire Teensy 3.x range (IE No longer being available for purchase from their website), I will deprecate (and eventually remove) support for Teensy 3.x, later on down the track.