Forum Rule: Always post complete source code & details to reproduce any issue!
Page 5 of 5 FirstFirst ... 3 4 5
Results 101 to 114 of 114

Thread: CircuitPython on Teensy 4!

  1. #101
    Hi! Thanks for the interest in CircuitPython. I've answered each of your questions below.

    I also want to remind folks that Teensy support isn't a focus for Adafruit folks who work on CircuitPython. The features we add for the iMX RT benefit Teensy but aren't driven by the goal of supporting Teensy. We'd love contributions for these things though. It's just not a priority for us.

    Quote Originally Posted by rcolistete View Post
    I don't yet have a Teensy 4.1, just Teensy 4.0.

    Any new feature of Teensy 4.1 (with respect Teensy 4.0) is implemented in CircuitPython 5.4.0-beta.0 for Teensy 4.1 ?
    - internal 8MB flash memory seems recognized, with 7MB as file system, from post #93;
    Different flash sizes are easy to support and should already work.

    Quote Originally Posted by rcolistete View Post
    - all additional pins (to be confirmed);
    All pins should just work. When we add support for an MCU we add all pins on it regardless of what is broken out on the board. The only board specific pin support is the name mapping made available in the `board` module. We do end up finding some data copy issues for pins that haven't been tested. These bugs are somewhat rare and easy to fix when we find them.

    Quote Originally Posted by rcolistete View Post
    - microSD (most important feature, IMHO) ?
    We currently support SD cards with a Python library: https://github.com/adafruit/Adafruit_CircuitPython_SD/ This will work on any board with SPI support on SD card pins. Jeff (jepler) is also actively working on native SD card support (both SPI and SDIO) for STM and SAMD51 I believe. This will make it easier to support on iMX because the APIs will be established already. However, I don't know if adding iMX RT support is planned.

    Quote Originally Posted by rcolistete View Post
    - QSPI Memory via external PSRAM and/or flash chips ?
    We don't have any immediate plans to support additional RAM or FLASH. It should be usable over the SPI connection but not natively.

    Quote Originally Posted by rcolistete View Post
    - USB host via Teensy 4.1's USB Host port ?
    This would depend on USB host support for iMX RT in TinyUSB and also establishing USB host APIs in CircuitPython. It is something we'd like to do at some point but it's not something we plan to do soon.

    Quote Originally Posted by rcolistete View Post
    - Ethernet network via 10/100 Mbit Ethernet PHY ?
    We don't have plans to add support for this. We have "native" support for WizNet but we'll likely deprecate it. Most of our network support is from Python-only and I'd like us to have a better API that handles Python support primarily and then fits native into that. We'll be evolving the APIs for this with the ESP32S2 WiFi support that is upcoming and a priority.

    Hope that gives some insight into our priorities! As always, we'd love more contributors to CircuitPython and are always happy to help get folks working on CircuitPython. These priorities are for those of us sponsored by Adafruit.

  2. #102
    Senior Member
    Join Date
    May 2015
    Posts
    402
    Is Teensy 4.1 even an option? Does it work the 4.0 firmware and the common pins?

  3. #103
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,883
    Quote Originally Posted by DaQue View Post
    Is Teensy 4.1 even an option? Does it work the 4.0 firmware and the common pins?
    Yes Circuit Python for Teensy 4.1 and 4.0 both are available:


    There is a check in the Teensy loader that prevents loading Teensy 4.0 on Teensy 4.1 systems, and vice versa.

  4. #104
    Junior Member
    Join Date
    Nov 2019
    Posts
    14
    Thanks @tannewt for the detailed answer. Excellent, the microSD can work with the Adafruit_CircuitPython_SD library, and the community can develop drivers to access PSRAM and/or flash external IC's via SPI interface.

    Together with more internal flash memory (as file system) and more exposed pins, these features make the Teensy 4.1 worth when using CircuitPython, compared to Teensy 4.0.

    So I'll buy some Teensy 4.1.
    Last edited by rcolistete; 06-02-2020 at 03:44 PM.

  5. #105
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,034
    Quote Originally Posted by MichaelMeissner View Post
    There is a check in the Teensy loader that prevents loading Teensy 4.0 on Teensy 4.1 systems, and vice versa.
    That hardware compatibility check only works if the .elf file corresponding to the .hex file is present in the same folder, and only if the .elf file was built by gcc using settings similar to what's normally used with Arduino & Teensyduino. The .hex file alone simply does not contain the necessary info for Teensy Loader to check which board was meant to be used.

    Looks like the Circuit Python site is only providing the .hex file. But the filename does contain the board name, so this hardly seems like an issue. If you do load the wrong .hex file, you can always just press the button on Teensy to get back into bootloader mode. Or you can do the 15 second press to fully wipe the flash and restore a known-good LED blink if things go really wrong.

  6. #106
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,883
    Quote Originally Posted by PaulStoffregen View Post
    That hardware compatibility check only works if the .elf file corresponding to the .hex file is present in the same folder, and only if the .elf file was built by gcc using settings similar to what's normally used with Arduino & Teensyduino. The .hex file alone simply does not contain the necessary info for Teensy Loader to check which board was meant to be used.

    Looks like the Circuit Python site is only providing the .hex file. But the filename does contain the board name, so this hardly seems like an issue. If you do load the wrong .hex file, you can always just press the button on Teensy to get back into bootloader mode. Or you can do the 15 second press to fully wipe the flash and restore a known-good LED blink if things go really wrong.
    Hmmm, you are right. I thought I had checked running the 4.0 version on 4.1 and the loader rejected it. I was able to load the Teensy 4.0 version on to the Teensy 4.1, and it gave me 1 megabyte file instead of the 7 megabyte file normally with the 4.1. I didn't do any tests on whether it worked, I just looked at the size of the CIRCUITPY file system that was mounted.

  7. #107
    Junior Member
    Join Date
    Jul 2017
    Location
    Austin, TX
    Posts
    5
    Paul:
    On the Teensy 4.0 and Teensy 4.1, did you blow the fuses for the FlexRAM memory controller, or is it firmware configured at boot?
    If you did a hard allocation with the fuses, could you share what the configuration is?

    Thanks,
    --- Graham

    ==

  8. #108
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,911
    @GrahamH - Obviously Paul is the best one to answer this, but might help if you mentioned what you are looking for.

    That is, you might be able to find what you are looking for, by looking at a couple of files that are part to cores\teensy4

    including the linker scripts: like imxrt1062.ld for the T4 and imxrt1062_t41.ld for T4.1

    And then look at startup.c. where you find inclusion of data from the linker scripts

    Also has functions like configure_cache()
    Which sets up all of the memory regions, with their different caching options.

    And likewise configure_external_ram() which on T4.1 can handle the memory that is optionally added to bottom.

    The main handler is the function ResetHandler()
    Which calls the above, plus configures DTCM/ITCM and copies the stuff down from the Flash...

    But if you are referring to things like reserved space for default program or EEPROM space reserved, that is probably something different.

  9. #109
    Junior Member
    Join Date
    Jul 2017
    Location
    Austin, TX
    Posts
    5
    Hi Kurt:
    "might help if you mentioned what you are looking for."

    I am trying to figure out if the FlexRam RAM allocations are fixed, ie. the fuses have been blown, or if the RAM allocations can be modified, ie. they are being set by firmware at time of boot and might be modifiable by the files you mentioned.

    I don't understand enough yet to know what would happen if there was a conflict.

    Thanks,
    --- Graham

  10. #110
    CircuitPython does try to set them here: https://github.com/adafruit/circuitp...or/port.c#L119

    The setup is primarily for the 1011 so we may want to tweak it for the larger chips.

  11. #111
    Junior Member
    Join Date
    Jul 2017
    Location
    Austin, TX
    Posts
    5
    Yes, since the RT1062 has four times the RAM as the 1011, optimum allocations are probably different. I am just trying to verify that the allocations can be changed.
    --- Graham

  12. #112
    Hi all, just wanted to mention I did a bit of work on the iMX RT in CircuitPython. In particular, I reworked how flash is configured (we now share config with the bootrom) and I enabled the DCache (but turning off OCRAM caching). These changes are in the latest unstable release, 6.0.0 Release Candidate 0. https://circuitpython.org/downloads?q=teensy

    PR: https://github.com/adafruit/circuitpython/pull/3522

  13. #113
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,593
    Thanks for adding DCache support. I added T4 v6 lines to benchmarks in post #14. Some tests are faster than v5 dcache-hack, some are slower.

  14. #114
    Quote Originally Posted by manitou View Post
    Thanks for adding DCache support. I added T4 v6 lines to benchmarks in post #14. Some tests are faster than v5 dcache-hack, some are slower.
    Thank you! My guess is the slight perf hit to OCRAM will cause any test that uses the heap to be a bit slower than the hacked version. This version works with USB though. :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •