I wouldn’t use multiple .ino files in your project; that sounds strange to me. Have one .ino file for your “main code” and then the rest headers and C++ or C sources.
C and C++ are completely different programming languages. The snippet shown uses C++ syntax, and does not compile as C, not even as C23.
I stand by my claim of using the C++11 and later syntax for specifying the underlying type for the enum...
Hi, I would like to announce a new project.
The goal could be described as "open science", or at least the part that is about being able to make physical measurements and build experiments when you are not necessarily at an elite institute or...
Adding “lib_deps” entries (to platformio.ini) that point to GitHub URL’s should be fine.
Example:
lib_deps =
https://github.com/name/project.git
https://github.com/name2/project2.git
It appears like it can build for Teensy 4.1 with some modifications to the Arduino_ConnectionHandler library dependency. Note that I didn't test it, I just built it. I used PlatformIO and only used the Arduino_ConnectionHandler...
Right, there's "libstdc++.a" which is 4879KB (TD 1.59) and "libstdc++_nano.a" which is 3042KB.
But using the Arduino IDE, the only way to use it is to set optimization to "smallest code" instead of using one of the other levels - I don't believe...
I have a subdirectory named RNDIS_QNEthernet in my arduino libraries directory, containing the contents of the git repository.
At the top of the sketch I only have #include <RNDIS_QNEthernet.h>, since that also includes the USB Host library and...
@jmarsh When you use the <qnethernet_external_driver.h> file, are you copying it over to the project directory? That is, a project that uses QNEthernet. I just tried to add your driver (inside the Arduino libraries/ folder), first in a...
It's not pushed yet, but I just renamed `driver_set_mac_address_allowed()` to `driver_set_incoming_mac_address_allowed()`. I also updated some of the docs in lwip_driver.h.
Understood. I'm glad we're on the same page. (Mostly I just write my responses assuming zero knowledge, especially to be helpful for future readers.) I also hear you on the confusability. I'm in agreement, after staring at this code while tired...
driver_set_mac() is for setting the MAC that makes the device unique on the network. This is the same thing that'll be set as a transmitted Ethernet frame's "source address". driver_set_mac_address_allowed() is for non-promiscuous devices to...
Sounds like I need these:
1. driver_is_mac_settable()
2. driver_is_link_speed_detectable() (have to think about the other parameters such as duplex and crossover)
Some questions: In pure RNDIS (i.e. theoretical):
1. Is the MAC address settable?
2. Are link parameters, such as duplex mode and link speed, detectable? (It feels like they are.)
Some posts I've been reading imply that the driver chooses a...
I think having this discussion is great because it exposes new and different use cases. Writing a driver API is hard because there's so many different needs, split up in different ways. Hopefully getting this working well will make the driver API...
I like it. Let me think about the vagaries.
I have some comments and notes about the driver itself, but one initial thing I noticed was that the MTU and max-frame-len values are constants.
My comments are actually better suited to a PR or code...
I haven't tried the include solution you propose, but here's some things of note:
1. In https://en.cppreference.com/w/cpp/preprocessor/include, it states "Searches a sequence of implementation-defined places for a header"
2. GCC's search path...
Would be cool if that worked. Arduino gets weird and restrictive sometimes. If you decide to experiment with that, I’d love to hear about any results. Shoehorning this dynamism into the Arduino system can be a challenge.
True. They'd only have to modify one thing in qnethernet_opts.h, though. (Or modify build options, of course, with some custom platform.local.txt, etc.). This is one of the reasons I added that qnethernet_opts.h file. But this should be a...
May I suggest running the test suite with different drivers and systems? This way you know the defaults still work, in addition to your new stuff.
In PlatformIO, the command is: pio test -v -e teensy41-test -f test_ethernet
Note that the...
I like the direction of your thinking here. Let me ponder the ideas you present. The specific difficulty with the way you have it currently is that the lwipopts.h file is included inside the lwIP code itself, and the changes you make in the...
Whoops. You're right. It's for sending. But it's still not related to ETH_PAD_SIZE.
It's not that it's just better, it provides a speed improvement so that frames are aligned on a 32-bit boundary when being received by the CPU's MAC. Other PHYs...
To clarify: PBUF_LINK_ENCAPSULATION_HLEN and ETH_PAD_SIZE operate at different layers. ETH_PAD_SIZE is at the raw incoming bytes layer that performs a certain optimization with the PHY and/or CPU registers and internal frame processing, below the...
Can you explain further? Do you mean ETH_PAD_SIZE? Those two options are for different purposes. Don’t forget you can always modify lwipopts.h. (And tell me what you needed to change and why.)
@jmarsh check out the top three commits of this branch: https://github.com/ssilverman/QNEthernet/tree/no-driver-constants
Let me know if it needs more changes to accommodate your driver. See also all the function comment changes in those commits.
@jmarsh, first, I agree with your points. And second, I’m glad you’re writing a driver for something I haven’t tried yet. I would have gotten there and seen these hiccups, but having other people do this exposes them faster. So thank you for...
I can certainly help with this. First, I don’t love the Arduino-functions-are-members-of-a-singleton nonsense. I’ve already started experimenting with turning everything in a singleton into a static function.
You can set a MAC address with...
Just to clarify this fix: it’s only for the “unsupported” driver with no connectivity because other drivers are supposed to get the MAC address. The reason it wasn’t getting the MAC address for a Teensy 4.0 was because the “unsupported” driver...
I found the problem. It is due to a programming issue of my own making. I was having some different problems so I decided to make a pared-down program that just represented the problematic portion, and failed to copy two very important...
The QNEthernet library should support Teensy 4.0 just fine, including accessing the MAC address. I tested this. If it doesn’t, that’s a bug. I’ll explore more later today.
Just to disambiguate some terms: The Teensy 4.1 has support for “native Ethernet”, meaning there’s a PHY chip on-board for interfacing with Ethernet ports. There’s also a library called “NativeEthernet” that happens to be included with the...
Just some feedback,
I used the following code with the QNEthernet library
char url[300];
sprintf(url,
"POST /xxx.php HTTP/1.1\r\nHost: lexxatrexxa.co.za\r\nontent-Type: application/octet-stream\r\nConnection...
Changing compilers, changing struct member ordering, adding and removing structs, can all mess with the physical structure. Just because it works now, doesn't mean it will work later. At the very least, my suggestion is to use a packed struct...
I've only built the toolchain a few times over Teensy's entire 16 year history. Every time the process has been different. I've tried to use the scripts ARM publishes. On the most recent version, I didn't built it at all for Windows, MacOS and...
So I've been playing with building newlib-nano, and I can build successfully, but my output is on the order of about 5 times larger than what's in the Teensy package. Can you share the script you're using to build the toolchain? Basically, you...