Beagle Bone Black CardMgr latest kernel

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

Beagle Bone Black CardMgr latest kernel

Postby nsollars » Fri Sep 04, 2020 10:55 pm

Hey guys,

Is any using capes on a BealeBone Black with the current BBB 5.8.0-1 kernel?.

I ask as looking in dmesg I do not see any cardmgr output and I dont see the usual looking dtb's there also. I am looking at using this one for robotics with ROS so any pointers to documentation would be appreciated. I dont mind having to patch / rebuild the kernel for this one either.

Thanks in advance

Nige
nsollars
 
Posts: 21
Joined: Mon Sep 04, 2017 6:14 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby nsollars » Sat Sep 05, 2020 3:41 am

I am not sure whom the maintainer is of this particular branch / SBC, but it looks to be that my question maybe aimed at Uboot and perhaps the Kernel as per Robert Nelsons page found here,

https://www.digikey.com/eewiki/display/ ... Bone+Black

Are these patches applied?

patch references,

wget -c https://github.com/eewiki/u-boot-patche ... ixes.patch
wget -c https://github.com/eewiki/u-boot-patche ... ager.patch

patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0002-U-Boot-BeagleBone-Cape-Manager.patch


Thanks
Nige
nsollars
 
Posts: 21
Joined: Mon Sep 04, 2017 6:14 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby summers » Sat Sep 05, 2020 8:30 am

How are you loading the overlays? Has to be done in uboot these days. You should be able to check what's loaded in /proc/device-tree. Anyway going out now, but I'll paste my commands when I get back.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby summers » Sat Sep 05, 2020 10:48 am

OK back from shopping. First off modern kernels don't do CardMgr, it wasn't a good idea in the first place doing live replacements of hardware on the device, so it was flipped to applying device tree overlays in uboot.

Its worth reading this thread https://archlinuxarm.org/forum/viewtopic.php?f=23&t=12635 its where we came up with what is probably the best way of doing overlays on BBB.

First of on arch we use /boot/boot.scr to set uboot variables, Robert uses /boot/uEnv.txt, and arch moved away from that some years ago.

You need to remove any pins in the device tree that are used already, that you want to change the use of. E.g. often have to disable hdmi. Then its a case of adding the overlay from /lib/firmware to the device tree before booting.

Anyway read the above thread (through to the end) and hopefully it will give you what you need. Any questions do shout, may well not have answers, but might as well ask ...
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby nsollars » Sat Sep 05, 2020 12:49 pm

This is great just what I was looking for, the Andice labs power cape interestingly does not have an overlay as it happens, I was just checking that I was still able to apply one for it and that it was still viable to do so.

Thanks for the info/pointers and yes I will reach out if need be


Thanks again
Nige
nsollars
 
Posts: 21
Joined: Mon Sep 04, 2017 6:14 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby summers » Sun Sep 06, 2020 9:42 am

Check if Robert has done an overlay, think they appear here: https://github.com/beagleboard/bb.org-overlays/tree/master/src/arm.

Even if there isn't an overlay yet, shouldn't be hard to do. Check with the manufacturer what has been wired up, I'd guess at an I2C interface for a power cape. Then check what changes are needed to the device tree, best to start from the linux sources https://github.com/torvalds/linux/blob/6f0d349d922ba44e4348a17a78ea51b7135965b1/arch/arm/boot/dts/am335x-boneblack-common.dtsi as the sources have comments - which makes it easier.

The other overlay files will style to use.
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby nsollars » Wed Sep 16, 2020 1:07 am

So I reached out to see if an andice labs overlay actually existed but unfortunately no reply and did not find anything close ( may have missed something also ).

Since I now have power to the cape and the BeagleBone is up and running I was able to test using the i2c tools to show both the INA219 and AVR on the I2C bus 0x40 and 0x21.

So I, after doing quite a bit of reading ( so need to do more ) I started to pen out what this one will look like, so right now I have this,

&i2c2 {

ina219: ina219 {
compatible "ti,am335x-bone", "ti,am33xx";
reg = <0x40>;
//shunt-resistor = <100000>; // R100 <example value>
shunt-resistor = <> // TBD need to look at schematic

};
};

Now I do not know how or even if Linux has drivers for the AVR / 328p ( I believe ). Was following this https://irq5.io/2018/07/24/boot-time-de ... th-u-boot/ and looking at all provided materials provided in this thread to get an idea.

Nige
nsollars
 
Posts: 21
Joined: Mon Sep 04, 2017 6:14 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby summers » Fri Sep 18, 2020 10:09 am

If you can see the devices with i2c tools, means that they must come in on standard i2c ports, that must be already set up in the standard tree. As such you wouldn't need to add them to you own overlay.

I2C from what I can recall, can only really be used to read and set registers on the device. Is so you need to find what you can do, this is more driver development rather than device tree interface definition. Anyway if you download the data sheets and any functional sheets for the various componenets, it will probably tell you what you can set, and what read via I2C.

E.g. https://www.ti.com/lit/ds/symlink/ina219.pdf
summers
 
Posts: 984
Joined: Sat Sep 06, 2014 12:56 pm

Re: Beagle Bone Black CardMgr latest kernel

Postby nsollars » Sun Sep 20, 2020 6:51 pm

After looking / reading a little more I figured a nice compromise would be to probe in the ina2xx driver. So I did the following,

modprobe ina2xx
echo 'ina219 0x40' > /sys/bus/i2c/devices/i2c-2/new_device

In dmesg I saw the following,

[ 2092.099065] ina2xx 2-0040: power monitor ina219 (Rshunt = 10000 uOhm)
[ 2092.113472] i2c i2c-2: new_device: Instantiated device ina219 at 0x40

Which is great from my standpoint so lsmod now shows the following,

ina2xx_adc 24576 0
ina2xx 20480 0

And I have,

/sys/bus/i2c/devices/2-0040/hwmon/hwmon0/

to read any and all provided data and sensors pulls data looking like,

ina219-i2c-2-40
Adapter: OMAP I2C adapter
in0: 0.00 V
in1: 4.18 V
power1: 60.00 mW
curr1: 12.00 mA

So this works for me..

Nige
nsollars
 
Posts: 21
Joined: Mon Sep 04, 2017 6:14 pm


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 5 guests