Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: Linux on Teensy 3/4?

  1. #1
    Junior Member
    Join Date
    Mar 2018
    Posts
    17

    Linux on Teensy 3/4?

    A couple of times I've wished I could run Linux on a Teensy 3 or 4. Wonder how hard a port would be? Yeah, I know, Teensy is a different animal, but so was the RPi back in the beginning. One Teensy as a general purpose computer, mated with another Teensy as the dedicated microcontroller would have been just the thing for a couple of projects...

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,789
    Quote Originally Posted by skypuppy View Post
    Wonder how hard a port would be?
    Linux on Teensy would be somewhere between "not worth the incredible effort" to "pretty much impossible".

    There is no MMU, so you're immediately resigned to not-so-useful ucLinux. The best case (but unlikely) scenario is a Linux system that's incompatible with most Linux software and lacks the stability of real Linux running with protected memory. Ports of ucLinux are usually called a success if the kernel boots and runs a shell, even if no other software is capable of running. Odds of actually achieving anything even at good are pretty slim.

    The next big hurdle would be the memory size. Maybe it could be done on Teensy 4.1 with PSRAM chips added, so you're working with 8MB flash and 17MB RAM. All the other Teensy models aren't going to have anywhere near enough memory.

    Then there's the small matter of getting all the drivers working. Some might come over from Linux support for iMX6 - iMX8 processors. But many hardware details, like DMA, are completely different than NXP implemented on those application processors.

    Nobody has shown any interest in this incredibly long and difficult journey which has little change of arriving at a not very satisfying result.

  3. #3
    Junior Member
    Join Date
    Mar 2018
    Posts
    17
    Wow! Well thought out reply! You make a very strong case against. All practical and honest reasons. Using an RPi or equivalent is much more logical indeed.

    But you busted my widdle bubble.

    I get these whimsical ideas once in a while and they're fun to play with, anyway.

  4. #4
    Junior Member
    Join Date
    Feb 2021
    Posts
    4
    Hi,

    new user. I've been curious about it because SliTaz made a port for the Raspberry Pi that ran on 7MB RAM: https://www.cnx-software.com/2012/12...-raspberry-pi/

    I've been looking into whether it could be ported to the ESP32-S2-WROVER, which has 4.5MB RAM. There is a more barebone version: https://github.com/SliTaz-official/tiny-slitaz that runs on 4MB RAM, but would likely need additional packages (FLTK/FLWM would be nice).

    Nonetheless, it would be interesting because I'd like to build a laptop out of it.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,789
    Quote Originally Posted by nanokiwi View Post
    .... because I'd like to build a laptop out of it.
    What is your reason for wanting to build this special laptop?

    If your goal is to publish something like a magazine article or youtube videos showing that this seemingly impossible feat can be done in some extremely limited way that technically does manage to boot up and run Linux, or as just a personal challenge or learning exercise, then maybe the tremendous effort could be worthwhile. On a technical level, you'll probably win a lot of respect, and probably get lots of temporary fame in the geek world and maybe youtube views.

    But if you're imagining ending up with a laptop you could realistically use for even relatively simple productivity applications, right now is the best moment to come to your senses.

    Seriously, you should only embark on this long & difficult journey if it really is about the journey and not the destination!

  6. #6
    Junior Member
    Join Date
    Feb 2021
    Posts
    4
    Quote Originally Posted by PaulStoffregen View Post
    What is your reason for wanting to build this special laptop?

    If your goal is to publish something like a magazine article or youtube videos showing that this seemingly impossible feat can be done in some extremely limited way that technically does manage to boot up and run Linux, or as just a personal challenge or learning exercise, then maybe the tremendous effort could be worthwhile. On a technical level, you'll probably win a lot of respect, and probably get lots of temporary fame in the geek world and maybe youtube views.

    But if you're imagining ending up with a laptop you could realistically use for even relatively simple productivity applications, right now is the best moment to come to your senses.

    Seriously, you should only embark on this long & difficult journey if it really is about the journey and not the destination!
    Reason for building: Yes, it is more about the journey, not the destination! It's part art project, part proof of concept. It's only as practical as an e-reader is considered a marketable product- it's leisurely reading and writing, not photoshop or productivity. Yet e-readers are still a popular product sold today. I haven't really understood why computers use so much more memory and have ever-greater requirements, even if I do not use all the apps. This post (if you use Chrome browser's translate function, it can translate from Russian https://habr.com/ru/company/embox/blog/466379/) nicely wonders the same: "Well, if you remember the well-known phrase “640 kb should be enough for everyone”, then a reasonable question arises - why is modern desktop software so gluttonous? For example, a calculator in windows 10 in idle mode consumes as much as 16 MB of memory."

    My first computer was a Pentium with 8MB of RAM, and had a suite of applications- calculator, solitare, tons of programs that used no where near that 8MB of RAM. I think it would be nice to demonstrate a product that shows how far computers have gone, and how simple they used to be, and yet were able to give the user-space an extraordinary amount of freedom to move a cursor around a screen with so little memory. Today apps several times larger than that only let you tap a couple boxes on a screen at a time.

    https://medium.com/this-should-exist...s-4182a62d63b2 <--I kind of want to build what this blogger wrote about.

    I think the proof of concept part is more about showing what's possible, and then as semiconductors get more efficient, more apps can be shown to run on it. I looked at every possible way to make it unique, and I added even more challenges. That isn't just the only thing I want to do. I want it to run on solar panels, and not just that, but ambient indoor light! I've documented my progress here:

    https://forum.ei2030.org/t/e-ink-low...he-same-lid/82 If it became like an open source project, then it could be used to build other custom laptops, like a mobile-ITX motherboard.

    I appreciate the feedback- I wrote this post more as a gauge to see whether some are skeptical or curious. I think you gave the most balanced response- if it were productivity and performance/speed I would probably fail, and it's the journey that interest me.

  7. #7
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    627
    You could probably develop an e-reader / writer without the OS in a fraction of the time.

  8. #8
    Junior Member
    Join Date
    Feb 2021
    Posts
    4
    Quote Originally Posted by brtaylor View Post
    You could probably develop an e-reader / writer without the OS in a fraction of the time.
    I just got some interesting suggestions on Reddit: "If you just want Linux on an ESP32, one easy option is u/Spritetm's MiniPDP11 project. Or you can port u/dmitrygr's uARM project. It was written for AVR, but it shouldn't take much modifying of the PC version to work, because the ESP32 has enough RAM/"
    https://spritesmods.com/?art=minipdp11&page=3

    I also found a pretty impressive terminal on ESP32: https://hackaday.io/project/168193-e...per-controller I wouldn't mind developing an e-writer - the Inkplate is developing an e-reader: https://www.crowdsupply.com/e-radion...th-inkplate-10

  9. #9
    Senior Member manicksan's Avatar
    Join Date
    Jun 2020
    Location
    Sweden
    Posts
    228
    Final Cartridge 3 on c64 could also run a desktop with movabe cursor and had tools as calculator notepad etc.
    And only run on 64k memory.

  10. #10
    Junior Member
    Join Date
    Feb 2021
    Posts
    4
    Quote Originally Posted by manicksan View Post
    Final Cartridge 3 on c64 could also run a desktop with movabe cursor and had tools as calculator notepad etc.
    And only run on 64k memory.
    Thank you manicksan! I am amazed by the resourcefulness of early computers. I found from the Final Cartridge 3 wikipedia article, "Unless RUN/STOP key was held down during power-on or reset, the cartridge presented a graphical WIMP desktop."
    "Windows, Icons, Menu, Pointer" https://en.wikipedia.org/wiki/WIMP_(computing)

    "Though the acronym has fallen into disuse, it has often been likened to the term graphical user interface (GUI). Any interface that uses graphics can be called a GUI, and WIMP systems derive from such systems. However, while all WIMP systems use graphics as a key element (the icon and pointer elements), and therefore are GUIs, the reverse is not true. Some GUIs are not based in windows, icons, menus, and pointers. For example, most mobile phones represent actions as icons and menus, but do not often don't rely on a conventional pointer or containerized windows to host program interactions.[citation needed]"

    I spent over a month on various RTOS and linux forums trying to explain I want "linux with a GUI", even saying I want a "linux with userspace", but windows, icons, menu, pointer" (WIMP) is far more precise.

    The ironic thing about this is that many microcontrollers have much more RAM today than 64k, and it is often viewed that running apps with windows and tiles would somehow be more limiting than a non-WIMP GUI. But I think of this like the glass half empty/half full. The microcontroller can't run a full Ubuntu or Raspbian Lite. But what is gained from having a windows, icons, menus and pointers? Granularity of control over apps.

    I feel like I am asking someone that I want to fly somewhere(anywhere) and someone tell me, "Sorry, there aren't any flights available to the moon right now."

    There's another aspect to this, which I won't deny.

    "#Criticism
    Some human–computer interaction researchers consider WIMP to be ill-suited for multiple applications, especially those requiring precise human input or more than three dimensions of input.[9] Drawing and writing are example of these limitations; a traditional pointer is limited by two dimensions, and consequently doesn't account for the pressure applied when using a physical writing utility. Pressure sensitive graphics tablets are often used to overcome this limitation.[10]"

    Another issue with WIMP-style user interfaces is that many implementations put users with disabilities at a disadvantage. For example, visually impaired users may have difficulty using applications when alternative text-based interfaces are not made available. People with motor impairments, such as Parkinson's disease, may not be able to navigate devices precisely using the traditional mouse pointer for input. To overcome these barriers, researchers continue to explore ways to make modern computer systems more accessible.[11] Recent developments in artificial intelligence, specifically machine learning, have opened new doors for accessibility in technology, or assistive technology.[12][13]"

    This makes wonderful sense. I agree with this 100%. But it doesn't mean I want to get rid of it. I think mobile phones have in a way almost given rise to the abandonment of desktop window development. I view touchscreens/haptic technologies as an additive feature, rather than a feature that should subtract other features like WIMP. Mobile phones become useless when the touchscreen fails, leading to e-waste. Which isn't to say that they can't be fixed, but who bothers? It would be more environmental to reuse hardware made for phones and allow it to be compatible with a laptop chassis so that a standardized mobile motherboard can be reused, if someone doesn't want to use the phone's broken case anymore. This phonemaker uses a reusable chassis: https://www.fairphone.com/en/
    Phones are far more powerful than many decade-old laptops, so they could also be repurposed as productivity devices like a lightweight laptop: https://www.zdnet.com/product/lenovo-yoga-c630/ Some phones have the option to allow a keyboard to be added via bluetooth. A mouse may not be as useful, since navigating to different screens might require scrolling to the end of the screen and it might require some input to indicate window switching. Many RTOS like the M5Stack have many IoT features. It would be very practical to be able to navigate the apps in a way that doesn't depend on the touch screen. Something like FLTK would be lightweight but also slightly more RAM intensive, maybe 2-4MB of RAM might be needed.

    But back to my solar laptop idea, using microcontroller may seem be limiting if one is looking at microprocessors from the outside in, but having enough RAM- some microcontrollers have 384kB and up to 2MB RAM in some cases- The Ambiq Apollo 4, for example. Considering Windows 1.0 ran on 1MB of RAM, it was used for Office/business productivity at one time. It would be interesting to see what kind of applications could run. I remember a term in the 1990s, "https://en.wikipedia.org/wiki/Multimedia_computer
    "Multimedia capabilities were not common on IBM PC compatibles until the advent of Windows 3.0 and the MPC standards in the early 1990s. The original PCs were devised as "serious" business machines and colorful graphics and powerful sound abilities weren't a priority. "
    The term multimedia is taken for granted. Every PC today is multimedia. I admit it is still is asking a lot to expect a microcontroller to do multimedia, but multimedia isn't necessarily what an IBM or early Windows OS necessarily sought to do. They were marketed towards accountants and memo writers. Which isn't to say I want to do my taxes on Excel 1.0 lol. But I think it would still be a positive improvement- an addition, rather than a subtraction. In this way, the added feature would be that it wouldn't require a DC, USB-C or micro-USB charger, if it could be powered by indoor light, like a TI-30Xa. It would be subtractive if I removed the USB/DC charger altogether. A hybrid represents options.

    The flexibility of having multiple apps, via flash or external storage, would increase the versatility of the device. I found this AVR microcontroller running Contiki:

    https://en.wikipedia.org/wiki/Contiki#Features Pretty interesting! Click image for larger version. 

Name:	Contiki-avr.png 
Views:	8 
Size:	10.5 KB 
ID:	23548 Thanks for your time!
    Last edited by nanokiwi; 02-01-2021 at 03:34 PM. Reason: added info, corrected typo

  11. #11
    Member
    Join Date
    Jan 2014
    Location
    New Jersey, USA
    Posts
    26
    Quote Originally Posted by PaulStoffregen View Post
    Linux on Teensy would be somewhere between "not worth the incredible effort" to "pretty much impossible".

    There is no MMU, so you're immediately resigned to not-so-useful ucLinux.
    I can't imagine anyone putting this effort in on a MCU without a MMU. The lowest end Cortex with MMU is the A8. This is by design. By definition the Cortex M series processors do not include an MMU, nor are they ever likely to. See this from the arm community site: https://community.arm.com/cfs-file/_...EN_5F00_v2.pdf

Posting Permissions

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