**** BEGIN LOGGING AT Fri Feb 08 02:59:56 2019 Feb 08 03:02:44 dreamhiker: yes, so if you want to transfer a multi-byte integer, you need to byteswap it, use a big-endian struct like my last example, or manually split the value into bytes like my first example Feb 08 03:04:49 Thanks! As I said I took the sample from Arduino. According to the code, it seems that Arduino is big-endian. So, i need to change a few things. And I do know how to deal with bytes :) Thanks! Feb 08 03:05:25 (if you'd want to use bitfields e.g. for structures like those in table 4 on page 19, you'd either use a normal struct, specify them from right-to-left, and finally byteswap the resulting 32-bit integer, or more conveniently use a big-endian struct and specify the fields from left-to-right Feb 08 03:05:30 ) Feb 08 03:11:11 what do you mean here by struct? Or better check my understanding as follows: Feb 08 03:15:46 ? Feb 08 03:22:22 oh, i see. So you mean that in order to handle properly the start address on BBB, I will receive over SPI addr+0 first and I need to put it into the topmost byte. Feb 08 03:23:08 so if I receive [0x12, 0x13, 0x14, 0x, 15] I need to form the int as 0x12131415 Feb 08 03:23:16 on BBB Feb 08 03:23:26 that's what big endian means Feb 08 03:24:18 and by struct you meant something like uint32? Feb 08 03:24:54 uhh no by struct I mean a struct... Feb 08 03:25:19 you mean a c struct that contains 4 bytes? Feb 08 03:26:09 if you mean the ones in table 4, those are four bytes yes Feb 08 03:26:21 why this is more convenient than uint32 (or uint16)? Feb 08 03:26:28 note: I was just giving a few options, you can of course compose that value any way you want Feb 08 03:26:51 I value everything that you are saying. Feb 08 03:27:18 Thus, still curious why struct is any better than uint32? Feb 08 03:27:32 because the various fields shown could actually be fields, instead of manually having to shift them into place, or them together, and then split it into bytes in big-endian byteorder Feb 08 03:27:34 which seems more convenient to me Feb 08 03:28:04 because I can use the field numbers from the table Feb 08 03:31:45 what do they mean by CustomAddress [5:0]? Feb 08 03:32:24 so, for example for the RTD structure, you could use https://pastebin.com/Rt0fsJyi and pass that directly as data to my spi_reg_write function Feb 08 03:34:13 oh, I see Feb 08 03:34:42 alternatively, you can construct it as a 32-bit integer, and then apply htobe32() to it and pass a pointer to the result as data to spi_reg_write Feb 08 03:35:25 I was unaware of _attribute_ extension Feb 08 03:36:25 or you could actually pass it as a 32-bit integer without byteswapping it, and instead use .len = 1 and .bits_per_word = 32 for tr[1] Feb 08 03:36:56 plenty of options Feb 08 03:37:42 the last option however doesn't work if you need to pass some structure that isn't a single 16- or 32-bit integer Feb 08 03:38:41 (or array thereof) Feb 08 03:38:57 it seems however that the registers in this thing are all either 8-bit or 32-bit Feb 08 03:39:14 based on a quick look Feb 08 03:40:05 so maybe it's worthwhile to just have separate functions for reading/writing uint8_t[] and uint32_t[] Feb 08 03:43:21 e.g. https://pastebin.com/nMjd9sdz Feb 08 03:43:26 anyway, I'm off to bed Feb 08 03:46:03 good night Feb 08 03:58:46 zmatt, thanks a lot. Hopefully, with your help, I will finish it tomorrow. Have a good night! Feb 08 08:50:26 When I start X11 on white beagle+LCD red and blue colors are inverted, what to check ? Feb 08 10:25:37 has it something to do with RGB-BGR ? Feb 08 11:34:46 fred__tv: the &lcdc node should either have blue-and-red-wiring = "straight"; or blue-and-red-wiring = "crossed"; depending on how the display is wired up Feb 08 11:35:10 normally straight is used if the display uses 16-bit color and crossed is used if it uses 24-bit color Feb 08 11:35:48 if neither is declared in DT then it will actually depend on whether userspace uses 16-bit or 24-bit color, which is obviously undesirable Feb 08 13:02:51 wow... perhaps I'm wrong , I get this with colortest-16 : https://imagebin.ca/v/4WIy2OcTQ1BV Feb 08 13:03:15 I realized I have that issue while plotting with gnuplot only... Feb 08 13:48:22 . Feb 08 13:48:57 what dtb is used when no one is specified on uEnv.txt ? Feb 08 13:55:47 depends Feb 08 13:56:51 fred__tv: just add blue-and-red-wiring = "straight"; to the &lcdc node in your overlay to be sure Feb 08 13:57:16 since otherwise different applications can give different results depending on whether 16-bit or 24-bit color is used Feb 08 13:57:37 you mean the LCD overlay not the entire dtb Feb 08 13:57:43 ? Feb 08 13:57:55 ?? Feb 08 13:58:27 whereever the display is configured, which in your case is in your (lcd) overlay Feb 08 13:58:30 bbl Feb 08 13:59:11 ./lib/firmware/myoverlay.dtbo that I recall from uEnv.txt ? Feb 08 14:05:06 I usually de-compile my dtbo into dts , modify and recompile into dtbo , is there any faster or better way ? Feb 08 14:05:34 you should absolutely never do that! Feb 08 14:05:54 that's the easiest way to break your device tree Feb 08 14:06:28 teach me how, please... Feb 08 14:06:30 always compile from original source code Feb 08 14:07:04 I don't understand why you would ever use decompiled source.. it's an unreadable mess Feb 08 14:08:46 I do: dtc -I dtb -O dts -o my_overlay.dts my_overlay.dtb modify the dts and recompile ...... :-(( Feb 08 14:11:59 that is what I've done with the original /lib/firmware/BB-BONE-LCD7-01-00A2.dtbo to fit my LCD resolution and make my own new dtbo Feb 08 14:12:40 no /o\ Feb 08 14:13:22 ok how to get the original dts ? Feb 08 14:15:19 the bb.org-overlays repository. but also, I gave you example source for use with my overlay-utils, which is more readable and easier to edit Feb 08 14:15:51 original dts: https://github.com/RobertCNelson/bb.org-overlays/blob/master/src/arm/BB-BONE-LCD7-01-00A2.dts Feb 08 14:16:03 cleaned up version for use with my overlay-utils: https://pastebin.com/UYJJVrG6 Feb 08 14:16:28 (overlay-utils repo: https://github.com/mvduin/overlay-utils ) Feb 08 14:16:54 for both bb.org-overlays and overlay-utils, use the included makefile to compile the dtbo Feb 08 14:17:27 so no dtc etc etc ? Feb 08 14:17:37 the makefile will invoke dtc Feb 08 14:18:08 but it will also apply c preprocessing to support #includes and macros and such Feb 08 14:18:30 how to use makefile ? syntax... (be patient ,never done) Feb 08 14:18:38 and overlay-utils applies a perl script to reprocess the dtsi-style source code into the ugly structure required for overlays Feb 08 14:19:24 (bb.org-overlays) make src/arm/BB-BONE-LCD7-01-00A2.dtbo Feb 08 14:19:49 (overlay-utils) make my-lcd-overlay.dtbo (if you've saved the source code as "my-overlay.dtsi") Feb 08 14:21:33 ok , but how your overlay-utils work ? if simpler/better I'm happy to use it.. Feb 08 14:23:22 overlay-utils accepts normal device tree syntax, same as used for the main dts and the dtsi files it includes. bb.org-overlays uses the raw structure of overlays, which is kind of ugly Feb 08 14:23:29 this compares the differences: https://pastebin.com/b8kZfhRG Feb 08 14:23:40 overlay-utils also has some custom macros for making things more readable Feb 08 14:25:45 (bb.org-overlays nowadays also has convenience macros, but they're not as nice imho and because they were introduced later they're not used consistently by overlays) Feb 08 14:26:11 let's do a practcal example, I've git-cloned https://github.com/mvduin/overlay-utils Feb 08 14:26:23 copied https://github.com/RobertCNelson/bb.org-overlays/blob/master/src/arm/BB-BONE-LCD7-01-00A2.dts Feb 08 14:26:26 mp Feb 08 14:26:27 no Feb 08 14:26:41 if you want to use bb.org-overlays, use bb.org-overlays Feb 08 14:26:56 if you want to use overlay-utils, use https://pastebin.com/UYJJVrG6 Feb 08 14:27:36 ah ok Feb 08 14:27:47 just compare the two source files to get a feeling of how they differ (with the caveat that my version isn't a literal translation of BB-BONE-LCD7-01-00A2.dts, it includes other fixes and cleanups) Feb 08 14:28:54 ok I have yours, next ? Feb 08 14:29:24 apply mods and make ? Feb 08 14:29:26 save the pastebin file as my-overlay.dtsi or whatever and do "make my-overlay.dtbo" Feb 08 14:30:10 or just "make" works too, it'll compile every dtsi into a dtbo Feb 08 14:31:02 hmm, I should add some flags to dtc to suppress irrelevant warnings Feb 08 14:31:47 oh I'm not actually getting any Feb 08 14:32:47 oh I fucked something up Feb 08 14:33:19 looks like my paste uses a file I never committed to git Feb 08 14:34:52 fixed and pushed Feb 08 14:35:50 okay, I've now verified it compiles on a *clean* checkout of overlay-utils :P Feb 08 14:36:02 and also removed the redundant #include "bone/common.h" Feb 08 14:37:05 so ? Should I re-clone overlay-utils ? Feb 08 14:37:08 git pull Feb 08 14:37:57 what difference from git clone and git pull ? Feb 08 14:38:35 "git clone $URL" is something you execute outside a git repository to create a new repository that's a clone from the repository at the given url Feb 08 14:38:56 "git pull" inside an existing git repository downloads any upstream changes and applies them locally Feb 08 14:39:05 clear Feb 08 14:41:24 doing make myoverlay.dtsi says make: no operation to execute for myoverlay.dtsi (I'm translating..) Feb 08 14:41:34 make myoverlay.dtbo Feb 08 14:41:45 ops... Feb 08 14:41:51 in general, "make" followed by the file you want to create Feb 08 14:42:30 the makefile contains rules on how to create files from other files Feb 08 14:43:30 done , applying.... Feb 08 14:44:51 something wrong, checking... Feb 08 14:48:12 can I add a path to write dtbo somewhere ? make myoverlay.dtbo /somewhere ? Feb 08 14:48:26 no, just copy it after compiling it Feb 08 14:48:44 you need sudo anyway to copy it to /lib/firmware/ Feb 08 14:49:40 ok Feb 08 14:51:27 or you could insert these rules into the makefile: Feb 08 14:51:29 https://pastebin.com/jFsweugH Feb 08 14:52:15 the first rule in the makefile becomes the default rule (used if you just type "make"), so if you put this install rule before the existing "all" rule, then install becomes the default action Feb 08 14:52:48 beware that the indented line *must* be indented using a tab, *not* using spaces Feb 08 14:53:12 ok Feb 08 14:55:20 overlay not working... let me check what's wrong Feb 08 14:55:45 yeah like I said the first time I shared it, I hope I didn't fuck anything up while making changes Feb 08 14:56:03 first of all how should I copy dtsi from pastebin ? a simple copy into editor ? Feb 08 14:57:44 wget -O myoverlay.dtsi https://pastebin.com/raw/UYJJVrG6 Feb 08 14:57:59 ok so I'll make first a dtbo without mods and see if it works at 800x480 instead of 640x480 needed Feb 08 14:58:28 what do you mean by "not working" exactly? what is the result? Feb 08 14:58:42 the lcd remains off? any errors in kernel log? Feb 08 15:00:06 lcd off Feb 08 15:00:19 okay, check kernel log? Feb 08 15:00:45 but no activiti on beagle leds too Feb 08 15:00:53 activity* Feb 08 15:01:01 -.- so just say "boot fails" Feb 08 15:01:39 I don't suppose you have a serial debug cable to see what u-boot says? Feb 08 15:01:59 no Feb 08 15:02:19 does white has serial for debug ? Feb 08 15:02:33 this is the annoying part of overlays... dtc can't check for invalid references, instead you only find out because u-boot fails to load it Feb 08 15:02:43 oh wait, the white actually exposes its serial debug port via usb Feb 08 15:03:00 BBW has the FDTI USB2Serial on it for JTAG and serial Feb 08 15:05:47 I'll also check if I see any obvious mistake in the overlay source Feb 08 15:07:12 actually I don't really have time right now.. I guess I could check tomorrow on an actual beaglebone Feb 08 15:07:31 afk, work stuff Feb 08 15:13:59 m Feb 08 15:14:18 take your time, checking bb.org one Feb 08 15:35:11 however, not a wiring issue, blue-and-red-wiring = "crossed" causes boot Tux penguin to have blue beak and paws.... :-)))) Feb 08 15:36:16 also, in both modes a X11 colortest gives red and blue inverted, weird.... Feb 08 16:02:33 Hi guys I am desperately need your help. My beaglebone black was working fine until yesterday evening my coworker was playing with it now I can't ssh into it neither it shows up on the COM port. The only thing I can do to it is ping it. I have a very critical software on it. Is there a way for me to access the processor without re-immiging the processor? Feb 08 16:22:21 any thoughts guys? Feb 08 16:23:55 Stick in a normal microsd image, boot with that card, and mount the eMMC to get your app off.. Feb 08 16:25:28 @rcn if I stick a micosd image it will boot to the microsd not the eMMC. So how I will get the eMMC info if I am not sshed into it? Feb 08 16:26:58 m Feb 08 16:27:01 whoops Feb 08 16:27:21 Kar: do you have a serial cable? Feb 08 16:28:39 Kar: https://www.packtpub.com/sites/default/files/Article-Images/9702OT_02_15.png Feb 08 16:31:07 Yes I do have serial cable. But it does not show as a serial COM port Feb 08 16:31:23 No serial COM port and no IP address when I do ifconfig Feb 08 16:31:23 so ssh into the microSD image.. Feb 08 16:31:45 No ip address so I cann't ssh into it Feb 08 17:01:20 Kar: it's on the eMMC or SD? Feb 08 19:27:54 zmatt, are you there? Thank you for your help! Feb 08 19:29:36 I am looking at spi_reg8_read() and spi_reg8_write(). What would be a good test to write and to read to make sure the SPI connection is OK? Feb 08 19:39:56 you can use a scope dreamhiker Feb 08 19:40:06 otherwise you have test modes in the SPI driver Feb 08 19:40:21 or maybe if you plug the MISO to MOSI you can read what you wrote Feb 08 19:40:29 but that won't tell anything about the clock polarity and phase Feb 08 19:44:56 MISO-MOSI loop works for me. How do I access the test modes in SPI driver? Feb 08 19:48:45 I don't know your driver Feb 08 19:49:04 but in the BBB SPI controller there's a register to do it Feb 08 19:49:08 MCSPI0_SYST Feb 08 20:02:24 zmatt, it seems I am getting something out of the LTC2984 SPI! My next step is to understand that chip better. Feb 08 20:05:55 Yes, I am successfully writing and reading the registers! Great! Feb 08 21:47:42 zmat, I have tried your read/write functions. spi_reg8_read() and spi_reg8_write() are working fine and producing the right result Feb 08 21:48:32 can I see the functions dreamhiker ? Feb 08 21:48:35 I'd like to see his code Feb 08 21:48:44 But neither spi_reg32_read() nor spi_reg32_write() work. For example: Feb 08 21:49:16 you can paste it at https://paste.serveur.io/ Feb 08 21:49:20 select C in coloration syntaxique Feb 08 21:49:34 uint32_t data[4]; Feb 08 21:49:43 spi_reg32_read(fd, 0x00, data, 1); Feb 08 21:50:11 produces "Invalid argument" Feb 08 21:50:27 the whole code I mean Feb 08 21:50:48 mawk, the functions were provided by zmatt in https://pastebin.com/nMjd9sdz Feb 08 21:51:07 ah but it's linx Feb 08 21:51:08 ok ok Feb 08 21:51:19 I thought you were doing bare-metal stuff Feb 08 21:51:38 look at the last lines of « sudo dmesg » dreamhiker Feb 08 21:51:44 that's where the SPI driver would complain if you did something wrong Feb 08 22:01:11 nothing in dmesg. My guess that zmatt will tell us that the device does not support 32-bit word transfers Feb 08 22:02:19 yeah Feb 08 22:02:27 that's the best hypothesis Feb 08 22:12:40 but a good idea to check the serial channel - it outputs typically errors Feb 08 23:44:03 dreamhiker: odd, I'm pretty sure the hardware supports 32-bit transfers... maybe the driver doesn't? lemme check Feb 08 23:46:01 hmm, looks like it should Feb 08 23:46:05 lemme do a quick test Feb 08 23:47:02 actually I use 32-bit transfers in my own software, and they work for me Feb 08 23:47:02 just to make sure that I understand correctly: to do 32-bit transfers I must use ioctl SPI_IOC_WR_BITS_PER_WORD with value of 32 Feb 08 23:47:12 no! Feb 08 23:48:02 if that needed to be done, I would have included it in my code Feb 08 23:48:12 :) Feb 08 23:48:28 my code overrides the bits per word for the 32-bit transfer, but otherwise assumes bits per word is 8 Feb 08 23:48:57 what is the purpose of this ioctl then? Feb 08 23:48:59 let me see if there's any significant difference between my own code and the pastebin example Feb 08 23:49:35 it sets the default number of bits per word, which I set to 8 in the spi_initialize in my example Feb 08 23:51:54 ah! Feb 08 23:51:56 my bad! Feb 08 23:52:11 looking back at your code at pastebin, it seems that it is not set in the header transfer Feb 08 23:52:50 yes that's where I assume the default is 8, which is what I configured in spi_initialize Feb 08 23:54:15 ok, so adding bits-per_word for the header transfer should fix it? Feb 08 23:54:41 and this ioctl is not needed? Feb 08 23:55:18 you could do that if you wanted to, it doesn't really matter either way Feb 08 23:55:29 I have found the actual problem though, and I'm fixing the pastebin Feb 09 00:01:17 done Feb 09 00:01:48 the "len" field of the transfer is in bytes, not in words Feb 09 00:02:20 (where each word takes 1, 2, or 4 bytes depending on bits_per_word) Feb 09 00:05:13 Thanks! Feb 09 00:05:43 what is the advantage to use 32-bit transfers? Feb 09 00:06:05 not having to manually convert to big-endian Feb 09 00:06:21 Thanks! Feb 09 00:53:07 Hello. How can I remove librobotcontrol from a BBBW or how can I disable it so It will not run? Feb 09 00:53:36 My BBBW has a basically empty uEnv.txt file and I cannot config-pin uart pins. Feb 09 00:58:40 dpkg? Feb 09 01:00:03 I got it. Feb 09 01:00:13 Halt the answer. Feb 09 01:07:15 My uEnv.txt file is still overran by the robotcontrol library. I used dpkg-reconfigure librobotcontrol to type in the prompt NONE and I still have a "faulty" uEnv.txt file. Is there a way to stop this service or do I need to erase it? Feb 09 01:08:58 https://pastebin.com/27aU6suQ is my uEnv.txt file. This may seem odd, heh? Feb 09 01:12:50 It is probably that u-boot stuff, again.a Feb 09 01:18:36 Do you know what version of u-boot I should have for kernel 4.14.x? Feb 09 01:22:42 I am getting ready for the Maker Faire to show a bot and give "pointers." It should be an experience. Feb 09 01:24:45 09.2018? Feb 09 01:55:39 P9_21 pinmux file not found! Pin has no cape: P9_21 <---- What does this mean? Feb 09 02:05:48 I will update to the newer kernel and see what happens. Feb 09 02:29:01 It is probably the old issue w/ u-boot on the eMMC. I am updating my eMMC again. Sorry for the odd language. Feb 09 02:38:45 Dang it. I went ahead and blamed u-boot and librobotcontrol in the googlegroups. I bet all kinds of people hate me now. Feb 09 02:38:57 Oh well. Another day on the farm. Feb 09 02:47:52 My system went into uEnv.txt.backup instead of uEnv.txt, i.e. like usual. Odd days. Feb 09 02:51:49 I erased the old uEnv.txt file to use the .backup file instead. That worked but all my work was missing when I rebooted. Feb 09 02:51:58 Yea boy! **** ENDING LOGGING AT Sat Feb 09 02:59:57 2019