**** BEGIN LOGGING AT Sun Mar 24 02:59:57 2019 Mar 24 15:05:21 @zmatt: your spi0.dtsi file worked for me :) Mar 24 15:05:38 But I am getting a kernel oops Mar 24 15:05:59 Which I am not sure if it related to my connection to the beaglebone Mar 24 15:06:30 https://www.pastiebin.com/5c979ba3d8b4a#&togetherjs=Ih2sAelRBK Mar 24 15:06:59 Above are the log messages Mar 24 15:07:32 I mean, the first line says fairly explicitly what the problem is Mar 24 15:07:40 Yes Mar 24 15:07:54 be sure to disable cape-universal Mar 24 15:08:22 actually Mar 24 15:08:23 hmm Mar 24 15:09:23 also, could you use a less annoying paste site next time Mar 24 15:09:46 Hmmm yeah enable_uboot_cape_universal=1 Mar 24 15:10:03 It is enabled in uEnv.txt Mar 24 15:10:16 8:39 PM  also, could you use a less annoying paste site next time Mar 24 15:10:21 Sorry about this Mar 24 15:10:21 I feel like I'm missing part of the log Mar 24 15:10:32 the first three lines look like an unrelated warning Mar 24 15:10:52 while the remaining lines look like the last part of a kernel oops, with the important part missing Mar 24 15:10:58 This is the output of dmesg | grep spi Mar 24 15:11:20 well by doing so you filtered out the actual error Mar 24 15:11:50 please just pastebin the whole kernel log Mar 24 15:12:01 Okay let me send you the whole kernel log Mar 24 15:12:24 (using... well basically any paste site other than this one :P Mar 24 15:12:58 seeing other people's cursors moving around is rather distracting Mar 24 15:16:31 Yes Mar 24 15:16:53 https://gist.github.com/crazoes/c9736765008264284112b87d461af82d Mar 24 15:17:00 Here it is Mar 24 15:17:30 Kernel null pointer dereference Mar 24 15:18:31 did you name your device 'channel@0' ? Mar 24 15:18:42 Does that matter? Mar 24 15:18:47 or is this some old version of cape-universal? Mar 24 15:18:55 I'm trying to determine which device is giving the error here Mar 24 15:19:07 I didn't change it to adt7516 Mar 24 15:19:27 I just changed the compatible name Mar 24 15:20:15 Btw cape universal was enabled Mar 24 15:22:14 so, you probably need to disable cape-universal. but regardless of what, the kernel oops is still a bug in the kernel or this driver Mar 24 15:22:26 Okay Mar 24 15:22:45 This is what I wanted to know Mar 24 15:23:08 I am implementing regmap support for this driver Mar 24 15:23:21 So maybe there is some.problem with my code Mar 24 15:23:25 I'm also a bit confused that it says failed to create SPI device, yet still ends up loading and probing your driver Mar 24 15:24:13 The driver sends 3 pulses down the CS line Mar 24 15:24:25 To switch from i2c to spi Mar 24 15:24:25 unless that error is about the device added by cape-universal, and the kernel oops is unrelated to it Mar 24 15:24:49 but that's easy to verify: just disable cape-universal and check if it still happens Mar 24 15:24:58 Yes Mar 24 15:25:29 So while it is writing to send 3 pulses down Mar 24 15:25:43 This kernel oops is generated Mar 24 15:27:34 https://github.com/crazoes/adt7316/blob/master/drivers/staging/iio/addac/adt7316-spi.c#L112 Mar 24 15:32:00 based on the traceback, it seems it crashes here: https://github.com/crazoes/adt7316/blob/master/drivers/spi/spi.c#L3160 which may be consistent with 'struct spi_device *spi' being NULL Mar 24 15:32:57 Hmmm Mar 24 15:33:22 I also tried to disable cape universal Mar 24 15:33:48 But the problem is not related to it (as you said) Mar 24 15:34:45 in that case, as a side note, you may want update your overlays package since current versions of cape-universal do not declare a device named 'channel@0' Mar 24 15:36:08 Okay Mar 24 15:36:12 Will do that Mar 24 15:36:28 Sorry, I gave you the link of old code Mar 24 15:36:40 Here is the updated one with regmap Mar 24 15:37:10 https://github.com/crazoes/adt7316/blob/new_iio/drivers/staging/iio/addac/adt7316-spi.c#L41 Mar 24 15:37:30 I'm a bit confused really, since I don't see it being changed from channel@0 to spi0channel@0 in the git history of the cape-universal overlay... it looks like it's always been spi0channel@0, weird Mar 24 15:37:32 spi_write function is calling spi_sync Mar 24 15:40:28 I don't really know anything about regmap so I'm not sure what you're doing wrong Mar 24 15:40:37 Okay Mar 24 15:40:45 Let us just leave that Mar 24 15:40:50 obviously spi_dev isn't NULL at the start of your probe function, since then it would crash on spi_dev->max_speed_hz Mar 24 15:41:23 but it appears to be NULL inside adt7316_regmap_spi_write(). you could try to confirm that using a WARN_ON(spi_dev == NULL) there or so Mar 24 15:42:09 why exactly is this context-pointer supposed to be spi_dev ? Mar 24 15:42:46 actually it might also be not NULL, but just the wrong pointer (causing the error somewhere further down the chain) Mar 24 15:44:40 hmm, "This function should generally not be called directly, it should be called by bus-specific init functions." Mar 24 15:45:13 why are you not using devm_regmap_init_spi ? Mar 24 15:47:25 I haven't looked at init_spi Mar 24 15:47:37 Maybe that can be my mistake Mar 24 15:47:59 Context is used as a client Mar 24 15:48:12 Just a different name given in regmap Mar 24 15:48:38 hm, maybe it assumes a specific format.. not sure. like I said, I've never done anything with regmap Mar 24 15:49:04 Oh yed Mar 24 15:49:09 Yes* Mar 24 15:49:13 why are you passing &spi_dev->device as context though? that's not guaranteed to be the same pointer as spi_dev Mar 24 15:49:21 if your want your context to be spi_dev, just pass spi_dev Mar 24 15:49:27 I have used devm_regmap_init_i2c Mar 24 15:49:34 In i2c file Mar 24 15:49:50 But I haven't used init_spi for spi file Mar 24 15:50:20 Stupid of me :( Mar 24 15:51:09 anyway, regardless of what's causing the crash, it just seems to be a bug in your driver as far as I can tell Mar 24 15:51:17 Yes Mar 24 15:51:23 so I wish you good luck with debugging :) Mar 24 15:51:32 Thanks :) Mar 24 16:33:41 @zmatt: just FYI I used devm_regmap_init instead of devm_regmap_init_spi because I also wanted to pass the regmap bus with it. But init_spi only takes two arguments i.e. device and config. Mar 24 16:34:22 And ultimately devm_regmap_init_spi calls devm_regmap_init into it Mar 24 19:55:05 @zmatt: I just solved the driver bug Mar 24 19:55:16 But I am still getting the following Mar 24 19:55:58 https://www.irccloud.com/pastebin/vt5y6mQi Mar 24 19:56:41 If you want I'll send you the whole kernel log Mar 24 19:57:12 And I think I have the latest code of your repo Mar 24 19:57:53 I'm more interested in your /boot/uEnv.txt Mar 24 19:58:06 Okk Mar 24 19:59:00 (with "overlays package" earlier i meant the bb-cape-overlays debian package) Mar 24 19:59:24 although if you have this error with cape-universal disabled, then the problem is something else Mar 24 19:59:44 this kinda looks like you have another overlay enabled for spi Mar 24 20:02:41 Sorry if I have made any silly mistake here Mar 24 20:02:52 I have used overlays for the first time Mar 24 20:03:12 if you share your /boot/uEnv.txt, I can check Mar 24 20:07:24 https://gist.github.com/crazoes/26c8a8feaaa70f596fe252b69ee12c2c Mar 24 20:07:28 Here it is Mar 24 20:08:26 hm, weird Mar 24 20:08:36 can you pastebin your overlay? Mar 24 20:09:03 I was trying to do that Mar 24 20:09:13 But it wasn't happening Mar 24 20:09:16 Let me try Mar 24 20:12:01 https://www.irccloud.com/pastebin/34EhZKEe Mar 24 20:12:27 Sorry Mar 24 20:12:30 Wrong file Mar 24 20:13:46 https://www.irccloud.com/pastebin/0al2ewz9 Mar 24 20:14:14 Here it is ^ Mar 24 20:15:27 o.O okay then I have no idea where the device it's complaining about is coming from Mar 24 20:16:22 it looks like somehow another overlay is being applied or something, except you haven't enable any in your /boot/uEnv.txt Mar 24 20:17:00 Maybe I have connected wrong pins? Mar 24 20:17:15 this is a DT issue, not a hardware issue Mar 24 20:17:20 and it's not an issue in your overlay Mar 24 20:17:40 Ok Mar 24 20:18:05 something is declaring another spi device conflicting with yours, and I don't know what Mar 24 20:18:52 There has been a lot of problems with this device because there is a microcontroller in between Mar 24 20:19:42 Do you have anything that you want me to try? Mar 24 20:19:47 note that there's nothing going wrong with your device, those error messages should not have any adverse effect on the functionality of your device Mar 24 20:20:02 I suspect this is actually something bogus in the base dts or something Mar 24 20:20:17 for now I suggest you just ignore those three lines Mar 24 20:20:33 Okay Mar 24 20:20:45 So I can continue with the driver development Mar 24 20:20:47 ? Mar 24 20:21:00 Without having to worry about these? Mar 24 20:21:01 yes, this shouldn't cause any problems for you Mar 24 20:21:29 Okay thanks for your time and efforts :) Mar 24 20:21:33 the device that failed is not your device Mar 24 20:21:58 Okay Mar 24 22:21:00 need some help with the beaglebone blue Mar 24 22:22:41 I want to make a vaccum robot Mar 24 22:27:19 tip: if you want help with something, it helps to actually ask a question / explain your problem. (and have patience, plenty of knowledgable people here, but they may only occasionally glance at chat, so it can sometimes take quite a while to get a response) Mar 24 22:43:54 or not Mar 24 22:48:09 I know. Use a motor! Mar 24 22:48:47 Oh. Dang. He left. That is too bad. I bet he/she could have learned some stuff about the BBB and motors. Mar 24 22:49:51 Supreme suction is not easy on those vacuums. Mar 24 22:59:56 hi set_ Mar 24 23:00:17 I'm busy doing javascript since a few weeks Mar 24 23:00:21 I don't like it Mar 24 23:00:30 but I hate it less than before starting Mar 24 23:00:44 my hate went from -oo hate points to -10000 hate points Mar 24 23:00:55 lol Mar 24 23:01:00 javascript is pretty bad Mar 24 23:01:11 yeah Mar 24 23:01:20 It is not easy. Mar 24 23:01:21 it has modern language features next to horrible quirks Mar 24 23:01:25 it has a taste of unfinished Mar 24 23:01:30 but the syntax is okay overall, coming from C Mar 24 23:01:36 a lot of legacy mistakes Mar 24 23:01:38 yeah Mar 24 23:01:50 I'm doing a chrome extension so don't care too much about legacy browsers Mar 24 23:01:55 I can use modules, async functions, etc Mar 24 23:02:02 I can unleash my creativity Mar 24 23:02:13 but still Mar 24 23:02:15 sure they added lots of nice things, but it also has core problems that aren't easily fixable Mar 24 23:02:17 yeah Mar 24 23:03:26 they have fortunately fixed some braindeadness.. e.g. thank god we have 'let' and 'const' now, given the bizarre behaviour of 'var' :P Mar 24 23:03:38 yeah Mar 24 23:04:11 what were they thinking with their var Mar 24 23:04:34 I can't think of any legit usecase Mar 24 23:04:41 of having names defined before their values Mar 24 23:04:52 "easy" set up most likely to declare stuff. Mar 24 23:05:18 So, starters like me can understand what it is exactly I need to use. Mar 24 23:05:26 set_: ??? Mar 24 23:05:30 Yes? Mar 24 23:05:34 almost every other language have "lexical scoping" Mar 24 23:05:40 you don't refer to names before their definitions Mar 24 23:05:44 Oh. Mar 24 23:05:56 but javascript thought it would be an interesting feature to not do that Mar 24 23:06:23 it's akin to isset in php Mar 24 23:06:33 so like var = taco is not cool? Mar 24 23:06:39 mawk: note that even with 'let' there are still magical bits, e.g. a closure can use variables that are declared in an enclosing scope *after* the closure is created but before the closure is invoked Mar 24 23:06:54 set_: simple rule: don't use 'var', at all, ever Mar 24 23:07:00 lol Mar 24 23:07:03 Fine. I used to like var. Mar 24 23:07:16 it's interchangeable with "let" for the purposes you were using it for Mar 24 23:07:20 set_: in basically any situation you can replace it with 'let' and all will be fine Mar 24 23:07:20 var = "contact_page"; Mar 24 23:07:24 and if it breaks your code, your code was probably wrong Mar 24 23:07:27 Oh. Mar 24 23:07:33 set_: ehh, you're missing a variable name Mar 24 23:07:39 Oh. Right! Mar 24 23:07:52 also maybe you can use as a rule to put const instead of let, and if it doesn't work you replace by let Mar 24 23:07:52 var j = "contact_page"; Mar 24 23:08:03 this is the braindead version, if you're smart enough you can just figure what is const and what is not Mar 24 23:08:03 let j = "contact_page"; Mar 24 23:08:14 Aw! Mar 24 23:08:45 Okay. I have not kept up w/ JavaScript in some time (ever). I get tid bits here and there but nothing concrete in my language usage. Mar 24 23:09:14 I guess I can use let j = "SuperDuper"; for now on if I use it ever. Mar 24 23:09:39 I barely use it w/ HTML stuff too. I should learn to use it more. Mar 24 23:10:02 It creates nice structure. Mar 24 23:11:24 there are some annoying trends in the web dev currently Mar 24 23:11:33 I figured I would just use vanilla js and that's all Mar 24 23:11:37 no jquery, no whatever Mar 24 23:11:44 just bootstrap for the design because I'm terrible at design Mar 24 23:12:21 bootstrap makes for nice pages. Mar 24 23:13:14 I used this set up I found on w3schools.com, one of their templates for use, to make this webpage. It came out nice. Big and Bright! Mar 24 23:15:18 my thing looks like this: https://pix.watch/tF9kQT/jyrTBH.png Mar 24 23:18:55 several pages and popups and whatnot Mar 24 23:30:14 I've got a synchronization problem Mar 24 23:30:18 this is so annoying to debug Mar 24 23:30:22 over several pages Mar 25 01:43:16 GPS! Mar 25 01:43:38 Now...onto real time. Yikes! **** ENDING LOGGING AT Mon Mar 25 03:00:06 2019