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.