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...
Something odd for sure. Seemed all 4 threads were doing Alloc with post #29 - then some change and only thread 0 and 4 made repeat calls. Then the change indicated in p#30 and then only thread 0 and 1 are active?
...
According to the header file:
bool begin_I2C(uint8_t addr = BMP3XX_DEFAULT_ADDRESS,
TwoWire *theWire = &Wire);
I would try this:
bmp.begin_I2C(BMP3XX_DEFAULT_ADDRESS, &Wire2);
I had the same experience. Made a small, valid change to a working program, and the program stopped working completely. What I think I see in the test results are that malloc() only works (for some undefined time) after...
Hi!
Go here:
https://github.com/DD4WH/audio-guestbook
Scroll down to the section "Compiling the code" and follow the instructions 😀.
Good luck and success!
PS: check your sketchname for typo! Guest, not guist...
Thanks a ton! The mask fixed the issue for channels C & D! I knew it was some dumb mistake on my part.
As for the phase shifting, I did see those resources, but it was my understanding that the Teensy 4.X boards...
Hey, I am making this aswell. I am currently stuck at another section;
In the beginning of the code it says:
#include <Bounce.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include...
I've created a new TeensyLC usb type that emulates an off the shelf device. I've completely tested, and that code is working. When I plug the new Teensy device into a host, the host sees the Teensy as the off the shelf...
Thanks for your reply.
Approximately how long should it take after releasing the button?
Edit: I've got it now. It wasn't working with the 10000mah USB battery is was using.
Solid red light remains for about...
Hold the button until you see the one led just blink and then release it, It should then show that LED lit up for awhile as it reprograms it, and then you should get the blink (the other LED) program on it running.
I've had Teensy 4.0 since it was introduced, recently got a 4.1. I never got around to trying the Automatic Recovery feature.
I've tried it a few times, and haven't gotten it to start running Blink.
I hold the...
@KurtE
Just gave your updated sketch a try and without turning off debug or changed data"
$HIB:ff0d0000 type:2 min:0 max:255
Digitizer: &usage=100(in:FF000100), usage_page=ff00, value=0(0)
Digitizer:...
I pushed up a quick and dirty version: https://github.com/KurtE/lsm6-arduino-Teensy-I2C/tree/Wire12
That is for example with the example sketch:
LSM6 imu; // Will use the wire object
LSM6 imu(Wire1); // will use...
I have done a little more hacking since then,
Including change @mjs513 mentioned.
But also then doing some hacking for the longer version, which is still not right, but gives some more tools to help.
That is...
Just tested it, my setup needs some 200ns delay to get a stable readout.
Here the test code I used to read out the 3x5 encoder-array shown in #6.
#include "Arduino.h"
#include "EncoderTool.h"
#include...
Have you thought about using the EVE4 controller with 5", 7" or 10" display? I've been using an EVE2 5" for years in my race cars, and have just moved to an EVE4 7" display with the teensy 4 (1026x600). More than...
Looks like this should work. Adafruit's library is designed to work with any I2C port, so you shouldn't need to use "#define Wire Wire2" or edit the library to change "Wire" to "Wire2", as is needed with older...
The mask for the C/D FLEXPWM timers is ALT 2 (ref page 515)
*(portConfigRegister(ChannelC)) = 2;//Maske;
*(portConfigRegister(ChannelD)) = 2;//Maske;
See https://www.nxp.com/docs/en/application-note/AN4485.pdf ...
Thanks for your advise. Will look into the mentioned library. Any idea how to get this talking to a script that produces the correct control messages to the DAW?
About the "start small to get a feeling for it", I...
Just added: ftrias/TeensyThreads/issues/38
It was not giving threadsInfo on LAST thread.
Something isn't working as expected? I added int* me in code below - output changed drastically and makes no sense - how does...
I guess I don't understand this part. In my test program (update below), the blocks are allocated in order from lowest to highest address, but with some failures among threads other than the main thread. Error pattern...
If all instances of Wire have been changed to Wire2 this could be removed: #define Wire Wire2
Has this been tested to work on Wire with the appropriate changes?
> proper pullups and wiring?
Some i2c Devices...
Thanks again, defragster. I will test many allocs and frees from different threads and check the pointers to see where the memory is being allocated in the ram.
Hello!
Recently, I have been trying to get data off a BMP388 using pins 24 and 25 (SCL2 and SDA2). I cannot get anything to work. Here is the code I have been using. I really need help.
#include <Wire.h>
#include...
As noted p#11 the first caller to malloc() sets baseline ptr* brkval - that is the 'logic' behind the main thread alloc 'hack':
if (__brkval == 0)
__brkval = __malloc_heap_start;
cp = __malloc_heap_end;
if...
You are correct! That's the exact same behavior I was noticing. In my case I have tested with only the main thread + 1 created thread. Sometimes the thread 1 is unable to allocate memory, but if the main thread tries to...
Please provide a complete/short example showing incorrect function.
If usage was in error forum may help clarify, if the code really is in Error then it needs to be corrected.
Hi,
Firstly, I love the Teensy 4.1.
Although using EEPRPOM.put and EEPROM.get don't throw errors, they do not seem to work correctly.
I've had to use the old EEPROM.write and EEPROM.read methods, with the old...
Thanks, Defragster.
After some thought, I came to a similar conclusion. It looks like my code made frequent, unnecessary passes through this code and timing could well have made the difference. (There were many tests...
If I use 0x483, and recompile, Teensy Loader shows the following:
$ ./prog_teensy41.sh
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy41.hex": 22528 bytes, 0.3% usage
Found HalfKay Bootloader...
Setting this seems essential: InChar = 0; // Added to fix crash after updating to IDE 1.8.19
When called without any Serial.available() if the prior exit was with:: if (InChar == 10)
It will enter that...
At @KurtE's suggestion I changed line 234 or so to <10 so it should look like this
void Intuos5Controller::hid_input_end() {
if (debugPrint_) Serial.printf("$HIE\n");
if (hid_input_begin_count_) {
// now lets go...
Built the teensy_loader_cli and not sure if I am quite invoking it correctly.
./teensy_loader_cli --mcu=TEENSY41 -wv blink_slow_Teensy41.hex
Unfortunately something is set up wrong in the vm. All I get is a...
still no side buttons. also i don't see my stylus buttons reported anymore in the flood of data...
question: do you also get a huge amount of serial data when you don't touch the tablet at all? mine is sending out...
ok, i have finger tablet to serial interaction :)
here is the output on serial monitor, when i touch it with my fingers:
HPID(64): 02 04 02 90 A1 FA 62 03 5A 00 03 94 78 EA A9 03 6A 00 04 90 B5 DF 7B 04 62 00 06...
Thanks Kurt. I've solved the problem but it leaves behind a puzzle as to why my code ran, bug free, when compiled with 1.8.10. I've greatly simplified the culprit procedure below. Adding the final statement, InChar = 0,...
Opps - I hesitated asking the obvious ... are there any interrupt functions involved that should not be in FLASHMEM.
The Teensy's 1062 has 32KB code cache - so maybe it can get away with it for some time if it stays...
Hey everyone, I am trying to get 4 PWM channels (2 sets of complimentary signals, with one pair phase shifted dynamically.
Below is my current code, it is built from code I found here, as I cannot find any...
Can't get the usb to stay connected in the vm. The changing modes of usb during programming are confusing the QEMU/KVM. I keep seeing the usb device disappearing.
Do I use a) Teensy Ports /dev/ttyACM0 Serial...
Now I am feeling very stupid. After I was adding more unrelated code (for the PDP1) more functions in the Vectrex menu part started to freeze. So I decided to remove the FLASHMEM on all functions in this module. While...
I hope you can understand nobody can say specifically what the problem is with an unseen PCB. The best we can do to help you is offer some suggestions of tests to perform and explain what the technical meaning of those...
The Program signal was High before pushing it in my previous measurements but now after you asked me I checked again and the Program signal is low (tens of mV) before pushing it.
what could be the problem?
malloc() will report that no memory is available if the requested allocation will collide with the stack, as defined by the value of the stack pointer at the time of the call to malloc(). With TeensyThreads, each thread...
Set up an Ubuntu 20.04 VM. Looking to attach the USB port. In $ lsusb, I see something showing up as Van Ooijen Technische Informatica Teensyduino Serial. Hoping that is the correct device to connect to.
$ lsusb...
Here are the forks:
https://github.com/01-BlackHawk-11/lis3mdl-Teensy-I2C
https://github.com/01-BlackHawk-11/lsm6-arduino-Teensy-I2C
What I had in mind was adding a variable that stores the wire address like...
Are these the sensor libraries you're really using?
https://github.com/pololu/lsm6-arduino
https://github.com/pololu/lis3mdl-arduino
If anyone is going to go to the trouble of editing these to properly allow...
Quick note on the above: The inputs are coming from two different interfaces.
I am pretty sure the long ones are coming from Interface 1: Here is my dumping of that Descriptor,
HID Report Descriptor (0x20009c90)...
Well, I'm happy to hear that we're not alone, but sad to hear that this issue is not isolated to us.
Would you be able to run the the test sketch I posted on each of those working boards to see if you have full pin...
Unfortunately, no. The addresses I have are (probably) meant to be private.
I sent an email around the time I wrote msg #4. So far, no reply. But it's only been 2 full business days. Remind me later this week and...
Maybe the Linux version of teensy_post_compile should check if the udev rules are installed?
Until recently, this program was only delivered by the Teensyduino installer which checks if the udev file is present and...
I'm in the same boat with the MicroMods. I ordered 4 test boards and an ATP back in October and have been using them since. I completed a MicroMod version of a product I've been developing on the Teensy 4.0 for some...
Hard to say: Note the data I am showing is how do I put it encoded... That is Wacom tablet, plus I am getting some interesting HID parsing stuff, that I don't understand yet...
Note It is not significantly changed...
Thank you for the reply, Paul. I've always been impressed how active you are here, and how much you stand behind what you've created.
Which, btw, I absolutely love this platform. Thank you for creating it.
I...
The order doesn't matter with the WS2811 protocol. Each LED effectively works by "taking one signal and passing the rest on", so what you are planning to do will work no problem. Yes, you will have to reconnect all the...
it seems the D108 value is part of the pressure of the stylus. normally the range would be 0-2048 here i only get 8bit of info, so i am guessing it is spread among two bytes and this is the high bit part.
when i plug...
ok output changed, i get this when i move the stylus. still no side buttons/touchpad functionality.
begin, usage=D0000
type= 2
min= 0
max= 255
reportcount=9
usage count=0...
We do use the SDIO interface to communicate with the card, so I will take on your suggestion to use SD.mediaPresent to check if it's still there, and I'll reserve the card detect pin for later if it ever needs to be...
WORKING - back on Windows 11!
Now Com18 instead of COM6.
Found a BLUETOOTH ??? device also on COM6
Device Mgr remove of the Com6 devices didn't do it.
Used RegEdit to search "COM6" ignored Bluetooth ......
Yes, I tested it. Works nicely.
However, the board from the GitHub repo has a missing GND connection (need to fix that some time...).
If you are using a T4.x make sure to wait some time after switching rows, the...
This is one of the functions I needed to remove the FLASHMEM to avoid the freeze. As a sidenode it although worked after reducing*the input checks from 12 to only 3. Therefore I assumed that it might be an issue with...
This is indeed the default (no threads) behavior for Teensy 2 and 3.
On Teensy 4, the default has the stack start at the top of ITCM (RAM1) memory, and the heap is located in RAM2 memory.