Project: Teensy 4.1 with CMD line, Web server/python, SD card, FreeRTOS, Pico-C

tjaekel

Well-known member
I'd like to share my project, find it here:
https://github.com/tjaekel/Teesny_4_1

It provides these features:
  • UART Command line interpreter: enter commands on UART (e.g. TeraTerm)
  • WebServer access (via forms) to fire commands: use WebBrowser for commands, use Python script to send commands (e.g. like TELNET)
  • HTTPD port 80 also for Python scripts (including BINARY commands): do commands, SPI transactions... via host Python script
  • use SD card, on command line and for TFTP: transfer files, execute a script, launch a Pico-C script...
  • TFTP to transfer files from/to SD card
  • Pico-C code interpreter: write C-code without a compiler: enter C-code statements to extend the system, load and execute a script from SD card
  • FreeRTOS: run real threads (preemptive), GPIO as real-time interrupt, trigger Pico-C INT handler - all features running in parallel and background
  • GPIO interrupt, in real-time: launch a FreeRTOS thread when triggered - immediately (no polling, and use all other functions like Serial.print() in INT thread handler)
  • SPI transaction, using DMA: fastest SPI transfer possible
  • SYS_CFG: store system parameters in flash memory, configure system on a persistent basis (reboot with modified settings), update SYS_CFG for next reboot...
  • all network stuff based on QNEthernet, not AsyncWebServer anymore (does not work together with FreeRTOS or for BINARY mode)

It needs (for compile and use):
  • external 2x QSPI RAM memory (EXTMEM, 2x QSPI RAM soldered) - for Pico-C only (if Pico-C is not needed or QSPI not available - disable EXTMEM and Pico-C)
  • FreeRTOS: download install the ZIP - I do not use TeensyThreads anymore!

You can find FreeRTOS for Teensy 4.1 here:
https://github.com/tsandmann/freertos-teensy
Install the ZIP (otherwise it will not compile)

If you do not have 2x external QSPI RAM: disable Pico-C, do not launch Pico-C.

When running: open a UART terminal, any baudrate, type "help" to see all commands implemented.
Access via WebBrowser, <MCUIPAddress> as URL, port 80: see a form and fire commands: use "ipaddr" on UART command line to know IP address (DHCP used)
Do "sdinit 1" on command line (for SD card) and transfer files via TFTP, print a file, display directory content...
Launch Pico-C on UART command line, via "picoc": enter C-code statements, C-code programs, launch a C-code script/program from SD card... no need for a compiler: interpreted C-code
When Pico-C launched: use "help();" to see implemented user commands (C-code functions).

Have fun with it or use as reference how to use FreeRTOS, SD card, Network, Web server, TFTP, real-time INT handling ... on Teensy 4.1. board.
 
Back
Top