Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A Zero W followed me home...
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Sat Aug 31, 2019 10:17 pm    Post subject: A Zero W followed me home... Reply with quote

...and I am going to force feed Gentoo onto it...

Well I guess it's about time for me to play with one of these things. Been years since I worked with ARM and never worked with any RPi before.

Now my current caveat: I have nothing that will plug into the HDMI connector. I do have a OTG adapter and even a USB-to-RS232. However it might be easier to use the onboard async uart? Need to convert to RS232 levels... maybe I can find a max232 somewhere...

What's my best strategy? :D What's the persistent device name of the wifi? Will I need to make it dump a dmesg and command logs, etc. to a file and iterate that way until I can ssh to it through wifi? :D

(Starting the crossdev --target arm very soon now so I can ROOT= build an ARM wpa_supplicant, I hope, else I will need to setup an emulator...)

(init=/linuxrc
linuxrc: emerge wpa_supplicant
? :D)
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Sun Sep 01, 2019 6:55 am    Post subject: Reply with quote

A miniHDMI to HDMI adater maybe?

miniHDMI-HDMI

You probably don't need the rs232 if the kernel boots, it is nice to have one like mine however.
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54640
Location: 56N 3W

PostPosted: Sun Sep 01, 2019 9:25 am    Post subject: Reply with quote

eccerr0r,

Solder the 40 pin header.
Invest in a USB to RS232 doda with loose connectors on the end.
Enjoy a real serial console.

If your USB to RS232 doda comes with four wires, do not connect the red one. That's 5v.
It will either try to power the Pi or do very bad things to it.

The OTG port is USB2.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Sun Sep 01, 2019 1:11 pm    Post subject: Reply with quote

So people are saying it's very unlikely for newbies to get this thing working "blind" yet :D

I still have plenty of legacy RS232 ports around which should make things easier, hopefully don't need to go all the way down the USB stack. Are these i/o's 5V tolerant so I can use my plentiful MC1488/1489's or have to find a max3232 that can deal with 3v3 signals?

I'm still shocked with the 5MB raspberrypi.org kernel size ... not even my x86 kernels are this big yet (~2.3MB)... unless it's not compressed or uses some other compression algorithm?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54640
Location: 56N 3W

PostPosted: Sun Sep 01, 2019 4:57 pm    Post subject: Reply with quote

eccerr0r,

The Pi serial port is not 5v tolerant.
Its embedded in the SoC, so its probably 1.8v but 3.3v tolerant.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Sun Sep 01, 2019 6:57 pm    Post subject: Reply with quote

So the SoC outputs are 1v8 level and not shifted to 3v3? Haven't seen that much on lowish speed devices...

If it is shifted to 3V3, technically Voh of TTL 5V is less than 3V so it might just still work, regular CMOS at 5V will need a level shifter...
Ingoing, could always just add a few diode drops or a zener... hmm.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54640
Location: 56N 3W

PostPosted: Sun Sep 01, 2019 7:06 pm    Post subject: Reply with quote

eccerr0r,

I haven't got my 'scope out to check.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Sun Sep 01, 2019 7:37 pm    Post subject: Reply with quote

You should first understand the 2 stages boot process, ARM SoC use a bootloader a bit more complicated opensource bootloader called uboot (there are other like petitboot but not for the raspi), so well when powered on it will load in memory and start executing this executable called uboot, since uboot is responsible for initializing peripherals (HDMI included) it will use only the rs232 for I/O. once uboot is done initialing HW and loading firmware, it will load the kernel according to what is specified in a file, and from that point on hdmi and usb keyboards will work.
You only need the rs232 to interact with uboot (which is funny and useful but not mandatory), in short if you connect a HDMI and see the kernel booting you do't need to talk with the bootloader and can leave that for later (like for optimizing memory). Some people have problems booting a linux kernel blindly you know ;-)
BTW uboot can also be accessed over ethernet without using a serial ... but probably not on the raspy since it doesn't come with an eth.
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54640
Location: 56N 3W

PostPosted: Sun Sep 01, 2019 7:58 pm    Post subject: Reply with quote

eccerr0r,

You will hate the Pi boot process but it just works if you name all the pieces correctly.

At reset, the GPU is in control. The ARM CPU is held reset.
The GPU loads /boot/bootcode.bin and executes it on the GPU
bootcode.bin parses /boot/config.txt if its there, loads the kernel and device tree and otherwise does what its told.
There are sensible default names for the kernel and device tree.

Once the kernel and whatever else /boot/config.txt tells to load, the ARM CPU is allowed to run.

It takes 10 to 20 sec to get text on the console as there is no early HDMI console by default.
You need to wait for root to mount and modules to load.
Simple Framebuffer works once you build your own kernel.

You can run uboot if you want to but that loads uboot in place of your kernel, then uboot loads your kernel.
uboot is not required on the Pi.

You can't "brick" a Pi as there is no firmware to reprogram.
Well, it must be there as the GPU needs to be able to read the SDCard to load bootcode.bin.

NB: The Pi 4 has firmware. Its bootcode.bin is in a user programmable device.
Its the only one so far though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Sun Sep 01, 2019 9:01 pm    Post subject: Reply with quote

There must have been some firmware at play if it can read FAT32 ... and sad that it couldn't be simpler than IBM's MBR ... lol.

Interesting, is there a standard for ARM SoCs for boot nowadays, using an auxiliary processor (GPU, etc.) to do boot loading for the main CPU? Or is it pretty much 1 SoC 1 implementation?

Well, it's still the plan - headless or serial console. I have no miniHDMI plugs of any kind and this isn't going to change anytime soon.

Then the other question, do people emerge on the sdhc cards eating away at erase cycles or something else? Not like there's plenty of memory on these things for a huge tmpfs though much better than my 64MB SC520 SoC...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54640
Location: 56N 3W

PostPosted: Sun Sep 01, 2019 9:11 pm    Post subject: Reply with quote

eccerr0r,

Set yourself up a cross compiler. Maybe cross distcc too.

You will die of old age waiting for a Pi zero to build very much.
It does not have a lot of CPU power and running the crypto for ssh takes of lot of what there is.

There is no standard for booting ARM systems.
uboot is fairly common but how uboot gets started varies.
The Pi is an oddball. The zero is a 2012 mobile phone SoC with an ARM CPU grafted on the side like a wart.

I build on a USB SSD.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Sun Sep 01, 2019 9:33 pm    Post subject: Reply with quote

I actually waited for my SC520 to emerge wpa-supplicant when I got some USE flag wrong :D I suspect the RPi to be faster than this, my N900, and my DECstation 3100 ... The DECstation is the machine I first learned of slow ssh key negotiation ... it couldn't b e worse than this :)
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Mon Sep 02, 2019 6:37 am    Post subject: Reply with quote

Just stick to 32 bit and it will be obsolete by design :-)

the second stage bootloader (uboot) is burned in the first 2 blocks of the sdcard; the SoC reads and executes them at boot and actually it is the second stage bootloader that understands FAT and loads all drivers and config files from the SD, not (necessarily) the firmware (intended as misterious binary blob distributed by evil Broadcom).
Maybe the firmware understands and uses FAT but only for its evil purposes, not for booting. In fact like on every other ARM SoC there is an hidden CPU core and that binary blob contains an OS that is run on that hidden core and controls most functions on the board.
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Mon Sep 02, 2019 7:51 am    Post subject: Reply with quote

freakin a.. ... even rpi/broadcom-arm has mystery blobs, regardless of software/firmware or hardware? *sigh* thought we were done from this BS that intc/amd added... *cough* smm....
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54640
Location: 56N 3W

PostPosted: Mon Sep 02, 2019 8:03 am    Post subject: Reply with quote

eccerr0r,

Oh, its there, you just can't get at it on the Pi.
I called it the GPU in a previous post. All I can say for sure is its not the ARM CPU.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Mon Sep 02, 2019 1:19 pm    Post subject: Reply with quote

I suspect it does sort of assist in the unbrickability of the devices, but not being able to know what exactly is going on is the problem...

Technology over time always rots.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Mon Sep 02, 2019 8:57 pm    Post subject: Reply with quote

eccerr0r wrote:
I suspect it does sort of assist in the unbrickability of the devices, but not being able to know what exactly is going on is the problem...

In fact, it also monitors the SoC to make sure it works correctly, for example downclocking the cpu/gpu/DMA controller if it overheats. Doing it using a service processor and an algorithm is a lot more effective, you know on ARM in general but on the raspi in particular, the CPU frequency you see in /proc/cuinfo is just nominal, you can change it using cpupower for example but the real frequency is controlled by the service processor according to the temperature. i.e.if it gets warm it will become slow even if the cpu frequency shoed in /proc/cpuinfo doesn't change.
Also interrupt assignment can't be really controlled by the OS and is handled by the service processor.
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Mon Sep 02, 2019 11:12 pm    Post subject: Reply with quote

dammit you're making more and more unpalatable, don't make more justifications for MEI!
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Tue Sep 03, 2019 8:30 am    Post subject: Reply with quote

Well that is a modern design apparently and it works reliably even with dumb user settings. Just don't count on any (not only the CPU) clock frequency to be what the OS reports, like for realtime audio processing ... or use the board to send data to an external DAC with a reliable clock for decoding ;-) see volumio forums for more...
And of course don't control your nuclear power plant with it ....

One of the biggest problems with cult objects is that most the times they fail to deliver what they promise and use blind faith (and aggressive advertisement) to sell.

What do you plan to do with it?
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net


Last edited by erm67 on Tue Sep 03, 2019 8:40 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54640
Location: 56N 3W

PostPosted: Tue Sep 03, 2019 8:38 am    Post subject: Reply with quote

eccerr0r,

Its a mobile phone core. It has to be able to look after itself.

The ARM CPU was added much later, its really just along for the ride.

Think of a mobile phone with the phone RF bits replaced by the ARM CPU.
That's a Pi.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Tue Sep 03, 2019 1:19 pm    Post subject: Reply with quote

Actually I have no specific use for this RPi for the moment other than to just get it to boot, figure out what it can ... and can't do.

Yeah this does very much seem like a cult, it doesn't seem any better or worse than any other solution out there, granted, it(the board, etc.) is small...

---

And the first try of the Gentoo install was a fail. It couldn't even read the microsd card (two blinks). To rule out hardware issues, I dumped raspbian on it...

... Looks like it finally reads something. Serial console still dead.

silly ttyS0 serial0 ttyAMA0 wtf... GRR... can't say that this is any different than the other CPU manufacturer's SoC serial ports (hint: "baytrail") that are wtfized.

Need to switch back to Gentoo and figure out why it can't read the microsd card...

---

Okay... This Raspberry Pi Zero W turned out as fast as I expected. Serial console at 115200 is fluid as any other machine I've used at 115200, and running my "stupid little cross platform benchmark" it comes out a little slower than my 500MHz Celeron, but as expected, beats out my Nokia N900 and Pentium Pro O/C at 233MHz. It smashes my Linksys WRT54G, completely blew away my Geode GX1 and AMD SC520, and of course the poor old DECstation 3100 chugs along in last place (not counting a possible bug in Tomato Shibby where the Linksys E2500 fails badly)...

---

So... Which is correct: https://wiki.gentoo.org/wiki/Raspberry_Pi/Quick_Install_Guide#Create_the_partitions

"boots off a FAT32 /boot partition" or "mkfs.vfat -F 16 /dev/mmcblk0p1"

Is there any other tags that need to be added to the boot partition?

I noticed that though this is an PC MBR partition table, no bootable flag is needed (just like EFI) though EFI requires the boot partition be marked as ESP. Likewise does the partition need to be marked "FAT32" though the contents of the partition be FAT16?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Wed Sep 04, 2019 5:34 pm    Post subject: Reply with quote

Since you managed to make your uart work you could try this:
https://github.com/christinaa/rpi-open-firmware

It is an open source replacement for the evil bootcode.bin ...
I never tried It myself but sounds interesting and could make the raspi more interesting.

But beware the gods might be offended ...
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net


Last edited by erm67 on Wed Sep 04, 2019 6:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Wed Sep 04, 2019 6:03 pm    Post subject: Reply with quote

Interesting...

Yeah I finally got the serial console working. Was a bit worried because I wasn't thinking and connected the max3232 output to the Rpi...
... except the max3232 was connected to the Rpi's power output... yes, the 5V supplied on the 40-pin header since they were all perfectly in a line - matching my cable's order perfectly. The max3232 outputs to rail instead of TTL Voh, so ouch...

No smoke, no damage fortunately, the max3232 probably could not source enough current to fry the ESD diodes. So I connected the max3232 to the 3v3 output and all is fine now. The max3232 is on a little board with LEDs on it that I should remove or make a bit dimmer to save more power...

I found out as I measured the Rpi GPIO/TxD output to be at 3v3 levels, not 1v8. At 1v8 it would not hit Voh with enough noise margin of 3v3 CMOS logic.

Still trying to get the #*@($#ing thing to boot with my own prepared /boot even if it's a straight copy of the git repository... hmm.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Wed Sep 04, 2019 7:29 pm    Post subject: Reply with quote

I never brickd a board with the serial and I probably connected it in all possible (and impossible) wrong ways, but some people apparently managed to brick it :-9
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9847
Location: almost Mile High in the USA

PostPosted: Wed Sep 04, 2019 7:49 pm    Post subject: Reply with quote

Can't be too careful or paranoid. I have fried inputs in the past - a poor old Atmel AVR chip had one of its ADC mux inputs driven past 10V or so from a circuit gone awry - a LM358 op amp that can source enough current - and fried that input. Oh well.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum