*** brlogger has joined #automotive | 10:29 | |
fury | might be able to get it working by including the MCP2515 kernel module / device tree overlay | 12:57 |
---|---|---|
GuyElpotato | fury, I have to add this in /boot/config.txt, agree ? | 13:12 |
fury | GuyElpotato: 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 |
fury | KERNEL_DEVICETREE_raspberrypi3_append = "\ | 13:38 |
fury | overlays/rotary-encoder.dtbo \ | 13:38 |
fury | " | 13:38 |
fury | something 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 layers | 13:39 |
fury | instead of rotary-encoder, whatever the .dtbo is for the mcp2515 | 13:39 |
fury | and then the config.txt line to add the mcp2515 overlay will work | 13:39 |
fury | sounds like it'd be overlays/mcp2515-can0.dtbo | 13:40 |
fury | if 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 layer | 13:43 |
GuyElpotato | Thank you for your answer fury, I'm not sure I understood everything you told me. | 13:57 |
GuyElpotato | But 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 |
GuyElpotato | So it's not possible to just configure a demo image, in order to make it work? | 13:57 |
fury | right - the demo image won't contain the necessary .dtbo file that the bootloader would need for that config to work | 14:11 |
fury | so you'll need to build it yourself with that modification so that it includes that file | 14:12 |
fury | i am not certain if just dropping the compiled .dtbo file would work, so it could mean a full image reflash. but worth a shot probably | 14:12 |
fury | i 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 directory | 14:13 |
fury | if 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 space | 14:14 |
fury | GuyElpotato: got a linux host machine to work with? | 14:17 |
GuyElpotato | Ok well, I could try to drop the compiled .dtbo, maybe it will take less time. Where can I find it ? | 14:19 |
GuyElpotato | Yes I have a archlinux machine | 14:19 |
fury | hmm...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 build | 14:22 |
fury | what version did you install? | 14:22 |
GuyElpotato | From what I understand, demo images are not intended to be used as a basis for developing or implementing applications ? | 14:23 |
GuyElpotato | Ok well, I think, I will build my own image then. I have the 4.20.13 arch. | 14:24 |
fury | they're usable, but there are some special things you have to do with your application to get it to work with the demo HMI | 14:24 |
fury | sorry, meant what version of AGL did you install for the pi? | 14:24 |
fury | you'll want to download that exact version's sources to build the modified boot files | 14:24 |
GuyElpotato | I have the Guppy 7.0.1 or Guppy 7.0.0 I think | 14:25 |
fury | i'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 same | 14:25 |
fury | ok, 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 |
fury | this 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.html | 14:28 |
GuyElpotato | So 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 |
GuyElpotato | Ok thank you ! I'll look into it. | 14:29 |
fury | i 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 start | 14:29 |
fury | it may need a couple other packages or config settings | 14:30 |
fury | follow that doc page down the line (top to bottom in the Developing an AGL image section of the sidebar) | 14:31 |
fury | when you get to repo init -b flounder -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo - say guppy instead of flounder | 14:31 |
GuyElpotato | Ok np. I have already read this documentation but I did not follow the procedure as I did not want to build my own image | 14:32 |
fury | and when you get to the last page, before bitbake agl-demo-platform, you'll modify a .bbappend as i described earlier | 14:32 |
fury | and there might be a different bitbake target to run to get just the kernel and the .dtbo files compiled | 14:33 |
fury | probably bitbake linux-raspberrypi | 14:33 |
smurray | "bitbake virtual/linux-kernel" should work for any platform | 14:34 |
fury | aha. 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 :D | 14:34 |
fury | the 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_%.bbappend | 14:34 |
fury | or 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 |
smurray | fury: "bitbake linux-raspberrypi" will also work if it's raspberrypi the tree is configured for | 14:35 |
fury | ah yep | 14:35 |
smurray | though 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 it | 14:36 |
smurray | no, it should be fine, looks like they patch the kernel so it'll build them | 14:37 |
smurray | the change I'd make would probably be to tweak KERNEL_DEVICETREE in meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc | 14:40 |
fury | that looks like a better place for it | 14:40 |
smurray | for reference see the KERNEL_DEVICETREE_append done in meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi2.inc | 14:40 |
fury | after 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 dir | 14:56 |
fury | then add the appropriate config.txt entry | 14:57 |
fury | should at least get a can0 in ifconfig | 14:57 |
fury | but from there, i've not ventured into getting can data from there to the dashboard | 14:57 |
fury | might 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 service | 14:58 |
GuyElpotato | Okay, 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 |
GuyElpotato | config.txt should look like this ? dtparam=spi=on | 15:00 |
GuyElpotato | dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25 | 15:00 |
GuyElpotato | dtoverlay=spi1-1cs | 15:00 |
GuyElpotato | 15:00 | |
fury | instead of the file i said, probably better to modify meta-agl/meta-agl-bsp/conf/include/agl_raspberrypi3.inc | 15:00 |
fury | if 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 |
fury | something like that | 15:01 |
fury | i haven't personally tried the mcp2515 on a pi (yet) so i don't know if that will work. but looks like it could | 15:01 |
fury | i'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 already | 15:02 |
fury | but like scott said you can see raspberrypi2.inc as well for an example | 15:02 |
fury | so adding a line like KERNEL_DEVICETREE_append = " overlays/mcp2515-can0.dtb" | 15:04 |
smurray | I was looking at guppy, so that line will need to be added | 15:04 |
fury | or if there's already one in agl_raspberrypi3.inc just add a space and that file | 15:04 |
fury | ok | 15:04 |
fury | i 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 there | 15:04 |
fury | our team over here was just thinking about building a hat-like board with one of those to play with | 15:05 |
fury | since it's widely done in non-AGL uses of raspberry pi for CAN stuff | 15:05 |
GuyElpotato | Ok So there no line like KERNEL_DEVICETREE_append in agl_raspberrypi3 but on the agl_raspberrypi2 there is ! | 15:06 |
GuyElpotato | So I can do the same | 15:06 |
smurray | fury: I recently bought a PiCAN2, haven't gotten around to trying it | 15:06 |
fury | cool. add it just like so, and do a bitbake linux-raspberrypi - then go make a pot of coffee and drink it :) | 15:06 |
fury | smurray: that looks pretty neat! | 15:08 |
waltminer | mmmm coffee | 15:08 |
smurray | fury: 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 bus | 15:10 |
fury | a 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 kernel | 15:10 |
smurray | quite 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 timesinks | 15:11 |
GuyElpotato | Ahahah, 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 |
smurray | a layer, you mean? | 15:11 |
fury | there's a yocto layer, and then there's a device tree overlay - if you mean device tree overlay it's...kinda over my head | 15:12 |
fury | but 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 it | 15:12 |
fury | a layer is basically a collection of recipes that define that piece of the system | 15:13 |
fury | i think | 15:13 |
smurray | there are docs on yoctoproject.org | 15:13 |
GuyElpotato | overlay sorry | 15:14 |
fury | this might help: https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree/overview | 15:15 |
fury | it's for beaglebone, but raspberry pi uses device tree and overlays as well | 15:15 |
smurray | if 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 up | 15:15 |
fury | kernel patching is fun! | 15:16 |
smurray | then you'd be able to add the overlay to KERNEL_DEVICETREE to have it built | 15:16 |
GuyElpotato | Ok 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 IRC | 15:21 | |
*** leon-anavi has quit IRC | 16:49 | |
*** neurotok has joined #automotive | 19:02 | |
*** neurotok has left #automotive | 19:10 | |
*** khem has quit IRC | 19:22 | |
*** khem has joined #automotive | 19:34 | |
*** nate02 has quit IRC | 20:42 | |
*** Tarnyko has quit IRC | 23:23 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!