Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: kim on March 22, 2018, 06:42:52 AM

Title: Pi 3B+
Post by: kim on March 22, 2018, 06:42:52 AM
Hi,

I'm using PiCore-9.0.3 and have been trying to get it work with Pi 3B+ without success.

I tried updating latest boot files from https://github.com/raspberrypi/firmware/tree/master/boot (https://github.com/raspberrypi/firmware/tree/master/boot) and I got over the rainbow screen, but it seems that neither USB or wired network is functioning.

Is anyone working on a proper update for Pi 3B+ ?

Thanks,
Kim
Title: Re: Pi 3B+
Post by: Paul_123 on March 22, 2018, 07:58:43 AM
Will not work with piCore until a new version is released.

New Bootloader, firmware and ethernet drivers are needed.
Title: Re: Pi 3B+
Post by: gavinmc42 on April 12, 2018, 04:09:21 AM
What about just grabbing those boot files from the Raspberry Boot git?
https://github.com/raspberrypi/firmware/tree/master/boot
I did that for a quick baremetal fix.

Now that 64bit Gentoo is running on the 3B+, how about a 64bit PiCore?



Title: Re: Pi 3B+
Post by: bmarkus on April 12, 2018, 10:16:04 AM
Now that 64bit Gentoo is running on the 3B+, how about a 64bit PiCore?

Why to have a 64-bit version?
Title: Re: Pi 3B+
Post by: gavinmc42 on April 13, 2018, 04:01:13 AM
Why 64 bit?

Aarch64 has more registers and better NEON access.
For Computer Vision and Machine learning etc, NEON can be used to accelerate these things.
https://github.com/ARM-software/ComputeLibrary.
Sometimes assembly must be used to get even more speed and tune code for speed.
64Bit to 128bit SIMD is faster than 32 to 128.

For robotics more speed/lower power of the Aarch64 helps save batteries.

Sure it can be done now on Pi's but it could be done a bit faster on the same hardware in 64bit mode.
https://community.arm.com/graphics/b/blog/posts/cartoonifying-images-on-raspberry-pi-with-the-compute-library

Some benchmarks I have seen shows 2.8 times improvement moving from 32 to 64bit.
That's like having a 4GHz Pi :P

OpenSuse, Gentoo, Fedora Aarch64 are all a bit big, er massive bloatware.
They make Server/Desktop general purpose OS's, not light OS's for single purpose use.
Most of these need serious work to make lite versions.
PiCore is the opposite, start light and only add needed stuff 8)
That to me sounds like what is needed for Robotics and Specific Purpose AI.

Don't even need X11 for most of those uses, but Mesa is now at a usable stage.
https://wiki.gentoo.org/wiki/Raspberry_Pi_VC4
Eric Anholt has been pushing lots back upstream, the VC4/5 are getting support in the latest kernels too.
But all that is secondary, a PiCore kernel with busybox can do an awful lot for headless applications.

Mind you PiCore with TC is still a faster Desktop than others I have used, how much faster is it on the Pi3B+? :D
Title: Re: Pi 3B+
Post by: bmarkus on April 13, 2018, 09:22:03 AM

Some benchmarks I have seen shows 2.8 times improvement moving from 32 to 64bit.
That's like having a 4GHz Pi :P


It is a very misleading statement. I can imagine some very specific cases, e.g. codec, signal processing, etc. but for generic applications you will gain minimal.


Title: Re: Pi 3B+
Post by: gavinmc42 on April 13, 2018, 06:36:30 PM
"Some benchmarks I have seen shows 2.8 times improvement :o"

Yep, very misleading, I picked best case ;D
But for Neural networking and many other ML/CV 8 bit can be used in the NEON.
16x8 bit SIMD = 128bits, the trick is to keep as much as possible in the Aarch 64bit registers.
Putting stuff into NEON is twice as many cycles in 32bit Arm.

Understand, generic applications is not the reason to go to 64bit.
It may end up going to hand tuned assembly routines for CV/ML/NN to get best performance for a single purpose application.
Think single purpose Intelligent AI for IoT, not general purpose AI.

If I have to use assembly, I would rather learn to do it in 64bit mode.
The simpler 64 bit  instruction set should be easier to learn and there are twice as many registers.
If everything can be kept in the cache memory external memory access speed is less relevant.

Not sure what 64bit floating point is needed for?
Plus I have to figure in my age, by the time I actually learn to use it, 90-99% of Pi's made will be 64 bit :P
Not sure is I have time left to learn the more complex 32bit, it is just a hobby sort of ;)
Hopefully a 64bit Zero becomes available too, A35's use less power, have smaller die and should be cheaper.
Title: Re: Pi 3B+
Post by: sdcoil on April 20, 2018, 12:52:56 PM
FYI, piCore player as 3 B+ support ....
Title: Re: Pi 3B+
Post by: PDP-8 on April 22, 2018, 03:50:40 AM
For me the 3B+ was more a matter of convenience of having the dual-band ac built in wireless, and possible use of POE with a proper hat for it in the future.

But, still limited to 1gb ram, so no enhancement from 64 bit there.

I'd be more interested to see if the latest stable 1.28.3 version of Busybox will run on it with a 32 bit kernel. But to each his own I guess...

Title: Re: Pi 3B+
Post by: bmarkus on April 23, 2018, 09:24:51 PM
I'd be more interested to see if the latest stable 1.28.3 version of Busybox will run on it with a 32 bit kernel. But to each his own I guess...

piCore 10.0 beta already running here both on RPi3 B+ and the old RPI1. It is built in BusyBox 1.28.3, kernel 4.14.33, ...

Planning to release beta in a week time.
Title: Re: Pi 3B+
Post by: gavinmc42 on April 24, 2018, 03:42:07 AM
Hi Bela, will there be a 64bit ARMv8 kernel version as well?
Title: Re: Pi 3B+
Post by: bmarkus on April 24, 2018, 05:33:20 AM
Hi Bela, will there be a 64bit ARMv8 kernel version as well?

No
Title: Re: Pi 3B+
Post by: gavinmc42 on April 24, 2018, 09:51:31 PM
Is that a "no ARMv8 kernel, not this week" or "no, not ever"?

Got me kind of curious now, how do you make PiCore?
Title: Re: Pi 3B+
Post by: bmarkus on April 26, 2018, 03:34:39 AM
Is that a "no ARMv8 kernel, not this week" or "no, not ever"?


64-bit version of piCore is a low priority task, first new 32-bit must be released.

BTW, which 64-bit distro are you using on RPi?
Title: Re: Pi 3B+
Post by: gavinmc42 on April 28, 2018, 03:41:31 AM
Quote
64-bit version of piCore is a low priority task, first new 32-bit must be released.
BTW, which 64-bit distro are you using on RPi?
https://github.com/sakaki-/gentoo-on-rpi3-64bit
Sakaki is doing a great job with support and documentation too.
Showed me how to compile ARM's Compute Library.
Which is probably the first time that was done on a Aarch64 Pi?

Sakaki also figured out how to run 32bit stuff in Aarch64, which maybe another first?
https://www.raspberrypi.org/forums/viewtopic.php?f=54&t=211260
This could be useful for PiCore64, all those 32bit tcz's?

My problem is getting reliable SD/USB/SSD memory, my old stuff is getting worn out.
Still in testing phase, most Linux OS's wear out SD's with constant writes.
Some big compiles need like 4GB Swap files.

Goal is a Aarch64 development box for ARMv8A/NEON coding on Pi3B+.
At the moment I am thinking boot from SD, home and swap on USB drives.
Which is pretty much what I do with PiCore, just different partitions on same SD;)

Title: Re: Pi 3B+
Post by: gavinmc42 on April 28, 2018, 04:42:25 AM
I think I totally hijacked this post?
Anyway was reading Sakaki's 32bit on 64bit wiki
https://github.com/sakaki-/gentoo-on-rpi3-64bit/wiki/Running-32-bit-Raspbian-Packages-on-your-64-bit-Gentoo-System
She is using Raspbian Lite, which I find bloated anyway ;)

Not sure but is it possible to run 32bit Picore on Gentoo64?
Don't remember using chroot before or having a 64bit Pi OS to try this on ;D.
Title: Re: Pi 3B+
Post by: gavinmc42 on May 13, 2018, 05:30:51 AM
Bela,
I had trouble with the 10Beta3a, you need to put a test link in the child board section at the top for version 10.
I had to dig deep for them ;)
Beta3a get to these lines
.....
Starting udev daemon for hotplug support...  Done.
modprobe: can't change directory to '4.14.33-piCore': no such file or directory
modprobe: can't change directory to '4.14.33-piCore': no such file or directory

But 10Beta2 works on cards, 128MB to 32GB, SD and uSD.
I am using it to test my old cards, have collected 40+ cards now,
Not including the installed running ones.
Got 10+ dud cards, not surprising as some go back 6 years :(

Etcher writes the piCore zip files quickly, other OS's take forever to write and test.
Only tested on an old PiB, A+, 3B and new 3B+ .
Still need to test on old A, B+, Zero's and old Pi2.

Might need more testing on the 3B+, I saw one lockup out of 3 boots.
What Sdram speed are you running?
There also seems to be some recent lan chip changes.

I will do more testing, now that I have 20 cards working ;)
 

Title: Re: Pi 3B+
Post by: bmarkus on May 13, 2018, 09:54:56 PM
Hi Gavin,

thanks for testing. I see these random boot issues also, need some more investigation.

Regarding modprobe, on which board you get it, arm6 or arm7?


Regards,

Béla
Title: Re: Pi 3B+
Post by: gavinmc42 on May 14, 2018, 02:50:25 AM
Hi Bela,

Did a lot more testing today, using a different version of Etcher on a Windows box.
Just to check if Etcher was the problem or I had corrupted images.

It looks like 10Beta3a works on newer Pi's like the 3B/3B+, these use uSD cards.
Same uSD in an adapter for A or B halts at the modprobe lines.
10Beta3a on SD cards also halts there, this seems to be a hotplug daemon?

uSD on old Pi2 goes into kernel panic, only tested this with two uSD's.

10Beta2a works on all Pi's/uSD's/SD's.

Another bug, SSHing into Pi's, MC has mouse issues, look like same issue on Beta2a and Beta3a.
Superputty to remote Pi and running MC, left click mouse button generates codes not actions.
MC graphics have black/blank areas too.

So yes modprobe has issues with BCM2835 and perhaps BCM2836.
Is the SD MMC running at different clocks/timeouts?


Title: Re: Pi 3B+
Post by: gavinmc42 on May 14, 2018, 05:23:58 AM
Some more tests and consistency in results
5 x Zero's, 3 x A+, 2 x B+  10Beta3a - same lock at modprobe, Beta2a works fine.

Old 3B and new 3B+ Beta2a - kernel panic, Beta3a works fine.

Works fine in both cases means they go past the SHA256 key pair stuff to cmdline when a key is hit

Conclusion
Use Beta2a on BCM2835
Use Beta3a on BCM2837 and perhaps 2836?

Yet to test Zero W, but I suspect same result for other BCM2835's?

Checked and confirmed old A's, B's worked with SD and uSD card Beta2a.
Not SD or uSD card dependent.
Did not realize I have so many Pi's or cards till they were all in one spot. ;)

Title: Re: Pi 3B+
Post by: Paul_123 on May 15, 2018, 09:42:53 AM
uSD on old Pi2 goes into kernel panic, only tested this with two uSD's.

Take a closer look at the kernel panics.   Add   pause_on_oops=x  to the kernel command line (x is number of seconds to pause).    It is likely a known issue with 4.14.y kernels and initramfs's.   It is a race condition in the startup of the USB FIQ handler, rpi has not been able to resolve yet.  Reference: https://github.com/raspberrypi/linux/issues/2450

- Only appears to be affected by initramfs systems.
- Running headless appears to not lockup.
- Disabling the FIQ handler works too, but brings back the horrible USB issues.

I did a tremendous amount of testing while working on pCP, every new kernel changes the timing, which means some kernel versions are more susceptible to the problem.
Title: Re: Pi 3B+
Post by: bmarkus on May 15, 2018, 10:24:50 PM
Still the same issue with 4.16.y

https://www.raspberrypi.org/forums/viewtopic.php?t=206400
Title: Re: Pi 3B+
Post by: Paul_123 on May 16, 2018, 07:20:40 AM
We are at 4.14.26 on pCP, 4.14.22 was horrible, but .24 and .26 seem to boot >98% of the time.   I've not built a higher kernel yet.   One other thing I noticed is that a linaro_gcc 7.3 tool chain made a slightly less stable kernel.  So I'm using the default Raspberry pi tool chains for an intel based build system.
Title: Re: Pi 3B+
Post by: TimJ on May 17, 2018, 01:19:23 AM
I need to purchase some more WiFi enabled Pis, but the RPI3B is no longer available, only the RPi3B+, hence my interest in Picore 10.

I have downloaded Beta3a and tried it on a RPi3 and found that the kernel panics about 1 in 7 boots, (or reboot). I will be using these devices headless so I have tried in that mode and so far appears stable. ( about 20 power up boots and 20 reboots).

Or would it be a workaround to replace the kernel from PiCore 9  (4.9.22) on PiCore 10? or does the RPi3B+ require a newer kernel? I might try and do it.

There is a minor issue in that using showapps breaks the mounting of extensions.

Feedback (most recent call last)
File "/usr/bin/bootload", line 106 in <module>
File "/usr/bin/bootload", line 97 in <module>
TypeError: extra keyword arguments given

And no extensions get mounted.

Thanks for all your efforts and great work. It is appreciated.

Tim.

Title: Re: Pi 3B+
Post by: Paul_123 on May 18, 2018, 09:24:28 AM
The pi3B+ needs the newer kernel/firmware.  There are wifi and ethernet patches for the pi3B+ that are not in the 4.9.y tree as well.  RPI has officially abandoned the 4.9.y tree.

 In all of my testing (I've been using 4.14 kernels since December of last year),   I've not seen boot crashes when running headless.
Title: Re: Pi 3B+
Post by: TimJ on May 22, 2018, 03:39:36 AM
Bela, you are a star.

I see that beta4a using 4.14.41 is on the website and I have run it all day yesterday, rebooting countless times with an HDMI monitor attached. No problems at all.

I have added modules for 1wire temp sensor and RTC and edited the device tree to add an EEPROM and all is still fine.

Many Thanks

Tim.
Title: Re: Pi 3B+
Post by: bmarkus on May 22, 2018, 07:07:43 AM
Thanks for the feedback. I tested it intensively in the last days. Yes, boot is stable now adding

Code: [Select]
dwc_otg.fiq_enable=0 and dwc_otg.fiq_fsm_enable=0
to command line. Another issue I found is ZSWAP. When it is enabled, there are random 'Error writing swap' messages and few times system is freezing. Adding NOZSWAP to cmdline it works fine, and compiling large applications like GCC has no any memory or media read/write issues. I will upload a new beta with NOZSWAP as default.

All together I'm not happy with 4.14 at all. Except RPi3+ 4.9.y works better.



Title: Re: Pi 3B+
Post by: Paul_123 on May 22, 2018, 02:07:44 PM
If you are using any USB devices, disabling FIQ is going to create more problems.  (Remember the early rpi days)  If I turn off FIQ, my use keyboards are useless, and network throughput plummet.   

What compression algorithm are you using for zswap.  I've not seen swap errors before, I'm using LZ4
Title: Re: Pi 3B+
Post by: bmarkus on May 22, 2018, 02:29:51 PM
If you are using any USB devices, disabling FIQ is going to create more problems.  (Remember the early rpi days)  If I turn off FIQ, my use keyboards are useless, and network throughput plummet.   

It is up to users whether to enable or disable it in command line. I know all the drawback disabling it, however at least it provides reliable booting.
Title: Re: Pi 3B+
Post by: bmarkus on May 24, 2018, 01:18:44 AM
What compression algorithm are you using for zswap.  I've not seen swap errors before, I'm using LZ4

lzo, can be reproduced with zbud and z3fold allocators.
Title: Re: Pi 3B+
Post by: gavinmc42 on May 26, 2018, 06:32:36 PM
Latest 10Beta4a, kernel 4.14.41 seems to work on all the Pi's I have tried so far, B+, 2B, 3B, 3B+.

Wanted to stress test it further by sticking a Desktop on it but no TC in tcz list yet.

Midnight Commander still has the mouse left/middle button clicks generating escape codes issues.
Title: Re: Pi 3B+
Post by: bmarkus on May 27, 2018, 02:06:44 AM
Latest 10Beta4a, kernel 4.14.41 seems to work on all the Pi's I have tried so far, B+, 2B, 3B, 3B+.

Wanted to stress test it further by sticking a Desktop on it but no TC in tcz list yet.

Midnight Commander still has the mouse left/middle button clicks generating escape codes issues.

Hi Gavin

thanks for the feedback.


Béla
Title: Re: Pi 3B+
Post by: Paul_123 on May 28, 2018, 01:41:37 PM
Sorry Bela, I missed you saying zswap.  We only use zram.  I've not used zswap with piCore in a long time.
Title: Re: Pi 3B+
Post by: bmarkus on May 28, 2018, 09:46:11 PM
Hi Paul,

no problem. I just put beta5a to the server with 4.14.42 kernel. Changed to lz4/zfold3 and made test compiling large applications. Do not get swap write error when using swap file, only randomly with a swap partition but much elss now than before. It looks like a local issue, so this setup and kernel is the final one.

Béla
Title: Re: Pi 3B+
Post by: kim on June 16, 2018, 08:19:26 AM
Any estimate on when this new version that works on Pi 3B+ will be officially released and available?

Is the latest beta version publicly available from somewhere?

Thanks,
Kim
Title: Re: Pi 3B+
Post by: TimJ on June 16, 2018, 11:59:36 PM
After some searching I hound it here http://tinycorelinux.net/10.x/  (sorry I can't see how to make that a link).

I have been using it extensively for the last few weeks on a RPi3 and 3+. By default it has USB FIQ turned off that apparently can give USB problems, - Can anyone comment on what the problems are?. I never seen any, but I have not stress it, only using a keyboard, memory stick and wired network for ssh.

If FIQ is turned on it makes USB reliable but crashes on boot if an HDMI monitor is attached. As I run headless I have now turned it on.

There are not many extensions available, any copied from PiCore9 that use encryption will not run due to an updated library, so expect to spend some time building extensions. I now have the WiFi and everything I need running.

I can't comment on timescales but I expect that Bela is waiting for a fix to the underlying Raspbian problem.

Tim.

Title: Re: Pi 3B+
Post by: bmarkus on June 18, 2018, 06:38:04 AM

I can't comment on timescales but I expect that Bela is waiting for a fix to the underlying Raspbian problem.

Tim.

@Tim Main reason is lack of time at the moment due to job load.
Title: Re: Pi 3B+
Post by: kim on June 27, 2018, 01:18:15 PM
Hi Tim,

There are not many extensions available, any copied from PiCore9 that use encryption will not run due to an updated library, so expect to spend some time building extensions. I now have the WiFi and everything I need running.

I've tried to get WiFi to work on Pi 3B+ with Beta5a but I can't get wlan0 interface to show up (apart from eth0 and lo).  I've loaded firmware-rpi3-wireless.tcz and wifi.tcz (+ dependencies) from 9.x branch but perhaps they are incompatible as you mentioned earlier.

Any tips on which particular extensions need recompiling or would you be willing to share the extension that work?

Thanks,
Kim
Title: Re: Pi 3B+
Post by: TimJ on June 27, 2018, 04:22:27 PM
I will uploaded to google drive all the tcz you need.
Forum rules apparently forbid publicly sharing tcz so I will send you a PM with the link.

It contains theses tczI have listed the source as far as I remember - I don't guarantee it as correct
I am not an expert at producing tcz so they are probably not as small as could be but for me they work.
Code: [Select]
firmware-rpi3b-plus-wireless.tcz                  files copied from raspbian
libiw.tcz                                                        copied from 9.0.3
libnl.tcz                                                        copied from 9.0.3
wifi.tcz                                                         copied from 9.0.3
wireless-4.14.42-piCore-v7.tcz                   modules built from source on ubuntu laptop
wireless_tools.tcz                                        copied from 9.0.3
wpa_supplicant.tcz                                      built from source PM if you want my build directory

To install
Untar
copy all files to tce/optional
add to onboot.lst
    wireless-4.14.42-piCore-v7.tcz   
   wifi.tcz
install readline.tcz in the usual way
reboot
keep fingers crossed
run wifi.sh

post back if it works

Tim
Title: Re: Pi 3B+
Post by: kim on June 28, 2018, 04:47:11 AM
Hi Tim,

I will uploaded to google drive all the tcz you need.

Thanks a lot, it works now perfectly!

Regards,
Kim
Title: Re: Pi 3B+
Post by: Paul_123 on June 28, 2018, 06:31:21 PM
Bela,

Do you still have the new rpi firmware packages I submitted a while back?

Paul
Title: Re: Pi 3B+
Post by: bmarkus on June 29, 2018, 01:56:10 AM
Bela,

Do you still have the new rpi firmware packages I submitted a while back?

Paul

Hi Paul,

I must have, nothing is deleted :)

Béla
Title: Re: Pi 3B+
Post by: kim on July 08, 2018, 12:35:40 PM
Has anyone built tcz packages for ntfs-3g and its dependencies (NTFS filesystem support) compatible with 10beta5a?

I presume ntfs-3g and fuse might work straight from 9.x branch but filesystems-KERNEL and raid-dm-KERNEL needs rebuilding with matching kernel version.

So I'm looking for atleast these two:

raid-dm-4.14.42-piCore-v7.tcz
filesystems-4.14.42-piCore-v7.tcz

Kim
Title: Re: Pi 3B+
Post by: Linkan on July 10, 2018, 02:17:38 AM
Thanks for the beta it works well on my Pi 3B+ with the latest version.

I couldn't find the compiletc extension available for 10.x which I need for the make command. I have installed gcc already.
Title: Re: Pi 3B+
Post by: Paul_123 on July 20, 2018, 05:30:27 AM
thanks for testing. I see these random boot issues also, need some more investigation.

This commit appears to fix the boot problem when the FIQ is enabled.

https://github.com/raspberrypi/linux/commit/e0d2b2b6df54f175dc73eb294976e756fa68d57d

We have tested it in our builds, and have over 5000 reboots with no kernel panics.
Title: Re: Pi 3B+
Post by: TimJ on July 21, 2018, 06:36:59 AM
Thanks for posting.

I have applied the patch to 4.14.42 and it does seem to have fixed the problem on 10.0beta5a.

Tim
Title: Re: Pi 3B+
Post by: Col on July 31, 2018, 10:18:00 PM
I need to use the usb-serial package for the version 10 beta release. I have created small packages before so if someone could point me to where to download the source files file from it would be greatly appreciated.
Title: Re: Pi 3B+
Post by: TimJ on August 02, 2018, 09:18:04 AM
I don't think that there is an official set of kernel modules available for piCore10 Beta5  ie kernel 4.14.42 The full kernel source is available here
http://tinycorelinux.net/10.x/armv7/releases/RPi/src/kernel/
so you can build your own.
My built modules for 4.14.42 arm7 are here.
https://drive.google.com/open?id=1MYbc2hAc_4og0eW9qjtcMJ144mn04lzH
if they help. I have patched the kernel to avoid the HDMI crash but it did not effect any modules.
Look at usb-serial from 9.0.3 to which modules should be included in your new tcz.