Now hang on a moment... p1 is also a global variable and the ISR is using it to track the current write position? How does that work when loop() is constantly resetting it to the beginning, regardless of whether bufferdone is set or not?
This...
I think that's mainly because it's more flexible (allows any pin to be used as CS) and it's how the regular arduino SPI library was designed.
Teensy's SPI library does have a setCS() method to configure a CS pin to be driven by the SPI module -...
Which pin are you using for CS? I'm pretty sure it would have to be one of the specific SPI hardware CS pins for this to work, but also I'm not sure if this capability is included in the SPI library.
And what is value1? How do we know if it's statically or dynamically allocated, which region of memory it exists in and if it's cacheable? How can we know it's not being overwritten by some code overruning a buffer stored next to it? How do we...
You need to post at least enough code so that it can be compiled. We can't see how most of the variables are declared or know what their types are, we can't see where/how bufferdone is being set, we don't know how the value1 array is being...
You can write using this method as well (writing is faster than reading because there are no delay cycles required), I just didn't include the code for it in the example.
You can't use this method at the same time as FlexSPI access because the...
Yes... rewrite it because references don't work the way that code intends them.
References can only be "bound" at creation, so static SPIClass& SPIPORT = SPI; mean SPIPORT will always refer to SPI. When the SerialFlashChip::begin() later tries...
Sequential reading is much simpler/faster because the address only needs to be sent at the beginning. Then as long as you keep clocking the PSRAM (two instructions) it will keep delivering nibbles from sequential locations.
What really piques my...
That makes perfect sense, the temperature monitor panic alarm is set at 90 degrees to protect it from damage. You could disable it but it's not likely to survive operating at that temperature.
Teensy's startup code by default turns on temperature monitoring. If you use the tempmonGetTemp() function to get the current internal temperature, what values are you seeing?
Revisiting the original problem 4+ years later...
Looking at code from a different project, something very obvious occurred to me: why not bitbang the PSRAM instead of using FlexSPI?
I took the code from earlier posts and modified it:
#include...
Some of the info in the above posts might need to be clarified a bit.
Using digitalWrite() while a pin is not in OUTPUT mode will not set the future output level. This is because historically, Arduino did not have INPUT_PULLUP and INPUT_PULLDOWN...
You don't seem to be setting the selector registers (*_SELECT_INPUT_0) for all the pins? So some of them will still be trying to use the EMC_* pins instead of SD_B1_*.
Setting the pre and post divider for the SAI3 clock needs to be done in...
From what I gather, they're trying to generate some sort of TMDS signal using two GPIOs. The pink trace in the first picture is generated using a T3.5 but using the same code on a T4.1 is failing and generating the green trace.
If they didn't the default Blink sketch (that turns the onboard LED on and off) wouldn't even work.
You are not giving us proper information here, which makes it very difficult for anyone to help you. You need to give a proper description of...
Contrary to what that page says ("Servo is included with Arduino") there is a copy of the Servo library included in Teensyduino. It doesn't have anything like the error message reported by OP in Servo.h so I guess they must have a different copy...
I don't see how it is wrong. RAM1 is divided into ITCM and DTCM. The size used for ITCM is the same for both builds (32KB), but when PSTR is used there is less allocated data in DTCM so more space remains for local variables (stack).
It has the same issue, you are using an identical string in multiple places which would be replaced with one copy by the compiler if and only if the string is treated like a proper string literal and not wrapped with PSTR.
I have no idea what your ConfigError function does so no context for how the strings are used. Maybe they're ignored completely and the compiler is discarding them. Otherwise the strings appear to all be identical so the compiler would be...
Yeah PSTR has a habit of triggering that error quite often. I don't fully understand why, suspect it's some c++/compiler bug. It's really unhelpful that GCC won't actually state what the conflict is between the different section declarations...
That thread is bad advice because it no longer applies. Constant strings are stored in flash, but they also get copied into memory (and hence take up space) at startup by default.
On the Teensy 4.x the F() macro does nothing - forget about using...
The usb_serial_classX classes definitely have their own override. It's right there in the usb_serial.h header:
virtual size_t write(const uint8_t *buffer, size_t size) { return usb_serial_write(buffer, size); }
So that's why using the serial...
IIRC there were issues at one point with optional interface methods either not being implemented or not matching the correct signatures, so sending/receiving blocks of data caused a fallback to the default Stream methods that read/write one byte...
How exactly are you connecting the USB ports of the Teensy and CR350 together? I suspect they're both device ports, which can only be connected to host ports.
I think the SD card in particular might be more prone to showing issues when switching cards, since there is only one static SD FS object that gets reused when a different card gets inserted. MTP would occasionally hold open the file handle of...
Does all this testing involve removing one drive and replacing it with a different one instead? This was one of the major headaches I had when I played with it, because the disk contents was cached and MTP would present the wrong files to the...
Just to be sure I would add asm volatile("dmb"); after the digitalWriteFast statement that sets the pin low, to ensure that operation has completed before the end of the ISR. And also move it out of the if clause; you are unconditionally setting...
Retrieving/assigning the volume label, for one thing. Also retrieving the max supported filename length and checking if the FS is read-only without actually attempting to write something.
What I would propose is one simple extendable general...
I doubt you can just mash the interface descriptors together and still have it be recognized as both devices, especially because a real xbox pad wouldn't have a serial interface attached but also because the driver would claim the entire device.
If you wanted to try a different USB mass storage implementation, I have an MTP sample in my repo. I added extra handling to try to make it gracefully handle the device being hotplugged although there are still issues that can only be addressed...
You might be thinking of a recent fix for USBHost that had some functions not marked as pure virtual, which caused build errors when targetting Debug.
The problem with the Wire library sounds like indeterminate static initialization order which...
I have wondered for a while if the FS class should have some sort of FriendlyName() function that identifies the underlying filesystem type, or maybe a generic ioctl() function that would allow individual FS implementations to support additional...
In that case the information it gives wouldn't be worth anything, since different compiler options can greatly influence what gets included in the final build vs what gets optimized away. Even the way structures are packed can be changed by...
It's not. If the size is >=4GB the compressed object size should be set to 0xFFFFFFFF and the actual size retrieved using SendObjectPropertyList (which uses two 32-bit size fields, upper and lower halves of a 64-bit value).
There's also an...