Tim - haven't experienced that in a very long time now. So far this is the first occurrence I have seen, since first getting the board. Specifically, the audio examples.
I don't have any problems - but I'm using TY.
Tim - haven't experienced that in a very long time now. So far this is the first occurrence I have seen, since first getting the board. Specifically, the audio examples.
Morning Frank.Thank you for testing!
The Wavetable-examples need a "PROGMEM" before the const tables - I'e done that for Zelda and "Simple", but hear some clicks (with headphones) - don't know what that is. Never tried that on a T3.
Can you try the other wavetable examples and add the missing "PROGMEM" to all of them? (and create a pull-request to the repo?)
PlaySynthMusic works for me without problems.
Updated the repository.
Cool, did you try reading as well? That was much slower than writing on the 1050.
uint32_t t = ARM_DWT_CYCCNT;
digitalWriteFast(11, HIGH);
int val = digitalReadFast(12);
digitalWriteFast(11, LOW);
t = ARM_DWT_CYCCNT - t;
variable pin constant pin FastWrite/Read
T3.2 115 cycles width 700 ns 18 cycles 16.6 ns 2.44v
T3.6 110 width 350 ns 11 cycles 13.4ns 800 mv
T4 180 cycles width 210 ns 75 cycles 120 ns T4 beta 1050
[B]1060[/B] 114 cycles 127 ns 49 cycles 74 ns
[B]fast GPIO6[/B] 13 cycles 20 ns
Thanks @defragster,KurtE - something goes wrong … I was here and looked down and the stars were falling slowly if at all - I restarted and left - and they were stopped on return - without a flicker of the LED.
I'll look to integrate some debug tracing to see what is going on where … first time I change rand of the stars to random(2,4) wondering if it was the math … it was not it seems.
Just went through the code and pulled all the display2 - in no time the stars have fallen still after a great start through all prior screens. The one screen I thought was perhaps trashed is just an odd/unclean inversion.
...
except one missing - it was not powered on 3.3V pin - just feeding off of signal wires … back to the start KurtE test sketch after 101 passes on the prior - and it stopped perhaps a minute after the flakes started … no instrumentation installed for more info. Just this from the SerMon:
display1.displayAsync(); // Show the display buffer on the screen
while ( !display1.displayAsync() ) delayMicroseconds( 10 );
delay(100); // Pause for 1/10 second
display1.displayAsync(); // Show the display buffer on the screen
while ( !display1.displayAsync() ) delayMicroseconds( 10 );
while (display1.displayAsyncActive()) ;
delay(1);
@Frank
No dice - been playing around with Zelda all morning and for some reason those wavetables just don't want to read correctly. I redownloaded audio this morning (saw you updated Zelda) and completely did a reinstall of the library. Still no luck though. Seems to have after a few reads of the score wavetable. Did some prints.
Thanks @defragster,
Looks like there may be some form of stress issue and/or timing issue. With the code like:
Code:display1.displayAsync(); // Show the display buffer on the screen while ( !display1.displayAsync() ) delayMicroseconds( 10 ); delay(100); // Pause for 1/10 second
I was sort of lazy and did not test display1, to see if it had completed the previous async update...
Looks like I did not move over a wait for display to complete command yet, but could do something like:
Wondering in this case if issue is with SPI display (display1) or SPI FlexIO (display 2) or with the Asynch support used in display 1 (SPI dma transfers)?Code:display1.displayAsync(); // Show the display buffer on the screen while ( !display1.displayAsync() ) delayMicroseconds( 10 ); while (display1.displayAsyncActive()) ; delay(1);
May have to isolate. The dSSD1306... library has one example app that runs the demo code that can be configured to run either displays, by changing a #define.. Note: This test does not do any of the DMA stuff (yet).
Back to playing and/or adding more issues![]()
display1.displayAsync(); // Show the display buffer on the screen
while ( !display1.displayAsync() ) delayMicroseconds( 10 );
delayMicroseconds( 600 );
I killed my audio shield.
Wouldn't be such a problem (have replacement) if I still had long pins...
!"§$%&/
void testLoop()
{
// Show initial display buffer contents on the screen --
// the library initializes this with an Adafruit splash screen.
[B] // display1.display();[/B] // NOW A COMMENT
#define DMAMUX_SOURCE_FLEXIO1_REQUEST0 0
#define DMAMUX_SOURCE_FLEXIO1_REQUEST1 0
#define DMAMUX_SOURCE_FLEXIO1_REQUEST2 64
#define DMAMUX_SOURCE_FLEXIO1_REQUEST3 64
I killed my audio shield.
Wouldn't be such a problem (have replacement) if I still had long pins...
!"§$%&/
I accidentally put it wrong in the socket after soldering in a microphone. (Pin 26 - Air, Pin 25 -> VIN, Pin 24->AGND...)
@Paul - any chance that the chip is still working and an other part got killed?
Ordered long pins....
...
For FlexIO pin. I setup FlexSPI object on pins (2, 3, 4, -1) (MOSI, MISO, SCLK, CS) These need to be FlexIO pins and on the same FlexIO object (in this case 1:nn) then again CS, DC, RESET can be any digital pin.
FlexSPI SPIFLEX(2, 3, 4, -1); // Setup on (int mosiPin, [B][U]int misoPin, int sckPin[/U][/B], int csPin=-1) :
SSD1306_FlexIO_32 display1(OLED_DC2, OLED_RESET2, OLED_CS2, &SPIFLEX);
//...
display1.display(); // Show the display buffer on the screen
//display1.displayAsync(); // Show the display buffer on the screen
//while ( !display1.displayAsync() ) delayMicroseconds( 10 );
delayMicroseconds( 1100 );
Update:
The additional word I was reading/writing was due to wrong Block Attribute register.
Still have problems with write….
that is, the CRC estimation is somewhat complex and I would like to avoid it, I could not find any hint on hoe to tell system to ignore CRC.When the wide bus option is used, the data is transferred 4 bits at a time. Start and end bits, as well as the CRC bits, are transmitted for every one of the DAT lines. CRC bits are calculated and checked for every DAT line individually.
Hm.
Don't know. It works for me.
Edit: Does PlaySynthMusic work?
Remember to set the switch on the extension-board correct![]()
I'm working on the I2S-input.
@Paul: What shall we do with the Design-Tool ? There are big differences.. 2nd I2S.. MQS, SPDIF-In and more..
a) Copy it and create different versions (T3/T4)
b) Hack the tool and make it more intelligent with a drop-down for the model
I'd choose a)...
KurtE - found a BUG IN CODE …. comment wrong … "// Setup on (int mosiPin, int sckPin, int misoPin, int csPin=-1) :"
The post above is right - MISO and SCLK are swapped in comment and that doesn't fly
It seems SPIFLEX is the trouble. It works up to FLAKES then dies - though _isr fires in above non-Multi display1 with swap of constructor and remove the Async for plain display()
Usually makes it to Flakes {scroll okay - but can die on text or diag lines before that} - then when it does dies on flake #3 or [8,11,39] that is with this longer delay after .display:
And again the pin 23 _isr is still active when display stops.Code:FlexSPI SPIFLEX(2, 3, 4, -1); // Setup on (int mosiPin, [B][U]int misoPin, int sckPin[/U][/B], int csPin=-1) : SSD1306_FlexIO_32 display1(OLED_DC2, OLED_RESET2, OLED_CS2, &SPIFLEX); //... display1.display(); // Show the display buffer on the screen //display1.displayAsync(); // Show the display buffer on the screen //while ( !display1.displayAsync() ) delayMicroseconds( 10 ); delayMicroseconds( 1100 );
@Frank
Just tried PlyaSynthMusic and it does not work - had the switch set to i2s1. The thing I noticed is that with the wavetable (progmem) examples when the sketch stops the LED starts blinking until I load another sketch or reset. Also anything other than using SGT5000/i2s1 as output does not work either, i.e., codec, audioout etc. Have to do some debugging on progmem later - have to go out now.
Mike
Thought I would try to shorten the test to just run the scrolling flakes... So after the initial screen begin and erase, it then just called testanimate...@KurtE - removed Flakes from testLoop() and shortened scroll delays/10 (hasn't died in scroll yet) - it will complete a couple of loops but dies there too after 0,1,3,4 or 6 passes in one of the drawings - so SPIFLEX fail not unique to Flakes. And to be clear - the loop() stops or it would be showing completed loops - not just an output failure - but interesting the _isr still active and not faulted. So it seems to be stuck in some loop in SPIFLEX code. I could probably find where with debug_tt ...
void testanimate(const uint8_t *bitmap, uint8_t w, uint8_t h) {
int8_t f, icons[NUMFLAKES][3];
// Initialize 'snowflake' positions
for (f = 0; f < NUMFLAKES; f++) {
icons[f][XPOS] = random(1 - LOGO_WIDTH, display1.width());
icons[f][YPOS] = -LOGO_HEIGHT;
icons[f][DELTAY] = random(1, 6);
Serial.print(F("x: "));
Serial.print(icons[f][XPOS], DEC);
Serial.print(F(" y: "));
Serial.print(icons[f][YPOS], DEC);
Serial.print(F(" dy: "));
Serial.println(icons[f][DELTAY], DEC);
}
uint32_t loop_count= 0;
display1.setTextSize(1); // Normal 1:1 pixel scale
display1.setTextColor(WHITE); // Draw white text
display2.setTextSize(1); // Normal 1:1 pixel scale
display2.setTextColor(WHITE); // Draw white text
for (;;) { // Loop forever...
display1.clearDisplay(); // Clear the display buffer
display2.clearDisplay(); // Clear the display buffer
// Draw each snowflake:
for (f = 0; f < NUMFLAKES; f++) {
display1.drawBitmap(icons[f][XPOS], icons[f][YPOS], bitmap, w, h, WHITE);
display2.drawBitmap(icons[f][XPOS], icons[f][YPOS], bitmap, w, h, WHITE);
}
loop_count++;
display1.setCursor(0, 0); // Start at top-left corner
display1.print(loop_count,DEC);
display2.setCursor(0, 0); // Start at top-left corner
display2.print(loop_count,DEC);
display1.displayAsync(); // Show the display buffer on the screen
display2.display(); // Show the display buffer on the screen
while (display1.displayAsyncActive()) ;
delay(10); // Pause for 1/10 second
// Then update coordinates of each flake...
for (f = 0; f < NUMFLAKES; f++) {
icons[f][YPOS] += icons[f][DELTAY];
// If snowflake is off the bottom of the screen...
if (icons[f][YPOS] >= display1.height()) {
// Reinitialize to a random position, just off the top
icons[f][XPOS] = random(1 - LOGO_WIDTH, display1.width());
icons[f][YPOS] = -LOGO_HEIGHT;
icons[f][DELTAY] = random(1, 6);
}
}
}
}
Do you have an example one that hangs for you? might help to start from there to figure out why.
That "fix" may be just "covering the warning light"? SPI@30mhz block transfer ran twice and hung ?
In flexSPI.cpp, if i change transfer() while to while (tx_count) instead of rx_count, sketch doesn't hang @30mhz (26.7 mbs), no inter-frame gaps
Sounds like it must have missed one or more interrupts. That is if there is a delay of time before it services a TX request ISR, the SPI output will have a gap in time. If however it waits too long to service an Receive interrupt and another byte comes in than we miss an interrupt (and character) and the code waits for a very long time (for ever) for the remaining byte to come.May not be relevant, but a few days ago I had a flexspi hang problem at high speed
https://forum.pjrc.com/threads/54711-Teensy-4-0-First-Beta-Test?p=196848&viewfull=1#post196848
That "fix" may be just "covering the warning light"![]()
Well, there is no other explanation than a different installation
We'll find it..
Thought I would try to shorten the test to just run the scrolling flakes... So after the initial screen begin and erase, it then just called testanimate...
I changed the code to also output a loop counter on the displays and shortened the delay to 10...
The function now looks like:
// ...
It now has been running for maybe an hour or two, and the counters are showing over 395K loops, still running...
Do you have an example one that hangs for you? might help to start from there to figure out why.
View attachment ssd1306_FlexIO_128x32_spi.ino
// SSD1306_FlexIO_32 display1(OLED_DC2, OLED_RESET2, OLED_CS2, &SPIFLEX);
and _isr button on pin #23
I don't have any problems - but I'm using TY.