My solution was to edit the 6 control files in the Audio library like this example for one of the files:
#include <Arduino.h>
#include "control_sgtl5000.h"
//#include "Wire.h"
#include "i2c_t3.h"
Perhaps...
@Paul: just created Teensy-4-x-Hooks-before-setup()
> note the time added for PSRAM:
#ifdef ARDUINO_TEENSY41
configure_external_ram();
#endif
@CollinK: also there are notes on startup timing and while looking...
Below is a sample sketch that shows creation of local hook() functions called before entry to setup as the Reset process proceeds.
It makes some notes on what can be expected to work in each of the three hooks and...
I think that's correct. It's not just TeensyThreads, but rather any RTOS with a stack per task. And T4.x is okay because it uses smalloc() rather than malloc?
I tried this malloc alternative...
Hi, I am trying to use the i2c_t3 library (found linked on the Teensy website i2c page) to do fast DMA based i2c to control an LED driver.
Simultaneously, I am trying to run an audio library program.
Because the...
Best I can offer you the number of times the 7 Teensyduino software files meant for Arduino 1.8.x use have been downloaded from the PJRC website over the last 14 days (our server retains only 2 weeks of log files).
...
PaulStoffregen yes, it is one computer. I only own one "real" computer. It is only 8 months old. i7 32GB RAM, 1 TB NVMe SSD, relatively modern. System76 with PopOS 22.04 installed on it now. Originally it had Ubuntu...
Thanks, taking out the call to Serial.begin really did cut down the start up time. Now I can get output within 1/2 a second of boot time as reported by millis(). That's probably fast enough for my uses. The problem I...
Forgive me, as I haven't kept up with every message (been really distracted by supply chain issues), but is this problem confined to just 1 laptop computer?
Regarding Arduino CLI:
Today Teensyduino support...
Defragster, I tried to run the code with the modifications you mentioned in your last post (#48) and could also reproduce the behavior you have shown. Very weird. I have no idea what caused this.
That's...
Remote execution of Arduino and TyCommander on an RPI4-64 bit works ok, albeit slowly. Seems ridiculous to me that a sub $100 computer and SSD run the code just fine and a $1500 laptop with much fancier HW can't. Have...
Did a quick edit to setup for Alloc/Free and no diff now in current code - except the indication of TThreads data issues.
Works with 80 and fails with 100 stack DWord edits.
...
Thread 0 malloc 1024. Addr =...
Yes, I know he is busy. Unfortunately, I am busy with getting this stuff to work without it dumping its bits all over me!
Wondering if there is a USB controller test of some sort that doesn't require cooperating...
I'll go through the whole thing, might be a lot of stuff you already know, but clarity is nice for other readers:
So basically a Position Loop of a servo drive has two numbers it cares about and
It runs a whole...
interesting but I don't know if I fully understand. is the servo drive the master for two SSI channels and it thinks there are 2 encoders (slave) ?
but you are doing something where there are not encoders but you...
When working with a 3v3 microcontroller, the VL input needs to be 3v3 so it expects and presents the correct level to the controller. The voltage at VA determines the analog voltage used as reference for analog audio...
Sorry I am not Paul...
But as for USB Controllers? I am not an expert, but I know on my older machine (now being replaced by my not as older machine), it had a USB 3 controller in it, that was not
100% complete to...
Oof, looks like a bit of work to get that going, but it's doable. One quick question, is it effectively a complete new install unto its own? (Independent of any existing installation?)
When you originally worked on...
I tried a few more things, including having the thread stacks on the stack of the main thread, and I think the fundamental problem is the same. If you call malloc() with different stack pointers, you can overwrite...
I wouldn't be surprised if this were the case. I have seen the crash problem on both the active hub and a direct connect, so I think it might be the laptop USB controller chip. The hub is powered by a 4A power supply...
Based on this note code was added when threads start:
void thread_loop( int threadID )
{
//bool fail = false;
uint32_t fCnt = 0;
#define STK_CHK_SIZE 80
int stkSig;
for ( int ii = 0; ii < STK_CHK_SIZE;...
UPDATE: Solved it... I guess third time's a charm because I put in a 3rd MAX3485 and things started working!
I wasn't aware that my RX line going low with the enable line was wrong. I saw the "break condition" in my...
Maybe try using Arduino CLI. It's not as lightweight as a makefile, but you do get excellent compatibility. Newest Teensyduino 1.57 packages for CLI / IDE2 are supposed to detect if you're running headless and avoid...
Can you install sw and run in a live system? I guess it would remove all other "rogue" software on the system... Kind of painful to go through all the configuration for a one shot deal, but maybe worth it.
The cli...
I personally would suspect some kind of hardware issue, possibly related to a ground loop, or a very hardware-buggy USB controller chip (especially if early USB 3.0 one).
(My bet is that the powered USB 3 hub draws a...
Made a script for the teensy_loader_cli with an argument for the file name. Makes it a little easier to use, instead of typing out all the arguments.
Name of the script is progteensy. Make it executable....
As yet another data point, eliminating all of the middle-man interference introduced by your VM environment, what about booting from a "live CD/DVD" & trying to program your Teensy from that, as the closest thing to...
Sorry, have no idea what did not work means...
Also the one warning, I left in as it was there before and the owner should look at it and decide if just adding a default: break;
is OK or was he supposed to something...
Built the loader cli for the real machine. As expected, it seems to work fine. (This time.) I will try to figure out a way to get this into my work process. Compiling to hex seems to pop up the teensyloadergui. It...
Can't see much of the code in your screenshot...
Did you also change Wire.begin() to Wire1.begin() in your program? Looks like this library doesn't call the Wire library begin function, so you need to do it for the...
This time I abandoned whatever KurtE suggested (I think I've overloaded the constructor aswell). And this time I worked by the solution provided Richard Gemmell himself:...
Was hoping to use a virtual machine to isolate me from system crashes. Programming my Teensy seems to cause system crashes which turn off my laptop power supply. The OS leaves no significant record of what happens...
Virtual machines cause a lot of problems. They tend to work fine for "normal" software. But for hardware access, there is a pretty incredible amount of emulation code between you and the real hardware.
I checked for modemmanager, which I had previously removed, and it was present in the vm. So I ran $ sudo apt remove --purge modemmanager. However, this did not change the behavior of the teensy loader. It still...
I'm looking for three Teensy 3.5 boards for an existing project. Will pay $$ or I can trade for 3.6 boards. I understand supply and demand, so if you have some, don't be afraid to make me an offer, no judgement. ...
No version of programming a Teensy 4.1 seems to work under the vm. Rather disappointed. The gui method simply says there is an error.
The cli version simply hangs in a loop. In both cases, I pressed the "reset"...
If the root cause of trouble is overflowing the allocated stack space (just a blind guess), then moving the stack allocation somewhere else where you're less likely to overwrite anything important would (probably) make...
Possible, yes. As easy as just clicking the USB Type menu, no, at least not for Joystick together with Audio. For that, you'll need to edit usb_desc.h to create a custom USB type.
Ok, so I was thinking about this:
And came up with an crazy ideia that (at least in my testing) worked: What if all the threads stacks were above the top of the heap, like it is natural for a stack to be?
What I...
I have tested all the codes posted previously but haven't had success in being able to reliably malloc() from any thread at any time, without needing to malloc() from the main thread in order to "unlock" the malloc to...
I am working on a Teensy 4.0 Project that has an SGTL5000 Audio processor but also has numerous other functions. I am using the Teensy Audio library, complied with the USB Type "Audio", and the audio functions work...
Did a quick edit to store strings for thread 0 to print - and had each thread yield after one try and only try in turn if their number was up - then pass turn to next thread ... in the process it went odder at each step...
Maybe you have Serial.begin(9600) in your program?
On Teensy, Serial.begin() tries to wait for the Arduino Serial Monitor to connect. It waits up to 2 seconds if your PC begins the USB detection process (called...
USB HID Device Info Program
This Sketch shows information about plugged in HID devices
*** You can control the output by simple character input to Serial ***
R - Turns on or off showing the raw data
C - Toggles...
Look at the xy() function in the OctoWS2811 examples.
This is the one from the File example (in Arduino, click File > Examples > OctoWS2811 > Fire)
// A simple xy() function to turn display matrix coordinates...
I tried searching for a previous answer but could not find one. Maybe my google-fu is weak...
I'm seeing that it takes about 2 seconds for my sketch to start being able to operate. I plug in USB and nothing happens...
I would imagine you'd write the channels mask to the MCTRL CLDOK bits to zero the LDOK bits for all the timers you wish to alter. Then write your new settings to some or all of the 6 timing registers. Repeat for each...
Okay that is the last code I started with - but minor edit to remove 'warning' and (void*)i+1
for (int i=1; i<=threadCount; i++)
threads.addThread(thread_func, (void*)i, threadStackSize); // stack alloc'd from...
Each square is really just the same thing as a 256 long LED strip laid out in a zig-zag pattern, as you can see from their diagram. The OctoWS2811 library doesn't care about the layout of your LEDs, it just provides a...
Doing some or occasional malloc from main thread seems to “unlock” the heap for malloc by the other threads, but I don’t think it’s meant to work that way, and it works only “accidentally”. It never makes sense for top...
Hi All,
I'm working on a project to control some servos with Automation Direct's SureServo2 line of products and I am running into an issue I can't seem to resolve.
I'm currently using Paul's Modbus RTU Library...
I strongly suggest including a test setup for coding.
I would look at https://forum.pjrc.com/threads/70264-EncoderTool as an example.
A 2 by 2 or 2 by 3 setups on 1 or 2 breadboards seems the minimum for me for...
Thanks
"Since querying all the encoders for changes would be a bit tedious, I use the callback onEncoderChanged which will be invoked whenever one of the encoders changed its value. "
You could pass "this" as a...
Not looked deeper but: Problem seems malloc expects to own the RAM space as it understands it based on that first call setting the base pointer - and the main and threads have unique views with regard to stack and the...
I don't understand. What do you mean by "nothing magic"? In my testing, if I comment out the preliminary allocation from the main thread, it doesn't work. If I let it there, it works. Isn't it related to the first...
One other thing I tested was to sometimes free the heap space allocated by the threads and check if new allocations were able to use the empty spaces left on the heap. As far as I could see, it works. So I think malloc...
Hello defragster and joepasquariello!
I have been experimenting with your codes and making some small modifications to try to isolate the problem and find the root cause. Thanks very much for your help so far! :)
I...
I'm assuming you're editing this line when you connect the wires to pins 18 and 19?
if (!bmp.begin_I2C(&Wire2)){ // hardware I2C mode, can pass in address & alt Wire
But I can't see your screen. Maybe...
Hello,
I am trying to get a Teensy project working in the Visual Studio/Visual Micro environment. It does build properly in Arduino 1.8 & also in 2.0.
I had to stick the following line in the Visual Micro...
It seems like even if it works, it's not going to work as expected when the stack pointer for all threads other than the main thread is below the top of the heap. Can you comment on that? One of your first suggestions...