Search results

  1. J

    A reimagining of hardware-based (DCP) crypto in C++: Decept

    Since copy constructors aren't disallowed I assume there's no harm in using them: void calc_PTK(const uint8_t* mac1, const uint8_t* mac2, const uint8_t* nonce1, const uint8_t* nonce2) { decept::hmac::HMAC ihmac(decept::Hash::kSHA1); const uint8_t name[] = "Pairwise key expansion"; uint8_t...
  2. J

    A reimagining of hardware-based (DCP) crypto in C++: Decept

    Trying to use this as a library within Arduino IDE doesn't work due to main.cpp duplicating setup() and loop().
  3. J

    Rotary Encoders need Caps?

    I've personally never had to worry about bounce on the T4 when using the hardware decoders, they have built-in filtering.
  4. J

    Stack trace & heap available..

    Minimum unallocated memory = any allocation smaller than or equal to that size will succeed, anything larger may fail (but can possibly succeed).
  5. J

    Stack trace & heap available..

    Note that __brkval/_sbrk() isn't an accurate indicator of "free" memory - it's an indicator of the minimum unallocated memory, there may be more that is not currently in use but the allocator hasn't returned it to sbrk.
  6. J

    New USB Host library for Teensy 4.x

    Yes, UGREEN and Tenda are listed in the driver source code. I'd say that device does support bluetooth but it just isn't enabled in the windows drivers (it has a very minor quirk that makes it non-standard).
  7. J

    New USB Host library for Teensy 4.x

    Wifi work is progressing... I can scan 2.4GHz and 5GHz channels and probe access points: Device<0x20207300> activate configuration 1(-1) Device<0x20207300> activate interface 00 altSetting 00 New Endpoint<0x20207900> type 3 New Endpoint<0x20207c00> type 2 New Endpoint<0x20207180> type 2...
  8. J

    RAM1 padding

    Each bank can be allocated in 4 ways: unallocated, ITCM (code memory), DTCM (data memory) or OCRAM (extra RAM2). Four possible values requires two bits of storage. The way this is handled in the hardware is by dividing a single 32-bit register (IOMUXC_GPR_GPR17) into 2-bit fields, allowing for...
  9. J

    New USB Host library for Teensy 4.x

    A while ago I bought a $5 USB wifi/bluetooth adapter from aliexpress. They seem to be very plentiful, advertised under a few different brands but usually including a mention of AX900, Wifi6 and Bluetooth 5.3 or 5.4. I thought it would be a realtek chipset but it turns out it's from AIC, although...
  10. J

    Compiler.. Thing? __func__

    The short answer is no, because a class may be masquerading as another class due to inheritance (and all sorts of other tricky situations). (The long answer is g++ has __PRETTY_FUNCTION__ which gives the entire current function signature and you have to come up with a way to pull just the name...
  11. J

    teensy 4.1 Display and SD Card issues

    One day someone should probably try to figure out why DMA_SDIO mode is so horribly slow... I feel like it would help a lot with audio tasks.
  12. J

    teensy 4.1 Display and SD Card issues

    That's all wrong because OP is already using the built-in SD card slot.
  13. J

    Compilation error: 'foo' causes a section type conflict with 'bar' in section '.progmem'

    I hate this error because it's so vague. Here's example code that triggers it: #include <Arduino.h> static const char g_abc[] PROGMEM = "ab"; class foo { public: static const char& alpha(int x) { static const char g_alpha[2] PROGMEM = {3, 1}; return g_alpha[x&1]; } }; void setup()...
  14. J

    A new and more modern way to access and modify registers

    The SCB AIRCR register for example; if the top 16 bits aren't written as 0x05FA the register write is ignored. So attempting to set SCB_AIRCR_SYSRESETREQ to 1 won't work, you have to set the whole register which makes most of the template stuff redundant.
  15. J

    A new and more modern way to access and modify registers

    How do you set more than one register field with a single access? I'm thinking of a case where you can only update part of a register if a separate bit is also set at the same time.
  16. J

    Teensy 4.1 Sensed bit length dropped to half after update and rebuild

    Either case is possible, the compiler can omit any statement it thinks doesn't have any effect unless it's marked as volatile.
  17. J

    Teensy 4.1 Sensed bit length dropped to half after update and rebuild

    It's possible that since the original code used an __asm__ statement with no apparent side-effects (no registers or memory marked as outputs) and no volatile specifier, the new compiler simply decided to omit it.
  18. J

    "Could not open comm port 'COMM3' " fix (or any WIndows port...)

    I don't really understand what the output is meant to be showing, that's very obviously a process related to VS code rather than Arduino.
  19. J

    Different implementations for polyphony

    It's easy enough to do as long as you use different specifiers for initialized data vs uninitialized data, similar to how FLASHMEM and FASTRUN work. This separates data into separate sections so the uninitialized variables can be tagged with NOLOAD. Otherwise there is no way to do it with a...
  20. J

    Program accidentally erased?

    Doesn't really narrow it down - they're both shades of red/orange.
  21. J

    How to get RTC from Teensy 4.0 (after power down, and the back up)

    It should get automatically set when you upload from a PC. The output you're getting the first time you run the first sketch shows this. It's just not keeping it when powered off - are you sure your battery is good?
  22. J

    Program accidentally erased?

    Are we sure the "blinking light" was actually the LED on pin 13, not the programming LED?
  23. J

    Different implementations for polyphony

    This will give the appearance of working but won't behave correctly - you can't declare const arrays in EXTMEM, only uninitialized data.
  24. J

    Hacking open source repositories

    The way these sort of things usually work is that they fork a popular repository (not using the built-in github fork functionality but cloning it manually) and poison the release downloads with malware. Then they force-push empty changes multiple times a day to make the repository seem like it...
  25. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    Padding exists to round the code size up to a multiple of 32768. The code size increased by more than the old padding size (2568), requiring an extra 32768 bytes total to be used.
  26. J

    Teensy firmware being corrupting during shipping?

    An x-ray would not replace the firmware with the blink program.
  27. J

    Teensy USB Host Audio?

    The USBHost_t36 library still has no support for isochronous transfers. My teensy4_usbhost library does.
  28. J

    Rust, Embassy, Zephyr - Ready for Prime Time?

    Funny that the AI did not realize that if ((d & 0x80) ^ (crc & 0x80)) { can be simplified from three logic operations to two (or technically, one logic op and a sign extension): if ((d ^ crc) & 0x80) {
  29. J

    PDP-11/70 emulator

    Even just looking only the clock speed, it's four times as fast. 64-bit (aarch64) does help because it has 31 general purpose registers compared to 8 on the M7 (arm thumb).
  30. J

    SD.open()?

    For the record: SdFat isn't case-sensitive, internally it converts all names to upper case when doing comparisons.
  31. J

    PDP-11/70 emulator

    The pi5 uses a quad-core 64-bit 2.4GHz A76 ARM processor, the Teensy is a single-core 32-bit 600MHz M7 ARM processor. There's a league of difference.
  32. J

    Teensy firmware being corrupting during shipping?

    If the old firmware was wiped/corrupted they wouldn't automatically reset to the blink program. Only holding the button for ~15 secs would do that, because it causes it to be copied from the top to the base of the flash memory.
  33. J

    USB Host Serial Crash on cable disconnect/reconnect

    I resolved it by making my own USB host library instead of using the one that's full of race conditions.
  34. J

    Teensyduino 1.62 Beta #5 - Release Candidate

    No change for me when running the code from this post; the serial monitor still does not reconnect properly, Teensy is blocked waiting for the serial connection.
  35. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    That would still have the same problem with the serial monitor. The windows MTP driver also silently fails to initialize when the device doesn't respond with 5 seconds (there's further events in Event Viewer confirming this).
  36. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    I'm talking about the OS (windows) MTP driver... it appears to have a 5 second delay in its startup, which probably blocks access to any interface on the device. Edit: I know what's going on... the windows MTP driver is trying to talk to the device during its startup routine, but the device is...
  37. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    I only see 2 redraws; one is a short time after the upload finishes, the second is approx. 5 seconds later. Any attempts to open the COM port before the second update fail. I had a look in \windows\inf\setupapi.dev.log from when the driver for this Teensy config was installed, there's separate...
  38. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    Windows 10 with Arduino IDE 2.3.10. Yes, I think that's when it started. Reproducible sample: #include <SD.h> void setup() { pinMode(LED_BUILTIN, OUTPUT); digitalWriteFast(LED_BUILTIN, LOW); Serial.begin(0); while(!Serial); puts("Starting MTP..."); MTP.begin()...
  39. J

    Call to arms | Teensy + WiFi = true

    uSDHC2 has more than one set of pins available, see page 314 of the reference manual (rev3): (This is why I once suggested an MMC add-on for T4.1 would be a good idea - all 8 data pins are available...)
  40. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    The issue is not the code, it is the Arduino IDE not reconnecting automatically after an upload. This works with any config except Serial+MTP.
  41. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    Something I am seeing when using the Serial+MTP config, every time I modify code and upload a new sketch I have to close/re-open the arduino serial monitor because it won't auto-reconnect (Teensy waits at while (!Serial);) (Slightly related: Serial has the option of a callback function for...
  42. J

    Teensyduino 1.62 Beta #4 - Release Candidate

    MTP was already added to the core library several versions ago, that's why it's not looking for the separate library.
  43. J

    why is this in RAM1?

    There is something I'm hoping to test in the near future, using newly available c++ features and templates...
  44. J

    why is this in RAM1?

    You want PROGMEM for const data in flash, FLASHMEM is for code/functions. Since your structs are actually holding pointers to string literals, those will need to be stored separately in flash; F() is documented as intended for this but does not work, use PSTR() instead.
  45. J

    why is this in RAM1?

    Because for Teensy 4.x all data defaults to RAM1 unless you specify otherwise.
  46. J

    Sanity check: USB->DMX adapter with processing, on a Teensy 4.1

    This is handled by specifying the appropriate mode when calling the uart's begin() function, e.g. Serial1.begin(9600, SERIAL_8N1_RXINV_TXINV) specifies 9600 baud using 8 data bits, 1 stop bit, both RX and TX inverted. Although I think it would be simpler to use an open drain buffer with pull-ups...
  47. J

    Using TD1.62B3 with Dev Board 4 or 5

    That code doesn't use the SDRAM memory, only flash.
  48. J

    Using TD1.62B3 with Dev Board 4 or 5

    But it's not the default "for everyone" - that's exactly why I initially suggested using the fuses to determine which voltage formula to use. Regular Teensy isn't going to be affected because it uses the commercial variant. I don't think this is necessary. It's already possible to include a...
  49. J

    Using TD1.62B3 with Dev Board 4 or 5

    There's at least two methods I know of that are likely to trigger random faults that seem to be due to brown-outs / power issues: very heavy usage of FLASHMEM functions, or high rate of interrupts with WFI instructions in between.
Back
Top