IRC logs for #automotive for Friday, 2019-04-19

*** brlogger has joined #automotive10:29
furymight be able to get it working by including the MCP2515 kernel module / device tree overlay12:57
GuyElpotatofury, I have to add this in /boot/config.txt, agree ?13:12
furyGuyElpotato: there's an additional line you'll need somewhere in a kernel recipe, let me see if i can dig up my config (I added the rotary encoder DTO so it'll be something similar)13:35
furyKERNEL_DEVICETREE_raspberrypi3_append = "\13:38
fury    overlays/rotary-encoder.dtbo \13:38
fury"13:38
furysomething along those lines in a recipes-kernel/linux/linux-raspberrypi_%.bbappend somewhere - your layer if you have one, or just edit the existing one in AGL if you're playing around with the existing demo layers13:39
furyinstead of rotary-encoder, whatever the .dtbo is for the mcp251513:39
furyand then the config.txt line to add the mcp2515 overlay will work13:39
furysounds like it'd be overlays/mcp2515-can0.dtbo13:40
furyif you haven't already built AGL from source, then that's where  you'd need to start - getting the AGL repo, doing the repo sync, then going in there and adding or editing the layer13:43
GuyElpotatoThank you for your answer fury, I'm not sure I understood everything you told me.13:57
GuyElpotatoBut if I have understood what you are explaining to me, everything you just said must be done when I am building my image from the sources, right?13:57
GuyElpotatoSo it's not possible to just configure a demo image, in order to make it work?13:57
furyright - the demo image won't contain the necessary .dtbo file that the bootloader would need for that config to work14:11
furyso you'll need to build it yourself with that modification so that it includes that file14:12
furyi am not certain if just dropping the compiled .dtbo file would work, so it could mean a full image reflash. but worth a shot probably14:12
furyi think in my case all i needed to do was build it but didn't need a full reflash, i could just add that .dtbo file i needed into the proper directory14:13
furyif you haven't done this before i'd be happy to try to walk you through it. prepare to spend at least 3-4 hours downloading and building, depending on the speed of your internet connection and computer. and you'll probably need about 80-100 gigs of free space14:14
furyGuyElpotato: got a linux host machine to work with?14:17
GuyElpotatoOk well, I could try to drop the compiled .dtbo, maybe it will take less time. Where can I find it ?14:19
GuyElpotatoYes I have a archlinux machine14:19
furyhmm...you'd probably still have to build it, i think it'll depend on the kernel version specific to the AGL build for raspberry pi. but at least building just the kernel and kernel modules might be faster than a full image build14:22
furywhat version did you install?14:22
GuyElpotatoFrom what I understand, demo images are not intended to be used as a basis for developing or implementing applications ?14:23
GuyElpotatoOk well, I think, I will build my own image then. I have the 4.20.13 arch.14:24
furythey're usable, but there are some special things you have to do with your application to get it to work with the demo HMI14:24
furysorry, meant what version of AGL did you install for the pi?14:24
furyyou'll want to download that exact version's sources to build the modified boot files14:24
GuyElpotatoI have the Guppy 7.0.1 or Guppy 7.0.0 I think14:25
furyi've not tried it on arch, i'm on ubuntu 18.04. but as long as you can get the dependencies installed through arch's package stuff everything else should be the same14:25
furyok, let me look and see if there's up to date docs on an image build, and then i'll show you where you need to modify...14:26
furythis looks mostly up to date...docs are as always a work in progress, but good starting point... http://docs.automotivelinux.org/docs/en/guppy/getting_started/reference/getting-started/image-workflow-intro.html14:28
GuyElpotatoSo you said special things ? It's not detailed on the AGL website. For example, if I want to upload information from my can bus to the home screen dashboard, I would need to make these changes?14:28
GuyElpotatoOk thank you ! I'll look into it.14:29
furyi am not familiar with how to get data from the CAN bus onto the dashboard, sorry...but getting the device tree overlay added in will be a good start14:29
furyit may need a couple other packages or config settings14:30
furyfollow that doc page down the line (top to bottom in the Developing an AGL image section of the sidebar)14:31
furywhen you get to repo init -b flounder -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo - say guppy instead of flounder14:31
GuyElpotatoOk np. I have already read this documentation but I did not follow the procedure as I did not want to build my own image14:32
furyand when you get to the last page, before bitbake agl-demo-platform, you'll modify a .bbappend as i described earlier14:32
furyand there might be a different bitbake target to run to get just the kernel and the .dtbo files compiled14:33
furyprobably bitbake linux-raspberrypi14:33
smurray"bitbake virtual/linux-kernel" should work for any platform14:34
furyaha. smurray with the save. thanks! i'm still learning as i go along, so feel free to stop me if i'm doin it wrong :D14:34
furythe file you'll be looking to modify to add the mcp2515 will be in meta-agl/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend14:34
furyor if you want to avoid losing that change when you sync, you can add your own layer (need to edit something in build/conf/layers.conf i think?)14:35
smurrayfury: "bitbake linux-raspberrypi" will also work if it's raspberrypi the tree is configured for14:35
furyah yep14:35
smurraythough I'd need to poke around, it's possible with raspberrypi that the overlays are built by another recipe.  meta-raspberrypi has some oddities in it14:36
smurrayno, it should be fine, looks like they patch the kernel so it'll build them14:37
smurraythe change I'd make would probably be to tweak KERNEL_DEVICETREE in meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc14:40
furythat looks like a better place for it14:40
smurrayfor reference see the KERNEL_DEVICETREE_append done in meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi2.inc14:40
furyafter that bitbake, you can find . -name mcp2515-can0.dtbo or something like that, try and see if you can just drop that file in place in your /boot/overlays dir14:56
furythen add the appropriate config.txt entry14:57
furyshould at least get a can0 in ifconfig14:57
furybut from there, i've not ventured into getting can data from there to the dashboard14:57
furymight be as simple as hooking up the can driver itself and it all just automagically works, or you might have to modify the existing dashboard application to remove mockups and listen to the agl low level can service14:58
GuyElpotatoOkay, I'm taking notes. And I have to modify this file the way you explained it to me earlier ? And I have to modify also the config.txt.14:59
GuyElpotatoconfig.txt should look like this ? dtparam=spi=on15:00
GuyElpotatodtoverlay=mcp2515-can0,oscillator=8000000,interrupt=2515:00
GuyElpotatodtoverlay=spi1-1cs15:00
GuyElpotato15:00
furyinstead of the file i said, probably better to modify meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc15:00
furyif there's an existing KERNEL_DEVICETREE setting there, you just add the new overlay on another line, if there is not, you can add the lines i specified (KERNEL_DEVICETREE_append)15:01
furysomething like that15:01
furyi haven't personally tried the mcp2515 on a pi (yet) so i don't know if that will work. but looks like it could15:01
furyi'm a little out of date, still on flounder, so i don't know if there's been an addition with a kernel devicetree in that file already15:02
furybut like scott said you can see raspberrypi2.inc as well for an example15:02
furyso adding a line like KERNEL_DEVICETREE_append = " overlays/mcp2515-can0.dtb"15:04
smurrayI was looking at guppy, so that line will need to be added15:04
furyor if there's already one in agl_raspberrypi3.inc just add a space and that file15:04
furyok15:04
furyi wonder if a patch should be submitted to add this overlay to all rpi3 builds - seems like a common use case, slap an mcp2515 chip on there15:04
furyour team over here was just thinking about building a hat-like board with one of those to play with15:05
furysince it's widely done in non-AGL uses of raspberry pi for CAN stuff15:05
GuyElpotatoOk So there no line like KERNEL_DEVICETREE_append in agl_raspberrypi3 but on the agl_raspberrypi2 there is !15:06
GuyElpotatoSo I can do the same15:06
smurrayfury: I recently bought a PiCAN2, haven't gotten around to trying it15:06
furycool. add it just like so, and do a bitbake linux-raspberrypi - then go make a pot of coffee and drink it :)15:06
furysmurray: that looks pretty neat!15:08
waltminermmmm coffee15:08
smurrayfury: yeah, the h/w looks reasonable, though it's a little unclear how much isolation it provides.  Some of the USB CAN adapters make that pretty clear, and have different versions wrt electrical isolation of the CAN bus15:10
furya full image build on my old desktop took something like 3-4 hours, but don't know how much of that will be necessary for just the kernel15:10
smurrayquite a bit less, the kernel's toolchain requirements aren't huge, and you don't need to build any of the qt stuff or opencv, those are the real timesinks15:11
GuyElpotatoAhahah, Ok I will try it this week end :) But I have a question, where do you find the exact syntaxe when you want to add a overlayer ? What's exactly a overlayer in AGL ?15:11
smurraya layer, you mean?15:11
furythere's a yocto layer, and then there's a device tree overlay - if you mean device tree overlay it's...kinda over my head15:12
furybut for making your own yocto layer, it's a fairly simple process, i've been meaning to put up a blog post or something like that about it15:12
furya layer is basically a collection of recipes that define that piece of the system15:13
furyi think15:13
smurraythere are docs on yoctoproject.org15:13
GuyElpotatooverlay sorry15:14
furythis might help: https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree/overview15:15
furyit's for beaglebone, but raspberry pi uses device tree and overlays as well15:15
smurrayif it's a new one and you want to use the existing linux-raspberrypi recipe to build it, then you'd need to create a patch to the kernel to add the dts file, and a bbappend to linux-raspberrypi somewhere to add the patch to SRC_URI so it'll get picked up15:15
furykernel patching is fun!15:16
smurraythen you'd be able to add the overlay to KERNEL_DEVICETREE to have it built15:16
GuyElpotatoOk I will need to look at all of this xD. Thank you for you help. I'm leaving. If I have a problemI will ask you :)15:21
*** GuyElpotato has quit IRC15:21
*** leon-anavi has quit IRC16:49
*** neurotok has joined #automotive19:02
*** neurotok has left #automotive19:10
*** khem has quit IRC19:22
*** khem has joined #automotive19:34
*** nate02 has quit IRC20:42
*** Tarnyko has quit IRC23:23

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!