One IDE Tool that is very helpful is " Ctrl + T ":
Taking the Code from post #19 and then hitting Ctrl+T here results in this that quickly presents a view of the source as the compiler might see it.
The indenting goes very wrong and on...
It looks like you are linking with some Arduino core other than Teensy, i.e. core.a. Is that the entire sketch? Please post the entire sketch, and please use the "code" tag (</> in the message window) when you post code to the forum.
Thanks for this good info. In the other thread, @graydetroit said
I'm curious whether he was checking for sd.card->is_busy() before each write when he was using 512-byte writes. Physical writes to SD are ultimately done by sector (512-byte...
I'm kind of looking for a test case, and yes, when you're reading from an audio file, what is the data rate required for smooth playback? Maybe that's not strictly a constant, but can you provide a figure of merit? If so, that data rate would be...
I'm curious about this application. Can your SD requirements be reduced to simultaneously meeting these two objectives?
continuous read from file A at X bytes/sec
every Y seconds, write Z bytes to file B
If so, can you specify X, Y, and Z?
TimerOne is very old, going back to original 8-bit Arduino. It does support T4.x, but with limitations. The code below is from TimerOne.h, and explains what you're seeing. You should try IntervalTimer, which is built into Teensy4 core, uses the...
That's good. Nothing wrong with calling yield() when yield() is a task switch, because in that case it's not reentrant. Each yield() is just a point in a big loop that eventually returns.
Yes, I agree with you and @jmarsh, the responsibility is on the programmer, but if EventResponder was not called from yield(), at least the users would not face the issue of calls to yield from additional places each time they add the use of...
For the record, the QNEthernet library doesn’t have to use EventResponder or hook into yield(). In fact, that’s how it started out. The only thing that you need is to call Ethernet.loop() regularly. (And comment out the attachLoopToYield() call.)...
The hardware resource that is shared and requires protection is the SPI peripheral, not the external devices.
Calls to yield() are found in all Arduino cores and many libraries, and that fact has to temper what you do if you override it with...
Yes, that's right. I first modified the example to do what I wanted my simple TCP server to do, and then tried to merge that functionality into the multi-tasking application, and that's when I ran into the issue related to yield().
I started from the FixedWidthServer example. It wasn't a theoretical issue. When I build an application that uses the cooperative OS, the task-switching version of yield() gets linked. The function that waits for DHCP calls yield(), but in my...
I think what happened is a tried an example, and since it did what I wanted, I never looked beyond it. When I download your modified code, I'll try the non-blocking functions. Thanks very much!
Thanks, Shawn. I will take a look at your changes tomorrow. I'm sure I'll eventually understand more about QNEthernet, but right now my understanding is very superficial. My goal was to add TCP connectivity to our application, and I did that by...
@shawn, if you look at the original Arduino code from hooks.c from my post above, you can see that yield() was originally an alias for empty(), but that is not true in the Teensy cores. If it was, you'd be able to test "if (yield == empty)" to...
I think that would work. Here is the post I was working on, just FYI, so you know what I encountered.
----------------------
Shawn, I've recently added use of QNEthernet to an application where I use a cooperative OS, and I want to ask about...
The purpose of inserting a yield() in a waiting loop within a library is for that function to be made non-blocking when used with a cooperative OS. The only solution to avoid libraries clashing is to understand what each one does and use them...
Hi Shawn. You're right. When I said that QNEthernet overrides yield(), I should have said that QNEthernet relies on yield() being overridden by EventResponder. I'm not remembering right now the exact issue and what I had to do as a work-around...
This is a topic near and dear to my heart. In my opinion, the problem is this statement:
I'm using EventResponder to re-fill audio buffers from SD card, without the user having
to remember to write extra code
Arduino generally, including...
I downloaded the library and searched for VARIANT_MCK. It only appears in one file (src\internal\NeoArmMethods.h). This file has conditionally compiled sections for the supported platforms, and VARIANT_MCK is only referenced when you're trying to...
See the link below for a discussion and a table of possible speeds with the 240 MHz LPSPI clock.
https://forum.pjrc.com/index.php?threads/lpspi-speed-limit-and-qspi.72055/post-319847
I’m going to bookmark this thread and point to it in the future because it’s a perfect example of why including some code in one’s question will very possibly lead to a solution much more quickly.
FlasherX definitely works on T4.1 with TD 1.57, 1.58, and 1.59. I can say that for sure because I've continued using it through all of these versions, including the betas, with no problems. I haven't used T3.5 in some time, but I think others are...
Can you explain why the AD9833 library doesn't work if there are other SPI devices? It seems like as long as SPI.begin/endTransaction are used, it shouldn't matter if one device uses Mode 0 and another uses Mode 2. As long as only one device is...
I'm not sure, but if I understand correctly, 1.57.3 would be Beta #3 of 1.57, and not the release version. I still use IDE 1.8.19, so I'm not very familiar with the 2.x stuff. You should probably wait for someone else to reply.
Once you get back...
When using IDE 2.x.x, you can choose which version of the Teensy "board package" you install. This board package is equivalent to TeensyDuino. Do you know which version you installed? You said you are using TeensyDuino 1.57 on your old PC with...
Yes, though I'm not sure in which version the change occurred. If I understand correctly, it's a configuration choice in the tools, but perhaps the default configuration changed in 11.
Also, you can dynamically allocate to PSRAM, so you can decide at run-time where you want your arrays.
https://forum.pjrc.com/index.php?threads/malloc-free-for-extmem-and-dtcm.63695/post-265250
Total RAM (RAM1 + RAM2) is only 1MB, so if you have code + data (static or dynamic) that approach or exceed 1MB, you'll need to assign some data to PSRAM (EXTMEM) and/or keep some code in FLASH (PROGMEM). Don't worry about it too much in advance...
No, you cannot get source code from a Teensy. T3.6 stores the binary image in flash that is part of the microcontroller, as opposed to external flash like T4.x. You are probably out of luck.
You could use "Serial3.flush()" rather than "delayMicroseconds(1150)". The flush() call will block until all the data has been transmitted. Information on the serial hardware is listed at td_uart.html
You definitely can update the Teensy firmware over a serial link. Whether it can be the same one you use to update the Nextion, I don't know. I suggest you try the FlasherX examples first, to get a sense of how it works. Try the examples of...
That warning was put in by the original author of Flasher for the T3.2. I extended it to support all T3 and T4, thus the X,and always left in that warning. For T4, there is no way that you can brick the device, so it’s “safe” in that sense. If...
The buffer must contain the binary image, not the hex lines. Since the hex lines are being sent via Ethernet, you can either convert to binary as the packets are received, similar to receiving via UART, or you can write the hex lines to SD and...
I don't know what you mean by tether, or running the same sketch, but assuming you get the signals to do what you want, there might be minor differences in the start times and minor differences in the clocks on the two Teensy, but those should be...
You should have a delay between Serial.begin() and the first Serial.print(), like shown below. You'll see this in most of the TeensyDuino examples. Without the delay, the println can execute before the USB serial is up and running and capable of...
I think you could come up various ways of connecting the two Teensys, so the button signal that turns on the LED actually goes to both Teensy via RS-485, which is good for the types of distances you're talking about. There would be some small...
Don't use F_CPU, use F_CPU_ACTUAL, which despite being all caps is a variable, not a macro, and it gets updated even when you change clock speeds at run-time. You can search the forum for more info.
After reading through this entire thread again, one recommendation is to stop and begin again. Your first post begins with a rejection of the Arduino IDE. We all get why Arduino is a big let-down for professional programmers, which includes many...
Sometimes it is helpful to add Serial.flush() immediately after your debugging Serial.print() statements. This causes the print to occur immediately so you don't get fooled/confused about how far your program got before the problem occurred.
I was also a Modula2 user. The good old days!. The H file is analogous to the DEF file, but with caveats. Modula2 was "object-oriented", so the thing you were defining in the DEF file was like a C++ class. Your transmitPacket and receivePacket...
I went to the Adafruit learning guide, and it has a link to their SSD1327 library on Github. It's a library, with both CPP and H files, and you can install it via the Arduino IDE. Just go to the library manager and type in SSD1327 to the search...