Jump to content

Orange Pi Zero 2W


WarHawk_AVG

Recommended Posts

Hi everyone!


Trying to bring up just another MCP2515 chip with Zero 2W.

This time with Waveshare CAN RS485 HAT.

 

MCP2515 is on SPI1, CS is CS0, INT pin is GPIO25, which is PI6 on Zero2W.

1751170779_.png.867291692653f253fd16c33e6434792b.png

 

Overlay file is compiled and enabled OK, yet chip init fails (see below).

 

pi@orangepizero2w:~$ dmesg | grep spi1
[    7.612242] mcp251x spi1.0: MCP251x didn't enter in conf mode after reset
[    7.612393] mcp251x spi1.0: Probe failed, err=110
[    7.612408] mcp251x: probe of spi1.0 failed with error -110
pi@orangepizero2w:~$ dmesg | grep mcp
[    7.612242] mcp251x spi1.0: MCP251x didn't enter in conf mode after reset
[    7.612393] mcp251x spi1.0: Probe failed, err=110
[    7.612408] mcp251x: probe of spi1.0 failed with error -110

 

 

DTS is the following:

 

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun50i-h6";

	fragment@0 {
		target-path = "/aliases";
		__overlay__ {
			spi1 = "/soc/spi@5011000";
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			can0_osc_fixed: can0_osc_fixed {
				compatible = "fixed-clock";
				#clock-cells = <0>;
				clock-frequency  = <12000000>; /* checked with HAT: 12 MHz crystal */
			};
		};
	};

	fragment@2 {
		target = <&pio>;
		__overlay__ {
			can0_pin_irq: can0_pin_irq {
				pins = "PI6"; /* GPIO 25 is PI6 on Zero 2W */
				function = "irq";
				bias-pull-up;
			};
		};
	};

	fragment@3 {
		target = <&spi1>;
		__overlay__ {
			status = "okay";
			#address-cells = <1>;
			#size-cells = <0>;
			can0:mcp2515@0 {
				reg = <0>;
				compatible = "microchip,mcp2515";
				pinctrl-names = "default";
				pinctrl-0 = <&can0_pin_irq>;
				spi-max-frequency = <10000000>;
				interrupt-parent = <&pio>;
				interrupts = <8 6 8>; /* Port I = 8 (???), Pin = 6, Type = PI6 IRQ_TYPE_LEVEL_LOW */
				clocks = <&can0_osc_fixed>;
				status = "okay";
			};
		};
	};
};

 

 

Also, SPI1 CS0 seem to always be LOW level, though CS is always active low.

Enabling SPI1 separately via "armbianEnv.txt" in form of
 

overlays=spi-spidev
param_spidev_spi_bus=1
param_spidev_spi_cs=0
param_spidev_max_freq=1000000

 

as in SPI1, CS0, didn't help much.

 

Did anyone managed to use MCP2515 with Zero 2W?

Thanks in advance
 

 

 

 

 

 

Edited by Dmitry P
Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

Hi regarding the WIFI/WLAN - I am issues the following dmesg for the OrangePiZero2W entries after installing bleeding edge Kernel 6.7.12:
 

sprdwl:wlan_delba_event: NOT FOUND sta_lut_index: 6, tid: 7

 

It happens also with the Zero3 Image. Any hints on how to solve this?

 

regards

ME_

Link to comment
Share on other sites

Armbian fully updated, OrangePi Zero 2W

 

Yeah, my Wifi chip keeps losing its connection and will not reconnect.  I reboot, it joins the network fine, it's good for a while, but I come back the next day and it's gone.

 

I have disabled Power Management on the Wifi chip.

 

Not sure what else to do.

Link to comment
Share on other sites

I am getting terrible stability problems, kernel panics within half an hour normally, not all the same source.

I have tried multiple SD cards and so many power sources, so I'm confident it's not storage or power related.

I'm starting to just think I have a lemon 2w from Ali Express.

Is everyone else free of panics?

Thanks


Sent from my iPad using Tapatalk

Link to comment
Share on other sites

Are you using the correct power supply and using heatsinks and or fan?
 

Heat sink yes, and happens whether hot or cold.

Power supplies lots of different ones all good with everything else.

Pretty sure not heat power or SD card.
Link to comment
Share on other sites


Heat sink yes, and happens whether hot or cold.

Power supplies lots of different ones all good with everything else.

Pretty sure not heat power or SD card.

You got me thinking though. I've been using good quality PSUs all rated at 2A/5V - but, perhaps....

I've plugged this into an up to 60W port that claims 3A at 5V and, fingers crossed, it hasn't had a panic in the last 24 hours. So perhaps the listed 2A at 5V is a little optimistic.

Thanks


Sent from my iPad using Tapatalk
Link to comment
Share on other sites

Those ratings don't necessary have to mean anything.

A proper 2A supply can be better than a crappy 4A one.

A good PSU keeps the voltage constant up to its rating and then shuts off due to over-current protection.

The voltage of a poor PSU will start to break down under load, often long before its max current rating is reached. The result is having weird issues with your board.

At customer grade sector its a matter of luck to get something proper. The only way to be certain, if you cannot do measurements by yourself to verify, is picking up something industrial grade.

Also most SBCs like being fed with slight overvoltage. About ~5.2 volts at the source. Last but not least to compensate for losses across wiring and connectors.

Some PSUs already do that. Even when labeled 5 volts measurements usually show something between 5.1 and 5.4 volts. Depending on quality like described above this breaks down under load or is kept constant.

Link to comment
Share on other sites

Those ratings don't necessary have to mean anything.
A proper 2A supply can be better than a crappy 4A one.
A good PSU keeps the voltage constant up to its rating and then shuts off due to over-current protection.
The voltage of a poor PSU will start to break down under load, often long before its max current rating is reached. The result is having weird issues with your board.
At customer grade sector its a matter of luck to get something proper. The only way to be certain, if you cannot do measurements by yourself to verify, is picking up something industrial grade.
Also most SBCs like being fed with slight overvoltage. About ~5.2 volts at the source. Last but not least to compensate for losses across wiring and connectors.
Some PSUs already do that. Even when labeled 5 volts measurements usually show something between 5.1 and 5.4 volts. Depending on quality like described above this breaks down under load or is kept constant.

Of course I spoke too soon.

With either an Apple 20W iPad (3A 5V) or a Belkin Boost Charge Pro this happens. I take the point on not being sure with consumer grade, but honestly, nothing else has this issue. And it could just be a dud, the fact no one else has piped up with similar stories is leading me in that direction.

Only other thing I can think is when I soldered on the GPIO header I shorted a trace, but I don't have a soldering iron with me at the moment so reflowing will have to wait.

thanks
Link to comment
Share on other sites

Hi Guys. 

I'm a newbie about this little board and Armbian, so please be patient with me 🙂

 

Zero 2W has 2 USB-C port.

I read from original manual (about OrangePi image https://drive.google.com/drive/folders/1KIZMMDBlqf1rKmOEhGH7_7A-COAgYoGZ ) page 116

USB0 and USB1, both of these interfaces can be used to power
the development board, and they can also be used as USB2.0 HOST interfaces. The
difference between USB0 and USB1 is that in addition to being set to HOST mode,
USB0 can also be set to Device mode, while USB1 only has HOST mode

 

Screenshot-2024-09-23-190150.png

 

and at page 275 there are detailed instructions about enable USB0 as HOST: this require the DTB overlay  sun50i-h616-usb0-host.dtbo that is missing in Armbian (I cannot find it into /boot/dtb/allwinner/overlay )

I need to enable USB0 (or USB1) as host mode: using USB port I will try to connect an ESP32 board and, using Zero 2W, control it with ESPTOOL.PY.

At time of writing, I cannot find any /dev/ttyUSB* device in my fresh Armbian installation.

 

Have you any idea how to enable USB and to set as HOST ?

 

Thank you.

 

 

Link to comment
Share on other sites

Hi @robertoj

For a real comparison I've installed just now a Debian 12 Bookworm in my PC (I've created a guest virtual machine using Virtualbox) so I can compare what happens into PC world and into OrangePi Zero 2W world.

 

Into my Debian 12 bookworm :

1) modprobe cp210x  (USB-serial driver needed to connect ESP device), lsmod show that module is correctly loaded (cp210x and usbserial)

2)  I connect with an USB cable the ESP device to my PC

3) board take power supply from USB and automatically power on

4) magically a /dev/ttyUSB0 device is showed up

5) esptool.py works fine

 

Into OrangePi Debian 12 bookworm "minimal":

1) the same

2) the same

3) the same

4) NOPE: no /dev/ttyUSB0  and no messages into dmesg as device was not connected at all

 

I suppose, as written in my previous post, that Orange Pi Zero 2W has USBC ports not configured as HOST.

So my problem is: How can I configure/enable one  USBC port as USB HOST ?? Probably it's required to add some DTB overlay, but I don't know how... 🙂

 

 

 

Link to comment
Share on other sites

I missed the part where you ask for overlay help :D

 

change directory to /boot/dtb/sun..../overlays/

There are several readme files, find the ones that apply to your H618 chip. Find an overlay that refers to USB host.

 

Do you use a cable to convert USB-C to USB-A-female?

 

If it works, then the next step after reboot is the lsusb test. 

 

Also, look at any error messages printed by both linux ko's

 

dmesg|grep cp210x

dmesg|grep usbserial

 

execute "sudo armbianmonitor -u" and show your /boot/armbianEnv.txt

Link to comment
Share on other sites

Hi @robertoj

Well, as I said before in my first post, reading the official OrangePi documentation about Zero 2W (page 275), it seems that in OrangePiOS there is a /boot/dtb/allwinner/overlay/sun50i-h616-usb0-host.dtbo that should be used exactly for this purpose: enable USB HOST mode in Zero 2W

 

But this file IS MISSING in Armbian and this sounds strange for me.

Do I need to install OrangePiOS and 'extract' sun50i-h616-usb0-host.dtbo and copy into my Armbian installation ? This can be a solution ?

 

Edited by ambrosa
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines