**** BEGIN LOGGING AT Fri Jul 15 02:59:58 2016 Jul 15 19:22:11 one month left until final evaluations Jul 15 19:49:16 m_w, So I removed the error that I was getting on echo Jul 15 19:49:43 chanakya_vc: thats good Jul 15 19:49:56 m_w, But on doing cat, there is no segfault but the screen remains empty Jul 15 19:50:50 you probably need hex to string conversion Jul 15 19:51:07 try using hexdump Jul 15 19:51:11 I think the problem is with ioread and iowrite functions Jul 15 19:53:07 And m_w the .dwo files keep on piling in my folder. To add it to gitignore I should simply add *.dwo to it right? Jul 15 19:53:49 pretty much Jul 15 19:56:29 so how do I use hexdump? Jul 15 19:56:32 m_w, ? Jul 15 19:57:00 I need to hexdump cat spi-pru-device right? Jul 15 19:57:04 hexdump -C /dev/spi_whatever_the_node_is_called Jul 15 19:57:55 00000000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................| Jul 15 19:57:59 I got this m_w Jul 15 20:03:11 There is nothing written right in the memory right m_w ? Jul 15 20:03:40 what memory? Jul 15 20:04:30 I am confused as to what does hexdump thing does m_w . Jul 15 20:05:35 0x0a is '\n' Jul 15 20:06:17 hexdump just shows file in any user defined format right m_w ? Jul 15 20:06:20 it just prints raw hex in readable form Jul 15 20:07:26 try it on a text file and you should see what it is doing Jul 15 20:07:59 so what does the above output mean m_w ? Jul 15 20:08:00 Okay Jul 15 20:09:11 it means that your drivers read function is returning 0x0a Jul 15 20:09:34 chanakya_vc: have you committed your latest code? Jul 15 20:10:48 Nope Just give me a sec m_w Jul 15 20:13:38 m_w, Done Jul 15 20:13:49 Please check Jul 15 20:20:01 okay Jul 15 20:20:31 what is 0x4a310000? Jul 15 20:21:27 https://github.com/chanakya-vc/PRU-I2C_SPI_master/blob/wip_on_spi/Driver/pru-spi.c#L91 Jul 15 20:22:23 m_w, Okay this is a point of confusion for me too. This is the global address of the internal shared ram of the PRU-ICSS Jul 15 20:22:45 This is what is seen by arm processor. Jul 15 20:23:23 sure okay and where in your PRU firmware does it write this memory? Jul 15 20:25:13 Yes m_w , I haven't written that function. But when we are echoing something to that address and then reading the same memory from the driver Jul 15 20:25:41 It should show that value that we wrote right Jul 15 20:25:59 Basically this address block behaves as my SPI-shift register Jul 15 20:26:10 okay Jul 15 20:26:23 then it does make sense Jul 15 20:26:50 you are using echo to send to the write function Jul 15 20:27:08 m_w, You know I am not too sure about this address myself. Abhishek_ had pointed me to a place in pru_rproc where I saw this. Jul 15 20:27:11 \n is the last character that is sent Jul 15 20:27:34 Give me 5 minutes, I will get you that line. Jul 15 20:30:02 echo -e "6" > /dev/spi_whatever_the_node_is_called Jul 15 20:30:19 hexdump -C /dev/spi_whatever_the_node_is_called Jul 15 20:32:29 m_w, The same output Jul 15 20:32:32 :( Jul 15 20:32:41 echo -ne "6" > /dev/spi_whatever_the_node_is_called Jul 15 20:32:44 hexdump -C /dev/spi_whatever_the_node_is_called Jul 15 20:34:25 got this : Jul 15 20:34:26 00000000 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 |6666666666666666| Jul 15 20:34:29 m_w, ^^ Jul 15 20:34:36 understand now? Jul 15 20:34:54 what does -ne mean? Jul 15 20:34:56 m_w, ? Jul 15 20:35:21 no \n is echo'd at the end of the line Jul 15 20:35:48 so the last character is 6 hence the repeated 6s Jul 15 20:36:50 Okay got it, but here we are not sending in 6 but char 6? Jul 15 20:36:52 m_w, ? Jul 15 20:37:23 yes Jul 15 20:38:04 So in the driver I would have to convert the 6 right, I mean from char to int? m_w Jul 15 20:38:18 yup Jul 15 20:38:53 ascii to binary Jul 15 20:39:24 Okay so iowrite and ioread are working because the read function is working. But what I don't understnd is why 6 as an int is not working? Jul 15 20:39:38 m_w, ? Jul 15 20:39:42 Any idea? Jul 15 20:40:43 http://lxr.free-electrons.com/source/lib/hexdump.c#L47 Jul 15 20:41:01 you are sending a string not a number Jul 15 20:49:21 echo -ne "\x06" > /dev/spi_whatever_the_node_is_called Jul 15 20:49:28 hexdump -C /dev/spi_whatever_the_node_is_called Jul 15 20:50:50 00000000 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 |................| Jul 15 20:50:53 m_w, ^ Jul 15 20:51:01 But here why the .? Jul 15 20:51:59 because 06 is not a printable character Jul 15 20:52:22 http://www.asciitable.com/ Jul 15 21:03:41 okay m_w . Jul 15 21:36:35 m_w, In my code I don't think I need to convert stuff to int. Jul 15 21:37:02 because whatever we send can be send Jul 15 21:37:06 *string Jul 15 21:38:02 it is up to you Jul 15 21:38:05 And in any case if I wanted to send I will have to send it according to the ascii tables Jul 15 21:38:52 Can you test the firmware +code if you are free? Jul 15 21:38:54 m_w, ? Jul 15 21:38:58 it would probably be easier with a small C program instead of echo Jul 15 21:39:10 the firmware changed? Jul 15 21:39:27 the firmware has a function to read from the mem locations Jul 15 21:39:29 m_w, Jul 15 21:39:38 I didn't put miso that's it Jul 15 21:40:20 yup just clone the repo Jul 15 21:40:22 mm Jul 15 21:40:24 m_w, Jul 15 21:41:03 I have a pointer to the local mem address that takes a value from that address Jul 15 21:41:50 export PRU_CGT=/path/to/ti_pru/cgt/folder Jul 15 21:42:01 make Jul 15 21:42:07 Same process to scp it to the /lib/firmware/am335x-pru0-fw Jul 15 21:42:12 config-pin P8_11 pruout Jul 15 21:42:21 config-pin P8_12 pruout Jul 15 21:42:29 cd Driver Jul 15 21:42:36 make ARCH=arm CROSS_COMPILE=/path/to/cross/compiler -C '/parth/to/kernel/source' M=$PWD Jul 15 21:42:42 scp this to any location on the bbb and then sudo insmod pru-spi.c Jul 15 21:42:53 okay it is going to take a minute Jul 15 21:43:00 Np m_w Jul 15 21:43:08 pru_spi.ko Jul 15 21:44:51 then sudo su root Jul 15 21:54:36 not sure how this firmware will work Jul 15 21:56:26 The address is local to PRU-ICSS memory. Jul 15 21:56:28 it will only transfer once when it is first loaded and then halt Jul 15 21:56:46 Yup that's what I want to test. Jul 15 21:56:50 Right now m_w Jul 15 21:56:59 I will put in a blocking loop Jul 15 21:57:10 And then put the entire code in loop Jul 15 21:57:29 At least that's what I have thought so far m_w Jul 15 21:58:54 are you sure the PRUs shared RAM is not cleared when it is first initialized? Jul 15 21:59:55 hmmn , hadn't thought of that. Jul 15 21:59:59 might be. Jul 15 22:00:12 m_w, Jul 15 22:00:54 well I would update the firmware such that more than one transaction can occur before the PRU is halted Jul 15 22:01:57 Okay m_w . I am not really sure how to do that. Should I put the entire thing in while(1) loop Jul 15 22:02:18 I just want to know whether it is picking up the data or not Jul 15 22:04:11 lemme verify Jul 15 22:14:58 Okay m_w . I just hope it does. Jul 15 22:21:13 okay Jul 15 22:21:50 I added a while(1) to the firmare so that it repeats over and over Jul 15 22:22:24 then I loaded the driver echo started echoing values Jul 15 22:22:47 the waveform chages according to the last echo Jul 15 22:22:59 so it is working ? : ) Jul 15 22:23:21 m_w, Can you upload any one pic m_w ? Jul 15 22:23:43 I will make a short video Jul 15 22:24:09 That would be wonderful : ) Jul 15 22:24:19 m_w, Thank you so very much!!!! Jul 15 22:37:23 will post it to my google+ Jul 15 22:38:10 it is uploading now Jul 15 22:41:15 Okay m_w !. I will share it on my fb account then.. Jul 15 22:42:05 Although I have come to realize that google+ is much better than fb in many cases. Jul 15 22:45:50 https://plus.google.com/+MichaelWelling79/posts/9feQenhHbbV Jul 15 22:46:21 the video quality is not great Jul 15 22:48:47 shot with iphone? Jul 15 22:49:05 eyephone Jul 15 22:49:42 tried recordmydesktop? Jul 15 22:50:19 that doesn't run on my oscilloscope :) Jul 15 22:51:47 m_w, Recording seems great! Jul 15 22:51:56 The yellow line is clock right? Jul 15 22:52:05 yup Jul 15 22:52:39 Looks great. I had been stuck on this very piece of code for about three weeks Jul 15 22:52:56 you want a patch to see how I changed the firmware code? Jul 15 22:52:56 time to get an open source scope i guess... Jul 15 22:53:19 just reformatted with Lindent and added a while(1) loop Jul 15 22:53:19 I didn't get why did you echo jshdfsdf in the beginning Jul 15 22:53:42 Yup a pull request would be great! Jul 15 22:54:00 I did not fork the code Jul 15 22:54:15 ohh.. Jul 15 22:54:32 you know how to apply a patch manually? Jul 15 22:54:34 what is this lindent thing? Jul 15 22:54:52 No I can google that though Jul 15 22:55:10 well it fixes the formatting of your C file so that I can read it Jul 15 22:55:45 you should probably do this on your other code too Jul 15 22:56:18 Okay m_w . I think I will do this on my own on my code Jul 15 22:57:05 Also why does the code in hex begin with \ ? Jul 15 22:57:20 I get the x but why a backslash? Jul 15 22:57:23 m_w, ? Jul 15 22:59:07 that is the start of a special character Jul 15 23:01:04 Ohh got it m_w Jul 15 23:01:53 Now I just have to transfer this code into an spi based driver. I think it won't much time, since I have the basic logic working Jul 15 23:01:55 m_w, Jul 15 23:02:07 sure Jul 15 23:02:35 you need to add miso and chip select support Jul 15 23:02:40 in the firmware Jul 15 23:02:52 maybe add some control registers Jul 15 23:02:57 Yup I will do that. firmware 2.0 Jul 15 23:03:01 :P Jul 15 23:03:40 better get going on it, only a month left Jul 15 23:04:04 m_w, I am definitely behind my schedule Jul 15 23:04:13 This took me a lot of time Jul 15 23:04:26 I did not anticipate that it would. Jul 15 23:05:14 anyway m_w will you be here over the weekend? Jul 15 23:05:39 on and off Jul 15 23:06:00 Okay maybe I will mail you when I have done all the changes. m_w Jul 15 23:06:10 I like to get out of the house on the weekend because I work from home Jul 15 23:06:29 you want the patch or not? Jul 15 23:06:36 You work from home. That is awesome. Jul 15 23:06:55 I am not sure how you are going upload it. Jul 15 23:06:57 But yes Jul 15 23:07:47 perhaps email Jul 15 23:08:13 Yeah that would be great. I can see the code and maybe do the changes myself Jul 15 23:08:37 You would have my id right? Jul 15 23:09:00 I could look it up Jul 15 23:09:14 or you could send me an email Jul 15 23:09:20 and I can reply to it Jul 15 23:09:27 Yeah I will just do that right now. Jul 15 23:11:44 Sent you. Jul 15 23:11:54 Twice actually, one was by mistake Jul 15 23:14:46 okay, apply the patch, commit, and push Jul 15 23:15:03 I will check it on your github repo when you are done Jul 15 23:15:47 can I do it tomorrow m_w ? I am feeling very sleepy Jul 15 23:17:01 Although seems to be a very small procedure Jul 15 23:18:25 it is Jul 15 23:33:04 m_w, Done Jul 15 23:33:24 * chanakya_vc laptop hangs up a lot these days. Jul 15 23:34:43 And m_w , How do you lindent things? Jul 15 23:36:00 Don't editors like sublime do them automaticaly for you? Jul 15 23:36:20 Lindent is basically indenting the code right? Jul 16 00:06:11 yet another useful intro to dt/overlays => http://www.circuidipity.com/bbb-dt.html Jul 16 00:25:20 nice one nerdboy Jul 16 00:34:14 kinda old, but answers a question about the adc dt overlay **** ENDING LOGGING AT Sat Jul 16 02:59:58 2016