Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: Yleisajattelija on September 13, 2024, 05:02:35 AM

Title: piCore for DUMMIES
Post by: Yleisajattelija on September 13, 2024, 05:02:35 AM
I start this new thread instead of "polluting whole TC-forum" :)

I have a Rasperry project with home-made wood chip/pellet -burner. I have built it for 2-3 years, and now it working with relay control. With relays it very difficult to implement complicated control functions and for that I already bought Rasperry Pi 3 board. I have previous linux experice with Debian and Guruplug -miniserver about 10 years ago, and I have embedded software coder background, but unfortunatelly about 25 years ago, so I'm too "aged newbie" on this subject.

TC is missing documentation (as every linux distro), and I think this may help other newbies to start using TC in embedded projects. I'm experinced development engineer, and I have no mental limits to produce countless flow of errors, so I hope comments to clean those errors from future versions of documentation.

Linux world is badly doconted, but everyone in this field is familiar with "HOW-TO" -documents. Typically those documents are unmaintained and useless, or even harmful for studying linux.

That's what is going to happend these documents, too, sooner or later. This is the main reason, why thsese documents will be more "WHY-TO" -style, to be useful even unmaintained.
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 13, 2024, 05:36:06 AM
For start, let's make few simple QYSA questions: (QYSA=Questions You Should Ask).

Q Why not use Arduino/Pico whatever -simple programmable unitary chip/-board?
A Well, this is almost filosofical problem. I could use Arduino or Pico or whatever to make this project easier and faster. Actually, i have self-made fully functional 8031 -based development environment with EPROMMER, ASM/C compilers and sofisticated debugging system, and tons of already made software libraries with carefully build device drivers. Main advantage would be real-mode processor with linear non-virtual memory management and complete control of HW-interrupts and device driver code. Disadvantages are aging technology and missing software support for compilers ets. 8031 is still used today for cost limited applications, but to update and maintain whole tool chain is demanding. There is no commercial add-on board supply as Rasberry, and some native performance limits. These ARM-SOC:s has huge computing performance and numerous I/O-peripheral functions just by 10$ (for example Alwinner A20)).  Compilers, debuggers etc. are free and updated. With Rasperry and HAT-cards I can do almost everything with 100€, and that's nothing compared to develoment costs for proprietary HW even hobby projects. When system with Rasberry board and add-on cards and develoment system is done once, code and HW-desing resuse are easy and cheap. Times are chanced, and I have to update my embedded electronics develoment system, too.
Title: Re: piCore for DUMMIES
Post by: mocore on September 14, 2024, 05:51:49 AM
imho

less "for DUMMIES"
more for the  curious / inquisitive / intrigued
 8)

Title: Re: piCore for DUMMIES
Post by: mocore on September 14, 2024, 06:23:51 AM
TC is missing documentation (as every linux distro), and I think this may help other newbies to start using TC in embedded projects. I'm experinced development engineer, and I have no mental limits to produce countless flow of errors, so I hope comments to clean those errors from future versions of documentation.

Linux world is badly doconted, but everyone in this field is familiar with "HOW-TO" -documents. Typically those documents are unmaintained and useless, or even harmful for studying linux.

That's what is going to happend these documents, too, sooner or later. This is the main reason, why thsese documents will be more "WHY-TO" -style, to be useful even unmaintained.

wrt
>documentation

i happened to read https://github.com/mbarbin/cmdlang
Quote
We are inspired by the [1]diataxis approach to technical documentation, which we use to structure our documentation.

which describes its self as
Quote from: https://diataxis.fr/
[1] A systematic approach to technical documentation authoring.

which on abit of a tangent reminds me of " Alex Wright - The Web That Wasn't: Forgotten Forebears of the Internet "   
Title: Re: piCore for DUMMIES
Post by: mocore on September 15, 2024, 02:39:30 AM
more for the  curious / inquisitive / intrigued
or perhaps
those who know that they know nothing ( about piCore )

[1] https://en.wikipedia.org/wiki/I_know_that_I_know_nothing

as mentioned hear
It’s the bootLoader provided by raspberry pi.  All the documentation is on their site.   But it is closed source.

there is some stuff *you* cant know about  ???
aka
all i know that i know nothing about closed source

i guess with that in mind the original title might seam more appropriate :(
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 16, 2024, 01:56:21 AM
Before using piCore, healthy HW is needed.

"Clean" SOC costs 3€:

https://www.ebay.com/itm/272614818888?_skw=BCM2837B0&itmmeta=01J7WP76581B8CBB2F17794B9K&hash=item3f791c0448:g:9KEAAOSw4CFY4GyZ&itmprp=enc%3AAQAJAAAA4HoV3kP08IDx%2BKZ9MfhVJKmCF%2BlHtsRSUIR5wAqucnxrgYNAX612rQJXowrY7suep8o8uarCuKR3GiACLVLuXDdMXJ0ejAWQyyC1NsHrTDeHYsQcotwbC39oCKXXhQPgYr0C69eLNU%2BbajgX7e9qGon4vWSFNzJjiNL%2Bcqs7ocvKGEKT54C9kbdOcU5h5YC4QpR7ifbossqPKmxlDt%2F7uuEka0usyga5J4LbGPrlTAej6foJUgu2%2FMzeeUkdwHPnjOT22nwKcssnfR514Ti%2BY9NbvV%2FMdr6idtCcRkW10vuS%7Ctkp%3ABk9SR9zinJa_ZA
Title: Re: piCore for DUMMIES
Post by: mocore on September 16, 2024, 04:42:15 AM
Before using piCore, healthy HW is needed.

"Clean" SOC costs 3€:

is this the opening chapter ?
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 16, 2024, 06:49:30 AM
Before using piCore, healthy HW is needed.

"Clean" SOC costs 3€:

is this the opening chapter ?

I thought that this is The-Pro-Distro... :-)

For piCore bootloader Broadcom bootloading JTAG-spesification is needed (which it's very difficult to get) and making propietary bootloader for this kind of multiprocessor environmet it is (of course) very challenging job.
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 16, 2024, 08:09:41 AM
QYSA: What in earth newbie need this topic for microchip internals and bootloader, especially if you cannot accsess whole thing? 
A: To use piCore you need a hardware, and it have to be Rasperry in this case. As discussed, Rasperry seems to keep secret information for bootload process and transition from real mode to protected mode. This transition is typically one-way door, and after that bootloader code executed nobody (exept preloaded system code) has direct access to physical memories and I/O -hardware registers. That means lot of problems when you need to write new device drivers or have to fix problems with old ones. One spesific problem is memory setup, after transition to protected mode MMU is initialized and memories mapped to virtual space. If physical memories are changed, this mapping (typically) must be done again, and unfortunatelly for security reasons it must be typically made before transition to protected mode. But this memory mapping may be secret and anyway must be done by Rasberry, in this case. There is some ways to avoid this problems, typically special memory-map files on bootload process, but it difficult and very complex. This may be serious problem for other linux distros port to Rasberry, and may even prohibit it.
Title: Re: piCore for DUMMIES
Post by: Rich on September 16, 2024, 09:24:02 AM
Hi Yleisajattelija
Before using piCore, healthy HW is needed.

"Clean" SOC costs 3€:

https://www.ebay.com/itm/272614818888
I just wanted to point out something I noticed in that sellers ad.

Instead of using a piece of anti-static foam to display their product, they
chose to use what appears to be carpeting. Possibly composed of a man
made fiber such as polyester, acrylic, nylon, etc:

(https://forum.tinycorelinux.net/index.php?action=dlattach;topic=27265.0;attach=6884)
Title: Re: piCore for DUMMIES
Post by: mocore on September 17, 2024, 06:24:08 PM
its "nice" the newer pi have alternative options for booting sans SD card  (older ver's (can be configured to) just require flash to boot the hw)

wrt flash memory ... https://forum.tinycorelinux.net/index.php/topic,26482.msg170797.html#msg170797

 this echo's in the hollow betwixt my ears
"you're not really storing your data you're storing a probabilistic approximation of your data" - Exploitation of an SD Memory Card
 :'(
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 18, 2024, 01:35:50 AM
Replacing SoC rosolve some problems, if Broadcomm will deliver JTAG -first/second stage bootloader spesificcation. There is ofcourse some security bits, which may be se or not, depending of few issues,....

There is some limux ports for other HW:

https://www.olimex.com/

https://www.myirtech.com/

Olimex use Alwinner chips, and Alwinner publish some data for JTAG (page 229):

https://www.olimex.com/Products/SOM/A20/_resources/A20-User-Manual-2013-03-22.pdf

 
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 18, 2024, 01:47:58 AM
In this case, I need some add-on boards for Rasberry I/O bus. There is many add-on boards on ebay for Rasberry, but what is important is piCore compatible drivers. Nowdays linus uses devicetree blob:

https://www.kernel.org/doc/html/latest/devicetree/usage-model.html

....which was developed in linux PowerPC port:

https://docs.kernel.org/arch/powerpc/bootwrapper.html

That device tree mechanism works well is PowerPC environment, but as Linus has said "armel is awful mess"...

...but this thread is for newbies, so some questions must be askeed first... 
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 18, 2024, 02:57:20 AM
QYSA: Why they discuss ARM problems in kernel device-tree-documentation and why this in important for newbie?
A: Well, ARM is not a problem but ARM SoC:s are. There is several reasons for that mess and result is that your Rasperry Pi add-on-board drivers are probably not working with piCore.

QYSA: What boards and drivers are working with piCore?
A: Let's hope piCore development group can tell that to us... 
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 18, 2024, 05:13:11 AM
For example this:

https://www.waveshare.com/wiki/High-Precision_AD/DA_Board

For Rasberry Pi OS that driver probably works.
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 19, 2024, 07:50:12 AM
Those HAT-modules cannot handled with "Static device tree" -structure, and "Device tree overlay" -batch system is used for Rasberry.

U-boot supports DTO, but Linux not, so it's difficult to say how it works, but I can guess, that U-boot modifies Device tree file and transfers it as static structure to kernel:

(DTO is on 23 min. point of video)

https://www.youtube.com/watch?v=Nz6aBffv-Ek
Title: Re: piCore for DUMMIES
Post by: patrikg on September 19, 2024, 10:40:55 AM
This thread was long time ago, with my first RaspberryPi working with uboot and nfs.
I was struggling with device tree. fdt.
https://forum.tinycorelinux.net/index.php/topic,21356.msg133578.html#msg133578
 (https://forum.tinycorelinux.net/index.php/topic,21356.msg133578.html#msg133578)
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 20, 2024, 05:33:04 AM
This thread was long time ago, with my first RaspberryPi working with uboot and nfs.
I was struggling with device tree. fdt.
https://forum.tinycorelinux.net/index.php/topic,21356.msg133578.html#msg133578
 (https://forum.tinycorelinux.net/index.php/topic,21356.msg133578.html#msg133578)

I suppose, piCore is loaded by Rasberry image -loader:

https://www.raspberrypi.com/software/


Typically U-boot sets up memories and device drivers (fdt) and starts microprocessor multiprosessing before launching image from SD-card. Rasberry uses that "Device Tree Overlay" process, which probably modifies fdt dynamically for image. Rasberry OS uses same image loader than other distroes, and IF that mechanism works as it should be working, piCore should get updated fdt with fully functional python module to use for add-on boards.

But, there seems to be some problems with Rasberry 5, too:

https://www.tomshardware.com/best-picks/best-raspberry-pi-hats


Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on September 20, 2024, 05:52:54 AM
Rasberry is a product of "Rasberry Pi Foundation":

https://www.raspberrypi.org/about/

They seems to be nice people, and they want to support communal youth well-being.

So, I think they want to support other distroes possibility to use Rasberry Pi and I/O modules: Even if I/O module drivers for piCore are not working just now, it would be worth or try to buy some modules for Rasberry 3 B plus, I think.
Title: Re: piCore for DUMMIES
Post by: mocore on September 21, 2024, 05:46:36 AM
Rasberry is a product of "Rasberry Pi Foundation":

https://www.raspberrypi.org/about/


what makes you think that ?

https://www.arm.com/partners/catalog/raspberry-pi

https://en.wikipedia.org/wiki/Raspberry_Pi_Holdings
Quote
Raspberry Pi Holdings plc is a British technology business focused on designing and manufacturing single-board computers (SBCs) and modules,
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on May 28, 2025, 04:43:08 AM
Rasberry is a product of "Rasberry Pi Foundation":

https://www.raspberrypi.org/about/


what makes you think that ?

https://www.arm.com/partners/catalog/raspberry-pi

https://en.wikipedia.org/wiki/Raspberry_Pi_Holdings
Quote
Raspberry Pi Holdings plc is a British technology business focused on designing and manufacturing single-board computers (SBCs) and modules,

You might be right. Then I need alterantives, maybe Olimex?
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on May 30, 2025, 03:42:28 AM
i will send "official" inquiry to Rasberry for supporting U-boot/barebox boot for tinycore.

Rasperry is technically healthy, and HAT-module system is what is needed. But I think bare HW and barebox boot is mandatory for lifetime tc support.

Of course few difficult security principles must first be handled somehow...
Title: Re: piCore for DUMMIES
Post by: patrikg on May 30, 2025, 11:38:35 AM
It was not to difficult to compile uboot for raspberry pi.
And a was chainbooting uboot from the original boot rom.

What do you want to archive with uboot ??

I was using it because of lack of netbooting in the main boot rom.
Now a days Raspberry pi is supporting netbooting, with the newer ones.

I have seen that Home Assistant uses uboot for raspberry pi.
Don't know why ?
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on May 31, 2025, 05:09:51 AM
It was not to difficult to compile uboot for raspberry pi.
And a was chainbooting uboot from the original boot rom.

What do you want to archive with uboot ??

I was using it because of lack of netbooting in the main boot rom.
Now a days Raspberry pi is supporting netbooting, with the newer ones.

I have seen that Home Assistant uses uboot for raspberry pi.
Don't know why ?
 

I think that just loading new image use current device drivers and memory setup. Loader (U-boot/barebox etc .) starts uP (= Arm on this case) on real time mode, sets up device drivers, sets up MMU and memories, switch to protected mode, load kernel on virtual memory space and (hopefully) jump to correct virtual memory address for kernel startup.

On PC systems, udev handles dynamic driver loading:

https://en.wikipedia.org/wiki/Udev

...so, mechanism to do so is already there. Embedded systems things are more difficult, and static device drivers are preferred on many cases.

Writing drivers is very difficult on add-on-HW, and because HW-cards with uP, memory and I/O is chaper than making new device depended software, TCP/IP and USB are nowadays used instead HW-bus. USB and TCP/IP drivers and memory allocation are already there, so it is how things are done.

Is it good or bad depends security issues....
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on June 02, 2025, 06:07:09 AM
Rasberry answered, they won't release boot code (british are polite, so they didn't actually say so, but anyway...), but do support DTO-mechanism for other distroes.

I suppose linux kernel support DTO, but that's probably kernel option by parameters.

Does tc have DTO-support activated?
Title: Re: piCore for DUMMIES
Post by: Yleisajattelija on June 02, 2025, 06:41:00 AM
Is there switch for DTO?

https://docs.kernel.org/devicetree/overlay-notes.html

Not easy for Olimex either:

https://forums.balena.io/t/how-to-load-device-tree-overlay-on-allwinner-board/366669

....but there is U-boot loading....

https://github.com/OLIMEX/OLINUXINO/blob/master/DOCUMENTS/OLIMAGE/Olimage-guide.pdf