Search results

  1. R

    Recommend SPI Flash chip for T4.1 polyphonic playback

    OK, if I can get 10-20 24 kHz voices directly of an SD card, then I won't use spi flash at all. What blocksize do you read from the SD card? How much buffering is needed? It would be nice if I could run it out of the T4.1 internal ram instead of psram.
  2. R

    Recommend SPI Flash chip for T4.1 polyphonic playback

    I'd like to use a T4.1 with a 32/64/128 mbyte spi flash for polyphonic audio playback (10+ streams possible?) The streams are mono 16-bit 24kHz (or similar mid-quality). Processing will probably be limited to gain and short delay for spatial positioning of the mono streams in the stereo output...
  3. R

    Teensyduino 1.54 Beta #9

    Mac OS 10.13.6 on an old mac pro. Java exception on first run. Teensyduino.app starts and automatically opens the last sketch I was working on. I let it sit idle for ~30 secs, then the exception happens. Maybe checking for lib updates in the background, or some other async startup code? I'm...
  4. R

    Haunted USB Serial on Teensy 3.2

    Great! I'll test out both fixes in beta 9.
  5. R

    Teensyduino 1.54 Beta #8

    Here's test code for memcpy. It's simple and 100% reproducible. Thanks for looking at these bugs.
  6. R

    Teensyduino 1.54 Beta #8

    For memcpy, I have not dug through the ARM assembly. But if it's like other memcpy implementations, there is a code path for when the src and dst are not relatively aligned (src % 4 != dst % 4). For the relatively unaligned case, memcpy needs to do one of 3 things: a) do 32-bit unaligned reads...
  7. R

    Teensyduino 1.54 Beta #8

    There are two bugs discussed in my support thread. One is a memcpy bug from 2014 or earlier, that Frank B mentioned had been fixed, then un-fixed in the intervening years. Basically memcpy is trying to be clever by doing unaligned 32 bit reads and writes, but that causes corruption when copying...
  8. R

    Teensyduino 1.54 Beta #8

    So what's the process to get bug fixes into the teensy core library? I've spend a fair amount of time debugging a couple problems I've run into, but it kinda feels like I'm posting into the wind over in the tech support forum.
  9. R

    Haunted USB Serial on Teensy 3.2

    OK, I believe I know what's going on. At -O2, the compiler is re-ordering assignments to bdt_t.addr and bdt_t.desc. If we're unlucky, the USB engine grabs the bdt_t between writes and gets the old bdt_t.addr before we can update it. Interrupts are off, but that won't save us because we're in a...
  10. R

    Haunted USB Serial on Teensy 3.2

    Ah ha! usb_dev.c // This code has a known bug with compiled with -O2 optimization on gcc 5.4.1 // https://forum.pjrc.com/threads/53574-Teensyduino-1-43-Beta-2?p=186177&viewfull=1#post186177 #if defined(__MKL26Z64__) #pragma GCC optimize ("Os") #else #pragma GCC optimize ("O3") #endif This...
  11. R

    Haunted USB Serial on Teensy 3.2

    OK, I am back with a fresh Linux dev environment to exclude the possibility of Mac USB weirdness. Here's the current setup: Raspberry Pi 4 B booting off a SATA SSD via USB 3 adapter Raspberry Pi Imager v1.6.1 Raspberry Pi OS 32-bit installed, see end of post for raspinfo output. Arduino 1.8.13...
  12. R

    Haunted USB Serial on Teensy 3.2

    That sounds like an excellent fix.
  13. R

    Error when uploading code, and after that board is not working

    USB hubs have many strange and infuriating behaviors. Never trust one.
  14. R

    Error when uploading code, and after that board is not working

    I've had a usb hub "blacklist" a teensy for whatever reason. Required the hub to be power cycled before it'd let the teensy connect again. Definitely try rebooting the computer and power cycling any hubs (incl the one in your display, keyboard, etc).
  15. R

    Haunted USB Serial on Teensy 3.2

    Here's a quick test case for the memcpy 0x20000000 bug ShadowLight8 mentioned. Sure enough, memcpy fails. #include <Arduino.h> uint8_t big_buf[40 * 1024]; #define PIN_LED 13 // Enable %f in printf. asm(".global _printf_float"); #define SCB_AIRCR (*(volatile uint32_t *)0xE000ED0C) //...
  16. R

    Haunted USB Serial on Teensy 3.2

    Oh yeah, unaligned read across that boundary, I can see how that could trigger a fault. You can probably tell the linker to park an unused int32 at 0x20000000 to prevent any objects from straddling the boundary.
  17. R

    Haunted USB Serial on Teensy 3.2

    I gave it a quick try on my raspberry pi pi-hole server. Not the greatest environment, but it's what I have handy. Linux raspberrypi 4.19.118-v7l+ I didn't install Arduino or Teensyduino, just the udev file. On Linux, there seems to be a problem with the teensy not resetting when the tty is...
  18. R

    Haunted USB Serial on Teensy 3.2

    Thanks for the excellent tip, ShadowLight8! For my test case, very little memory is used. The array of hashes is in flash. I don't think anything crosses that boundary. Here's the symbol list, with flash mem filtered out: 619 ~/arduino-sketches/build$ cat cksum-teensydunino.ino.sym | grep -v...
  19. R

    Haunted USB Serial on Teensy 3.2

    The Bug During rx buffer starvation, usb serial will corrupt ~0.01% of packets received from the host. (skip ahead to "The Fix" if you want a fairly wild tldr) Tools Bare Teensy 3.2 plugged into usb. I am using platformio on a mac. I have verified this issue on platformio and teensyduino. I...
  20. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    My main complaint right now is that the first prototype worked so well that it was put into use 2 days after I built it. So now I'm waiting on a digikey order so I can make another one and continue firmware development. Teensy has been an amazing tool for the R&D work I do at my company. It...
  21. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    They're just plain old red LEDs in a 25x11 matrix. I use 2x 595s + mosfets as row drivers, and 2x CAT4016 current sinks to drive the columns. 1.0 / (5us * 255 brightness levels * 11 rows) = 71.3 Hz 71 Hz looks pretty smooth, but you can see a bit of strobing/flicker in your peripheral vision...
  22. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    And the transmit code: const uint16_t* p = framebuffer.phases[y][ph].data.shorts; KINETISK_SPI0.PUSHR = p[0] | SPI_PUSHR_CTAS(1); KINETISK_SPI0.PUSHR = p[1] | SPI_PUSHR_CTAS(1); KINETISK_SPI0.PUSHR = p[2] | SPI_PUSHR_CTAS(1); I do not check the fifo status because I know it is empty when I...
  23. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    Answering my own question: // We don't care about CS, so set it to unused pin 24 (bottom side smd pad) SPIFIFO.begin(24, SPI_CLOCK_24MHz); // assign SCK to alternate pin 14 CORE_PIN14_CONFIG = PORT_PCR_DSE | PORT_PCR_MUX(2); // restore pin 13 digital functionality...
  24. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    What do I need to change in SPIFIFO.h to use Teensy 3.2 alternate SCK on pin 14? I tried looking through SPI.cpp, but I'm having trouble understanding how the pin mux(?) is setup. I'm just looking to hardcode SCK to the alternate pin 14, not add arbitrary setSCK() functionality.
  25. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    Oh wow, that's even better! I thought you were probing SCK, not MOSI. So it's more like 20% CPU usage in the interrupt.
  26. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    Hi Paul. The bottom trace looks like 64 clocks @ 16 MHz, is that right? What cpu speed did you use for the test? I've heard the 3.2 is pretty stable at 96 MHz and 24 MHz SPI would be great (slave Fmax=25 MHz). My application is mounted open-air in an office/lab environment. That should be...
  27. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    Thanks so much, Frank and Paul. ~50% cpu will be great!
  28. R

    Fastest way to send 6 bytes over SPI on Teensy 3.2

    What's the fastest way to send 6 bytes over SPI? I see DmaSpi, SPIFIFO, and some other libs. I am using a Teensy 3.2. My application is transmit only, always 6 bytes, and no other devices/libs will be using SPI. No chip selects needed. No completion callback needed. Transmissions are on a fixed...
Back
Top