Search results

  1. T

    Teensy 4.1 SPI Slave - here it is

    If you have just one SPI slave, maybe you can enable the slave by driving its nCS with a constant. BUT: not all SPI slave devices work this way: some chips require to toggle nCS so that the chip can "see" a completed SPI transaction. Not really clear if this SPI Slave is on the Teensy MCU. If...
  2. T

    Teensy 4.1 SPI Slave - here it is

    On a Master you could use any GPIO pin as a CSn, running it in SW mode. But on a Slave, if you want to use CSn (to enable a slave from a master, e.g. selecting 1 of N slaves) - it has to be a dedicated CSn pin for this SPI slave. You can look into the ALT function table and check, if you find...
  3. T

    Teensy 4.1 SPI Slave - here it is

    It is not possible to use a SPI Slave in Full-Duplex mode: if the Master sends a command to Slave, but the Slave has to wait for FIFO, read from FIFO, decode the command, generate the response and write to the Slave Tx FIFO - it will take much longer as ONE SPI CLK cycle (it must be shorter...
  4. T

    Teensy 4.1 with QSPI?

    My FlexIO QSPI trial is here: https://github.com/tjaekel/MaaXBoard-RT_flexio_qspi_edma_cm7 It is a MCUExpresso IDE project (not for Arduino, not for Teensy), based on the NXP SDK examples and drivers. The target board is an AVNET Maaxboard-RT. But you should be able to see how to extend a...
  5. T

    Teensy 4.1 with QSPI?

    Hi, FYI, I have FlexIO as QSPI working on a different NXP board. For this board I have also designed a PCB, like a HAT, to bring out SPI, QSPI, I2C, ... where QSPI and some GPIOs go via level shifters to external target (possible to set also for 1V2). I am not sure, if I will try FlexIO QSPI on...
  6. T

    compiler error

    You get a linker error (not a compiler error), with "multiple definition". Check, if you use the same code (with function definitions) again, maybe via different files or if you use code from a LIB and you have also the source code of the LIB in project. Just figure out how often and where the...
  7. T

    Teensy 4.1 with QSPI?

    FYI, I have QSPI working as "FastGPIO" as well as as "FLEXIO" (on a different NXP MCU board, but it should work as well on Teensy 4.1 board) QSPI with "FastGPIO": I can generate a QSPI write with 40 MHz, potentially up to 60 MHz possible. QSPI with "FLEXIO": The MCU has also a feature called...
  8. T

    Teensy 4.1 with QSPI?

    keeping brainstorming with myself and FYI: actually, the PSRAM and Flash (optional), provide a QSPI via FlexSPI2_A (with separate SS0_B and SS1_B). This should work! And solder pads are easy to access. (why was I so complicated...?) Also: FlexSPIA, with the external code flash memory (U3) might...
  9. T

    Teensy 4.1 with QSPI?

    BTW: two chips with QSPI but not a memory chip: Nordic nRF7002 (companion chip) FTDI FT4222HQ And modules, e.g. TFT display with QSPI: https://www.crystalfontz.com/product/cfaf320240f035ttsa11-320x240-eve-tft-lcd-display-kit Anyway, to have QSPI as an option available on (future) Teensy 4.2...
  10. T

    Teensy 4.1 with QSPI?

    Hi Paul, I am sorry, I cannot disclose details, just: I need those MCUs in order to test new chips (under development, bring-up after production...). So, my DUT (Device Under Test) will be such a (new) chip. Yes, it is not a memory chip, even using QSPI for fast transfer of data. Using a...
  11. T

    Teensy 4.1 with QSPI?

    Thank you all. Yes, I have checked the ALT functions for pins, starting at schematics. Yes, if I would not have the ETH controller - the LPSPI4 would be able to do. My (current) conclusions: - LPSPI2 "could" do - but there is the external code flash memory (U3) - it is needed - FlexSPI2_A could...
  12. T

    Teensy 4.1 with QSPI?

    I need a QSPI Master interface (like regular SPI but with 4 data lanes). I know, there is FlexSPI (for external memory, SPI flash chips or memory). But I need the feature on regular LPSPI, to use PCS2 and PCS3 as DATA2 and DATA3. So, does anybody know if for the SPI available on the header...
  13. T

    Teensy 4.1 linker script is really wrong

    Sorry, last topic was: reducing ITCM and/or DTCM space in linker scripts results in compiler error. This is "intended" (and should happen): I want to see when DTCM gets below a minimum. (I want to make sure, if I have at least 256K for DTCM - and not let reduce "automatically" (and hidden) by...
  14. T

    Teensy 4.1 linker script is really wrong

    Yes, if you change now linker script - it fails (and "should"). And it "should fail" (telling me that not memory space left). My "concern" was: with original linker script - it hides the issue that you can "get out of memory" (no compile errors, but run-time errors). It think, we should close...
  15. T

    Teensy 4.1 linker script is really wrong

    Thank you Paul. I "know" (the support for this board is pretty b..) We will see. I love the Teensy 4.1 board, I like the forum, I like your expertise response. My project is "so huge" that I have to start tweaking the memory spaces. (which is still possible with Teensy 4.1). Just lazy...
  16. T

    Teensy 4.1 linker script is really wrong

    I agree with you freertos does malloc: sm_set_pool(&extmem_smalloc_pool, &_extram_end, external_psram_size * 0x100000 - ((uint32_t)&_extram_end - (uint32_t)&_extram_start), 1, NULL); } else { // No PSRAM memset(&extmem_smalloc_pool, 0, sizeof(extmem_smalloc_pool)); } But where...
  17. T

    Teensy 4.1 linker script is really wrong

    Linker Script IS CORRECT! as well as the MPU config. I take it back. Linker Script has just a "risk". Details: Linker Script, "imxrt1062_t41.ld": _flexram_bank_config = 0xAAAAAAAA | ((1 << (_itcm_block_count * 2)) - 1); file "startup.c": void ResetHandler(void) { IOMUXC_GPR_GPR17 =...
  18. T

    Teensy 4.1 linker script is really wrong

    Thank you, Paul, for your effort to dive so deep into this issue. I appreciate your great support, you are doing a great job. (I was not available the last few weeks, I am sorry for late response). Comments and more details: To get it compiled - you have to modify the linker script!: the...
  19. T

    Teensy 4.1 linker script is really wrong

    Moderator Edit: linker script is fine, see this message for info. I can confirm now, the linker script for Teensy 4.1 is really wrong: It has this original definition: MEMORY { ITCM (rwx): ORIGIN = 0x00000000, LENGTH = 512K DTCM (rwx): ORIGIN = 0x20000000, LENGTH = 512K RAM...
  20. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    I get all of this, but I am sure the Linker Script is wrong. I have test case for it (separate post).
  21. T

    Uploading "bigger programs" with Platformio to T4.1 switches between working and not

    Thank you. Sure. I think, I am old enough (experienced) to know those issues.
  22. T

    Teensy 4.1 : cannot make use of "free" memory - resulting in FW crash

    This is the example: https://github.com/tjaekel/Teesny_4_1 compile and run as it is after download: all fine - UART (terminal) should be there - a welcome message and prompt, acting to user input. Prerequisites: it uses: QNEthernet and freertos-teensy The TsyDMASPI should be part of the...
  23. T

    Teensy 4.1 : cannot make use of "free" memory - resulting in FW crash

    OK, you can download my project on GitHub, modify (just change one line of definition), run it and see the difference. https://github.com/tjaekel/Teesny_4_1
  24. T

    Teensy 4.1 : cannot make use of "free" memory - resulting in FW crash

    Thank you. Great details, I appreciate (and understand). I would prefer to have a minimal stack region size in linker script: let me set stack region size and fire a warning towards me if not enough left. (I have this approach in all my STM32 projects: they have reserved stack regions)...
  25. T

    Uploading "bigger programs" with Platformio to T4.1 switches between working and not

    OK, what I have learned (on another thread). In the compile log: the "free" there is actually your stack size left (the "free for local variables" means "stack size left"). If this value becomes too small (but no idea what "too small is") - your project can crash. Reduce the size of other data...
  26. T

    Teensy 4.1 : cannot make use of "free" memory - resulting in FW crash

    Thank you. I got it now. "free" is actually a hint how much stack space is left ("free for local variables"), not a hint if I could increase buffer sizes. Teensy is not unbreakable (as I have realized). Even writing C++ code - a large project can brick the board. (I am not expecting such one)...
  27. T

    Teensy 4.1 : cannot make use of "free" memory - resulting in FW crash

    This makes a bit of sense, even it is confusing. Thank you. My assumption was: "free" tells me, how much free space left in this memory, considering also the (reserved) size of the stack region. The stack region could be a fix size region, with known total space for stack (but obviously not...
  28. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    BTW: the MPU config should look like this (but it does not solve the problem with incorrect linker script): SCB_MPU_RBAR = 0x00000000 | REGION(i++)...
  29. T

    Uploading "bigger programs" with Platformio to T4.1 switches between working and not

    BTW: if I increase in my project a buffer by additional 32K where the compile log tells me as "free" still 83K left and still all clean on compile - my project FW crashes during runtime! The generated FW seems to crash when the size (potentially on data, buffers) exceeds a specific (but...
  30. T

    Teensy 4.1 : cannot make use of "free" memory - resulting in FW crash

    I see on compile log, some "free" memory left. I want to increase a buffer to make use of it. But the code of my project crashes. Why? Here, compile log when it still works: Memory Usage on Teensy 4.1: FLASH: code:270504, data:88660, headers:8448 free for files:7758852 RAM1...
  31. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    Sure, internally, inside the chip, the same memory (512K in total). But fetching code as 0x0000000X cannot be the same as reading code from 0x2000000X. I think, the "split configuration" sets a "memory mapping", so, when divided into 256K + 256K, the read/write on address 0x2000000X is at 256K +...
  32. T

    Teensy 4.1 : EXTMEM and USB UART - not responsive anymore

    I agree: Using Teensy FreeRTOS changes the "picture". What I have realized meanwhile - with using FreeRTOS: when Serial.avalable() was not successful - I did a vTaskDelay(1) (to give a bit more time and try again during next round). Changing to taskYIELD(); has improved, but not completely...
  33. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    Are you talking about having "aliasing"? Maybe, but it does not make sense: if a data location shares the same address like a code location (due to aliasing), it will destroy my code. I think, the Teensy startup is configured as: ITCM = 256K DTCM = 256K but this is not reflected correctly in...
  34. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    Sorry, I am lost. Not an IDE issue, the linker script (or runtime code) is wrong. Sure, if nobody has ever generated project with more as 1M code and data (and it would compile clean) ... I think about: "Setting either to a lower fixed value is a waste of resources" NO, it is already a waste...
  35. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    NO - they are not "both 512K"! The datasheet says: the 512K can be shared, can be split, into ITCM and DTCM. So, both, ITCM PLUS DTCM have max. 512K, but not 512K each. Yes, it depends, how do you configure the split. But it remains as: 512K in total for both (not 1M). Yes, ITCM + DTCM + RAM2...
  36. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    I use Arduino IDE, 2.1.1 with Teensydruino, V1.58.1 "Declaring them each 256K would be limiting and wrong" - NO - it would be the correct way! MCU does not have 3x 512K memories! (I am sure) The other stuff with 'const', the "no caches on TCM" ... I am aware off and know. (intending to post a...
  37. T

    Teensy 4.1 : Linker Script correct? MPU config? DMAMEM?

    Moderator Edit: linker script is fine, see this message for info. I think (actually, I am sure) - the Teensy 4.1 Linker Script is NOT correct: I extend my project, I shuffle code and data around (e.g. FASTRUN, DMAMEM, regular DTCM RAM...), the code starts crashing, even it was working before...
  38. T

    Teensy 4.1 : dynamic load of code (EXE files for my FW)

    Thank you. Pointing to Lua was great. I appreeciate. I have checked a bit the Lua code - looks promising and I might try. FYI, I run a C-code interpreter ("Pico-C", similar to Lua, using hashing, like a JIT compiler). The problem is: I need the EXTMEM (external QSPI RAM), it is pretty RAM...
  39. T

    Teensy 4.1 : EXTMEM and USB UART - not responsive anymore

    Thank you for the response. Let's see if I can strip down my project to the "root cause" (potentially not so easy, I use also FreeRTOS). I know "USB UART" is VCP. Thinking about my project and what might be possibly happen: I have a main thread, which polls with Serial.avalaible() for a...
  40. T

    Teensy 4.1 : dynamic load of code (EXE files for my FW)

    An invitation to brainstorm, implement ... - or if you have already an implementation... Goal I want to run my FW. It should be possible to load code, during runtime and let it be executed, without to touch the running system. Load different code files, without to flash, without to reset MCU -...
  41. T

    Teensy 4.1 : EXTMEM and USB UART - not responsive anymore

    I run a thread with an UART shell (commands to control the system). There is a GPIO interrupt, which comes with 1 KHz repetition rate. The INT Handler for this GPIO uses EXTMEM, e.g. to store data in EXTMEM (which can be 1 KByte per interrupt). So, the load due to this GPIO INT plus EXTMEM is...
  42. T

    Teensy 4.1: SPI DMA to/from EXTMEM?

    I want to use EXTMEM (QSPI flash) as source and destination for SPI transfer, SPI in DMA mode (using TsyDMASPI). First trial looked like: it is not possible. Is it possible to do peripheral DMAs (SPI) to/from EXTMEM? Assuming it would be possible, it raises some other questions: Is the EXTMEM...
  43. T

    Teensy 4.1 : why my own GPIO functions are 10 times faster? ITCM vs. external flash?

    I can confirm, using digitalWriteFast() works: it reaches the same speed (a tiny bit faster because the pin is written directly, no IF's and checks...). Why the speed was so different - still no clue: I've checked in *.LST file: both functions seem to be on ITCM, my function on address 0x0059C...
  44. T

    Teensy 4.1 : GPIO config is NOT glitch free

    Yeah, I found today that this will do the same job. Thank you.
  45. T

    Teensy 4.1 : overclocking - do NOT do!

    Update: I have a heat sink (cupper) on MCU. temperature is fine (maybe 40C). The drive strengths (DSE) does not matter so much for speed (more related to external impedance, I have scope with 1 MOhm probe only (no load)). The Slew Rate (SRE) and Speed (SPEED) matters more for maximum speed...
  46. T

    Teensy 4.1 : why my own GPIO functions are 10 times faster? ITCM vs. external flash?

    I tried to measure the max. speed I can toggle a GPIO pin (full speed, endless loop). Strange is: if I use the LIB functions - 10 times SLOWER if I implement my own, similar function - more as 10 times FASTER Here the code I use to test (just the loop: configure pin as output first): /*...
  47. T

    Teensy 4.1 : overclocking - do NOT do!

    FYI, I found a thread in Internet to overclock the MCU on Teensy 4.1 board. Even they say, "with a heatsink or active cooling" you can reach up to 1 GHz (1000 MHz, compared to 600 MHz nominal), it is not really true. What I have found: faster as 600 MHz degrades GPIO signals (their peak level...
  48. T

    Teensy 4.1 serial communication issue

    What might happen in your case: the IDE opens and grabs the UART. So, it is busy for any other tool, e.g. TeraTerm. Try to change IDE not to open UART after flashing the FW. It works fine for me. BTW: it takes a while until the USB UART comes back after flashing the FW: you hear disconnects and...
  49. T

    Teensy 4.1 : GPIO config is NOT glitch free

    The library functions for Teensy 4.1 GPIOs, e.g. in "digital.c" do NOT support a glitch free configuration. Use Case I want to generate an nRES signal (low active, inactive is high) for an external board. If I reset the MCU, e.g. via software, as a command, BTW: I do via...
Back
Top