Thanks for everyone's suggestions. Think I will try a virtual machine and the teensy loader. I'm hoping that the vm crashes, not my laptop. Ultimately, it would seem that using the cli would eliminate any gui as a...
Yes, TeensyThreads uses "new", which maps directly to malloc(). But there is also the option to provide an already existing buffer to serve as stack for the newly created thread. In my full code, I am already doing...
Hello all. I'm new to the world of Teensy and have a pretty basic question. I searched the forum first before asking this and saw where the question was asked but there were zero replies. Hopefully, someone can help me...
Looking at TeensyThreads.cpp, no malloc - just :
threadp = new ThreadInfo();
stack = new uint8_t;
Added threads get default 1K or specified Stack and Thread0 main loop() gets 10K.
Not sure what...
Malloc seems to have the idea there is one HEAP - but each Thread seems to have some reserved space from RAM - how that is allocated would be shown in TeensyThreads? Does it do malloc() for the requested Stack space?
...
Please correct me if I am wrong, but my understanding is: the heap and the main thread stack are placed at opposite ends of the memory. The heap grows up and the stack grows down. We don't even know if the stack and...
First, install Teensyduino 1.57. Version 1.56 and earlier had MSQ output, which is basically PWM but with extra noise shaping stuff. Versions 1.57 adds PWM output for Teensy 4. But you still might prefer to use MSQ. ...
Maybe run commands to uninstall and reinstall the teensy board package? Maybe if run with the verbose flag, info about *why* arduino_cli didn't install teensy-discovery might be shown?
Opps - too long since then. Thanks for detail reminder
Suppose 15s Wipe was working - but prior times Loader was open with code to reinstall
Still have to go back to Win 11 and see if it can get cleared to work...
This is expected behavior. The 15 sec button press only wipes the flash memory on Teensy 3.5 & 3.6.
Teensy 4.0 & 4.1 added the "restore program" which is written into the flash after fully erase. But the older...
Fun Update - On the porch with Win 10 Laptop that probably hasn't seen the old T_3.5
OLD_T_3.5 seems to work NORMALLY here
Tried three 15s Restores - finally wiped the code - but not running factory Blink
Next...
I'm not aware of any production flaws or problems. I can tell you every board was tested with a sine wave diving a 10 ohm resistor in the test fixture, though the test lasts only about 1 second.
If you believe it's...
I saw similar funny # for Remains
This MIGHT be a work around - but it might just give way to another issue later on.
The malloc code uses those fixed points for REF and it isn't clear they are valid when...
That's a very interesting take! So a "quick and dirty" workaround for the issue would be to allocate "X" bytes of RAM using malloc in the main thread before adding any new thread, which will initialize some internal...
Exactly! I have performed some of those tests myself and also couldn't find any clear relationship between the stack size of the threads and how many bytes could be allocated using malloc() inside the thread before...
Mjs513, that's correct. The issue of memory leakage, calling malloc() without calling free() would crash the sketch anyway under any circumstance. My ideia was just to show that malloc() fails after I allocated around 5...
BTW: In testing I made a LARGE Flash code test and that worked. So, it has to be some specific problem code that runs from Flash when it conflicts
That code github.com/Defragster/T4LockBeta/tree/main/Code4Code was...
thanks, had a chance to play with it now. here your new version has the same output as the version yesterday. only "mouselike" output from the stylus, no absolute coordinates, side buttons are not working (no serial...
Also - OLD_T_3.5 is ignoring the 15 second Restore as that was timed and tried about 6 times. with timer at 14,15,16 seconds.
It seems 'something failed' on OLD_T_3.5 - except it worked when I went to DUAL Serial, so...
I want to modify those libraries in order to pass other I2C buses (Wire1 or Wire2) instead of the default Wire. The libraries are LIS3MDL and LSM6. I use the Teensy 4.1 I2C library as well by Richard Gemmell. I would...
Yes, many pitfalls. It seems like dynamic allocation will work only if it is limited to the main thread, where the stack pointer is the system stack pointer. Probably a good idea to also limit Strings and printing to...
I am playing some more with the older Intuos tablet and looking at some of the Linux stuff more there lower-level Input project...
I included the current version, that at least is showing some data...
Note: With T3.6 you do run into issues of having to hit the program button at times. I tried it with IDE2...
But did not lose output.
The interesting thing is, that if you start from a fresh Teensy, when I...
Sorry, I have no idea.
But if you have some examples of a functions that when run from FLASH that causes it to hang/crash, that you can post, maybe something might
give us hints on what is happening.
@defragster,
I am not sure I understand. Probably I have not had enough coffee yet :D
With this are you doing this with TyCommander? and/or are you doing it with the Serial Monitor stuff of Teensyduino?
If...
I don't know of any such guide for using the SD library, there may be one for the SDFat library that SD is now a simple wrapper of.
SD.begin() - I typically only call once. Now I know some have stated that if you...
At this point not sure what to tell you.
If you have something like:
KeyboardController kb1;
KeyboardController kb2;
...
void setup() {
...
kb1.attachPress(OnPress);
kb2.attachPress(OnPress);
...
Some of the answers may be found in the original thread started by @ftrias: https://forum.pjrc.com/threads/41504-Teensy-3-x-multithreading-library-first-release. Going through it I did find where he gave an explanation...
Pulled out a T_3.5 - used quite a bit in past for past testing - not used in Months++
- Once cut VIN<>VUSB - now soldered again
- Top side Female headers in place
- No problems when last used
>> This is Win 11...
Thought that might be the case - and if it isn't auto restarting then CrashReport code may not get called in this case.
And if the Button won't go into Program mode it seems the MCU is 'offline'?
If there is a...
Is there any guide on best practices for using the SD library?
For example, should I call SD.begin() each time I want to write to the card?
Or, what's the best route of logic to handle card insert/remove? (I have a...
I didn't post the code - but the p#9 alloc_func() was just called from setup() in the existing code - then it no longer acted the same when called from the Thread.
The malloc code has some dependencies that may not...
So far the only way I found to get it out of this state is a full power cycle. Therefore I cannot get a crash report. I haven't tried adding a watchdog yet.
malloc() works as expected in the main thread (loop), but not in the thread created via addThread(). Something to do with that thread's stack having been allocated from the heap?
Firstly, it's truly wonderful I can use the audio library in the LC.
I'm hearing a weird behavior when trying to mix the noise synth with an oscillator. (two oscillators in this example)
The noise generator seems...
Indeed, the malloc() code does do something on first call with regard to finding and using a HEAP to build on?
Adding this to setup before starting the thread - whatever is allocated here is then available for alloc...
Good to know it is TSET and not just this system.
It is probably path inclusions of: "%LOCALAPPDATA%\Arduino15\..."
> in : ...\TSet\TSet.cmd2
> the same one that BREAKS when that folder fails to exist.
echo...
Prioritize the KeyboardController objects to HID devices without a Mouse Interface
So
KeyboardController kb1;
KeyboardController kb2;
Scenario: Mouse gets plugged in first, wait some times for another keyboard...
Sounds good.
But still might be nice to get the debug data I mentioned from the other thread. Yes, mostly a lot of the same information.
But would be good. To see for example are the HIDParsers grabbing the...
Yes - I sort of noticed that earlier as well. I know Paul did something to fix it for 1.57 proper but was not sure if it was something in like platfrom.txt or something within their build.
Have not seen that reported before.
Does the Teensy do a Restart after the 'freeze'? If there is some 8 seconds delay and a restart it may be from a usable gathering of Crash Data.
Try using CrashReport to see if...
@KurtE - my computer didn't stop my getting to the post #20 'downloader' (and didn't see an obvious attack) it displayed an HTML that won't attach as a file. Here is a TEXT copy of the content.
USB-Verbundgerät
...
Basically I'm not using the SPI as SPI, but faking the SSI protocol. for an 24 bit SSI comms, it turns out if you set the SPI bus to 26 bits (n+2) and then shift the data 1 to the left (data<<1) it basically works as...
it's a curious system but I feel it should be possible. You'd need to refer to the datasheet and make your own copy of the library and adjust to use one of the other SPI peripherals.
I copied the library to make...
I have a somewhat larger code base that runs emulations for multiple different old arcade vector games. While the emulations part itself is time critical there are although part of the code that are not. like setup,...
@KurtE / @mjs513 : using TSET CMDLINE build is this seen?
The UnZip install of TD 1.57 was done - and The IDE 2.0 is installed - but cannot run to update?
Not sure of the relationship of TD IDE 1.89 .vs. 2.0 -...
Well in this case, I'm only doing single data packet (26bit) transfers in response to a non-continuous clock signal. Basically using it to fake being a 24bit SSI encoder.
it all depends on how long your interrupts are, and the speeds of the SPI obviously especially when pushing data. if the slave interrupt is not ready to receive because of another interrupt you may lose data. Your...
Sorry, my anti-virus stuff does not allow access to that site to look at it...
Also, in this thread: https://forum.pjrc.com/threads/70824-USB-host-Teensy-4-1-with-Wacom-Intuos5?p=310597&viewfull=1#post310597
I put...
Hello
I want to use teensy4.1 to play wave file from on-board sdio, and output as PWM (wave frequency range mapped to PWM duty range).
The audio lib seemed to be a good place to start. However I soon found out:
...
I also ran the code on 3.5 and got the error. If I move the malloc() code from the thread function to loop(), it runs okay there until memory is exhausted, so there is something about how threads and malloc() interact....
nothing is generated when i press the side buttons.
if i don't do anything (no stylus or fingers), the tablet is just connected i get these messages
USB Host Testing
960
USB2 PLL running
FYI - I have an Intuos 4 cheapy... And the messages are all different. I think the main stylus was lost, I get some information from stylus from old Bamboo.
I have another arriving next week.
Looking at some...
We have several test boards, some assembled in house, some at JLC as well as the Sparkfun ATP - no matter which board it’s in - get the same issues.
On the ATP every now and then it wont establish USB communication and...
Two seperate SPI busses, with the Teensy behaving as slave on both of them.
Don't most processors have some form of interrupt scheduling / something to manage two interrupts happing at the same time or close...
this library setups only one LPSPI as slave. Even if you managed to setup 2 or more slave on LPSPI you'd need to be able to manage the 2 ports simuletaneously, and if interrupts are involved, good luck
Sorry debug in distance:
I updated the code slightly in sketch's header file:
In Particular the message:
No Driver claimed topusage: 10002
Typo: was missing the 0x on the define... I probably should just put the...
thanks again for your continued effort.
this is what i get from your sketch (with debug enabled in USBHost_t36.h, and the changes in digitizer.cpp you mentioned before, i can also revert those if need be)
USB...
Just uploaded your code snippet to the Teensy3.5 and yes I got the same results as you did using "printf" however if you change it to just "print" it works, i.e., continuously prints "Threads print"!.
The...
Thanks @defragster for the previous post link.
As I read the post, it leaves one with the impression that running at 600 MHz limits the Power On Hours to about 3 years. That is only the case if you are have a...
Note WIP, to maybe easier debug this, I extracted the digitizer class for now and created a new version of it as part of sketch (second tab).
Where I hopefully will grab your tablets different top usage values and...
Thanks Joe! I will definitely give this library a try.. I think the whole code will benefit from it. Unfortunately, I will still need to use malloc() or new for things like Strings and objetc constructors, so the...
HI Mark, thanks for the answer. I don't have access to the code during the weekend, but I didn't change any compilation flags or settings, they are all default. I used platformIO and later installed a fresh copy of the...
I had a request via PM for an example of how to use the new Dynamic AudioConnection feature introduced in TD 1.57. I've done PR#441 for eventual inclusion in some future Teensyduino release, and have also attached it in...
thanks for your inputs.
just for clarification, since i am a bit confused.
i made the changes to digitizer.cpp and looked at HIDDeviceInfo sketch again (your version)
it looks like this now:
USB HID Device...
I have been changing PDB0_MOD to see how fast I can get the FFT.256 going.
The teensy 3.5 I am testing on hangs when PDB0_MOD gets to 1023.
I have changed CPU speeds including overclock.
I have used USB 2.0 and...
Thanks @Neal for the DOC link - that is the one searching on 'AN12253' found on this prior Jan 2021 thread: pjrc.com/threads/65768-Teensy-4-1-CPU-Heat-Limits
Again as another reference you might try the teensy_loader_cli: https://github.com/PaulStoffregen/teensy_loader_cli
Which you would need to build on your machine and see if it also causes you to crash or not.
With the SAVED HEX file safe in a known location the Teensy Loader can 'File / Open HEX File' - that was the context of Post #25
Sorry, did not document the IDE : 'Sketch / Export compiled Binary' { Ctrl + Alt + S }...
One interesting point that your output shows: 05 0D // Usage Page(d) - Digitizer
Versus the one I have: 06 0D FF // Usage Page(ff0d) - Digitizer
if you look in digitizer.cpp
hidclaim_t...
I think I began using the library below to reduce code size associated with printf(), but the documentation makes a point to that it is not only small, but also thread-safe and does not use malloc().
...
I don't have any personal experience with the T3.5 (I've used T4.x for all of my projects). What optimization level are you building at ?? Does changing the optimization level cause any change in the resulting...
last post from me for today..
this is the stream i get from HIDDeviceInfo (your version), when i have debug in USBHost_t36.h disabled.
USB HID Device Info Program
This Sketch shows information about...