Skip to content

TEENSY: Add flash and SD card file system - #291

Open
Joe7M wants to merge 5 commits into
smallbasic:masterfrom
Joe7M:master
Open

Joe7M wants to merge 5 commits into
smallbasic:masterfrom
Joe7M:master

Conversation

@Joe7M

@Joe7M Joe7M commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Hi Chris,

  • I added a persistent flash file system for the Teensy. Users can access the memory to store data. If a MAIN.BAS is found in flash memory, it will be executed at every start of the Teensy. Once flash worked I realized that adding the sd card is quite simple.
  • Because the file teensy.cpp got too large, I split it in several small files.
  • I added new examples and new hardware (LCD text display and a I2C accelerometer).
  • I added a handler which get executed when a module is closed. I needed it to close open files, otherwise it happened quite often, that the files were empty after restart.
  • You can upload the file console.bas to the Teensy to get a simple console where you can use commands like ls or cp to manage your files on the Teensy. Type "help" for a list of commands.

Best regards, Joerg

@chrisws

chrisws commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

This looks fantasic. I'm looking forward to giving it a try on my board.
Could you please:

  1. add an entry to the ChangeLog file following the same format
  2. add the following header to each of the source files (or something close to this)
// This file is part of SmallBASIC
//
// Copyright(C) 2026 Joerg Siebenmorgen
//
// This program is distributed under the terms of the GPL v2.0 or later
// Download the GNU Public License (GPL) from www.gnu.org
//

When building for windows (cross-compiling or MSYS2) the warning
`warning: »__p__environ« ohne Attribut »dllimport« redeklariert:
vorheriges »dllimport« ignoriert [-Wattributes]` is shown. Removing
`extern char **environ` for Windows build solves the issue.
@Joe7M

Joe7M commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

I did the changes. I also added a bug fix when building for Windows using MSYS2. Compiling stopped with this __p__environ-warning.

Try it on your Teensy and let me know if you find bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants