[beagleboard] Re: Programming an arduino remotely using UART4 on the BeagleBone Black

2014-08-18 Thread shadowsor
I should add that I am running the arduino at 3.3v, and directly connecting 
the bbb pins. This seems to be how you are doing it as well, though talk of 
the FTDI port had me confused for a second as mine doesn't have one.

On Sunday, December 15, 2013 12:51:12 AM UTC-7, Thorsten von Eicken wrote:
>
> I've been wanting to combine my BBB with my Arduino hacking, specifically, 
> I like to be able to program my arduinos remotely and the BBB seemed like 
> the right tool for that. For example, right now I have an arduino clone (a 
> JeeNode ) attached to 
> my weather station sensors up on the hill and it's really nice to be able 
> to sit inside in the evening and iterate on the arduino weather station 
> code, being able to upload one code iteration after the other with just a 
> few keystrokes. I also like to keep all my source code and compilation on 
> my fast linux server in the basement and that's not near any arduino...
>
> What I wanted out of the BBB is a serial port with a DTR to program the 
> arduino that doesn't use the USB host port so I could use the USB port for 
> a wifi dongle. After way too many hours I finally realized that there is no 
> UART on the BB that has a usable DTR pin! The DTR pin is necessary to reset 
> the arduino so a fresh sketch can be uploaded. So I did some foolin' around 
> and eventually discovered that I could use RTS as a substitute for DTR. 
> That was the key to hooking up the arduino clone to the BBB and programming 
> it (quick warning here: the JeeNode operates on 3.3v so I can hook it up 
> straight to the BBB but if you're using a std arduino you need level 
> shifters to deal with the 5v vs. 3.3v logic levels!).
>
> The second part is the remote programming. I could edit and compile on the 
> BBB sitting up nexy to the weather station arduino but that's not my cup of 
> tea. I edit my sketches on my linux box with vi and then use a Makefile to 
> compile, upload, and connect to the arduino console. If you're using the 
> IDE you will have to tweak things a bit. The solution I came up with is to 
> run ser2net on the BBB, which is a daemon that accepts TCP connections over 
> the network and "connects them through" to a serial port. It turns out that 
> avrdude, the program used to upload sketches to the arduino can send the 
> data to a remote TCP port. Sounds like a match!
>
> So now come all the steps to make the above happen. If you just want to 
> program arduino from your BBB you just need the serial port part. If you're 
> using a USB serial dongle you just need the ser2net part. In other words, 
> you may not want exactly the same set-up as I have but I hope my 
> description helps you get there.
>
> Step 1: disable HDMI
> I decided to use UART4 because the pins conflict with HDMI, which I don't 
> need since the BBB is far away from me. You could use UART1 just as easily 
> with a few tweaks, then you don't need to do step 1. The nice thing about 
> UART1 is that all the pins are on the P9 connector. Mhhh, maybe I should 
> indeed switch to that...
>
> You will need to add a device tree overlay to your BBB to enable UART4 
> with RTS and you will need to disable the HDMI device trees (you don't need 
> to do the latter if you're using UART1). To disable HDMI run the following 
> shell commands as root (I'm using Ubuntu but I believe these work the same 
> on Angstrom):
> mkdir /mnt/card; mount /dev/mmcblk0p1 /mnt/card
> sed -i -e '/^optargs/ s/$/ capemgr.disable_partno=BB-
> BONELT-HDMI,BB-BONELT-HDMIN/' /mnt/card/uEnv.txt
> grep optargs /mnt/card/uEnv.txt
> You should see something like this:
> optargs=fixrtc capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
> Reboot your BBB so it comes up without HDMI (I'm assuming your logged in 
> remotely).
>
> Step 2: enable RTS on UART4
> Now comes the device tree overlay for the UART. Download the 
> attached BB-UART4-RTS-00A0.dtbo compiled tree or compile your own version 
> from the attached source in BB-UART4-RTS.dts. You can find other overlays 
> on the web to enable RTS on other uarts. Copy the dtbo file into 
> /lib/firmware and then run:
> echo BB-UART4-RTS >/sys/devices/bone_capemgr.*/slots
> dmesg | tail
> cat /proc/tty/driver/OMAP-SERIAL
> You should see something like this:
> [   96.571871] bone-capemgr bone_capemgr.9: part_number 'BB-UART4-RTS', 
> version 'N/A'
> [   96.572057] bone-capemgr bone_capemgr.9: slot #7: generic override
> [   96.572106] bone-capemgr bone_capemgr.9: bone: Using override eeprom 
> data at slot 7
> [   96.572156] bone-capemgr bone_capemgr.9: slot #7: 'Override Board 
> Name,00A0,Override Manuf,BB-UART4-RTS'
> [   96.572424] bone-capemgr bone_capemgr.9: slot #7: Requesting part 
> number/version based 'BB-UART4-RTS-00A0.dtbo
> [   96.572477] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware 
> 'BB-UART4-RTS-00A0.dtbo' for board-name 'Override Board Name', version 
> '00A0'
> [   96.584137] bone-capemgr bone_

[beagleboard] Re: Programming an arduino remotely using UART4 on the BeagleBone Black

2014-08-18 Thread shadowsor
This is very helpful. I've been playing around with it a bit and have had 
some trouble getting it to respond, however. Avrdude says:

 Using Port: /dev/ttyO4
 Using Programmer  : arduino
 Overriding Baud Rate  : 115200
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

I've got pin 11 on the BBB to 'D0' on the arduino, and pin 13 to D1, then 
the RTS pin on BBB to RESET on arduino. I've tried that, and through a 10nF 
capacitor, the difference being that the latter performs a momentary reset, 
while the former freezes the arduino through the duration of the avrdude 
command. The current sketch on the arduino is an LED string test, so I can 
easily see when the Arduino resets or freezes. I have tested the ttyO4 
against ttyO1, and it seems to work fine, so I am left wondering if certain 
Arduino bootloaders don't allow serial programming (???).

On Sunday, December 15, 2013 12:51:12 AM UTC-7, Thorsten von Eicken wrote:
>
> I've been wanting to combine my BBB with my Arduino hacking, specifically, 
> I like to be able to program my arduinos remotely and the BBB seemed like 
> the right tool for that. For example, right now I have an arduino clone (a 
> JeeNode ) attached to 
> my weather station sensors up on the hill and it's really nice to be able 
> to sit inside in the evening and iterate on the arduino weather station 
> code, being able to upload one code iteration after the other with just a 
> few keystrokes. I also like to keep all my source code and compilation on 
> my fast linux server in the basement and that's not near any arduino...
>
> What I wanted out of the BBB is a serial port with a DTR to program the 
> arduino that doesn't use the USB host port so I could use the USB port for 
> a wifi dongle. After way too many hours I finally realized that there is no 
> UART on the BB that has a usable DTR pin! The DTR pin is necessary to reset 
> the arduino so a fresh sketch can be uploaded. So I did some foolin' around 
> and eventually discovered that I could use RTS as a substitute for DTR. 
> That was the key to hooking up the arduino clone to the BBB and programming 
> it (quick warning here: the JeeNode operates on 3.3v so I can hook it up 
> straight to the BBB but if you're using a std arduino you need level 
> shifters to deal with the 5v vs. 3.3v logic levels!).
>
> The second part is the remote programming. I could edit and compile on the 
> BBB sitting up nexy to the weather station arduino but that's not my cup of 
> tea. I edit my sketches on my linux box with vi and then use a Makefile to 
> compile, upload, and connect to the arduino console. If you're using the 
> IDE you will have to tweak things a bit. The solution I came up with is to 
> run ser2net on the BBB, which is a daemon that accepts TCP connections over 
> the network and "connects them through" to a serial port. It turns out that 
> avrdude, the program used to upload sketches to the arduino can send the 
> data to a remote TCP port. Sounds like a match!
>
> So now come all the steps to make the above happen. If you just want to 
> program arduino from your BBB you just need the serial port part. If you're 
> using a USB serial dongle you just need the ser2net part. In other words, 
> you may not want exactly the same set-up as I have but I hope my 
> description helps you get there.
>
> Step 1: disable HDMI
> I decided to use UART4 because the pins conflict with HDMI, which I don't 
> need since the BBB is far away from me. You could use UART1 just as easily 
> with a few tweaks, then you don't need to do step 1. The nice thing about 
> UART1 is that all the pins are on the P9 connector. Mhhh, maybe I should 
> indeed switch to that...
>
> You will need to add a device tree overlay to your BBB to enable UART4 
> with RTS and you will need to disable the HDMI device trees (you don't need 
> to do the latter if you're using UART1). To disable HDMI run the following 
> shell commands as root (I'm using Ubuntu but I believe these work the same 
> on Angstrom):
> mkdir /mnt/card; mount /dev/mmcblk0p1 /mnt/card
> sed -i -e '/^optargs/ s/$/ capemgr.disable_partno=BB-
> BONELT-HDMI,BB-BONELT-HDMIN/' /mnt/card/uEnv.txt
> grep optargs /mnt/card/uEnv.txt
> You should see something like this:
> optargs=fixrtc capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
> Reboot your BBB so it comes up without HDMI (I'm assuming your logged in 
> remotely).
>
> Step 2: enable RTS on UART4
> Now comes the device tree overlay for the UART. Download the 
> attached BB-UART4-RTS-00A0.dtbo compiled tree or compile your own version 
> from the attached source in BB-UART4-RTS.dts. You can find other overlays 
> on the web to enable RTS on other uarts. Copy the dtbo file into 
> /lib/firmware and then run:
> echo BB-UART4-RTS >/sys/devices/bone_capemgr.*/slots
> dmesg | tail
> c

[beagleboard] Re: Programming an arduino remotely using UART4 on the BeagleBone Black

2014-08-18 Thread shadowsor
I have also verified with a simple serial sketch that bidirectional 
communication works between the bbb and arduino in this wiring scheme. It 
just doesn't seem that avrdude wants to speak over it, or isn't 
communicating with the bootloader on reset.

On Sunday, December 15, 2013 12:51:12 AM UTC-7, Thorsten von Eicken wrote:
>
> I've been wanting to combine my BBB with my Arduino hacking, specifically, 
> I like to be able to program my arduinos remotely and the BBB seemed like 
> the right tool for that. For example, right now I have an arduino clone (a 
> JeeNode ) attached to 
> my weather station sensors up on the hill and it's really nice to be able 
> to sit inside in the evening and iterate on the arduino weather station 
> code, being able to upload one code iteration after the other with just a 
> few keystrokes. I also like to keep all my source code and compilation on 
> my fast linux server in the basement and that's not near any arduino...
>
> What I wanted out of the BBB is a serial port with a DTR to program the 
> arduino that doesn't use the USB host port so I could use the USB port for 
> a wifi dongle. After way too many hours I finally realized that there is no 
> UART on the BB that has a usable DTR pin! The DTR pin is necessary to reset 
> the arduino so a fresh sketch can be uploaded. So I did some foolin' around 
> and eventually discovered that I could use RTS as a substitute for DTR. 
> That was the key to hooking up the arduino clone to the BBB and programming 
> it (quick warning here: the JeeNode operates on 3.3v so I can hook it up 
> straight to the BBB but if you're using a std arduino you need level 
> shifters to deal with the 5v vs. 3.3v logic levels!).
>
> The second part is the remote programming. I could edit and compile on the 
> BBB sitting up nexy to the weather station arduino but that's not my cup of 
> tea. I edit my sketches on my linux box with vi and then use a Makefile to 
> compile, upload, and connect to the arduino console. If you're using the 
> IDE you will have to tweak things a bit. The solution I came up with is to 
> run ser2net on the BBB, which is a daemon that accepts TCP connections over 
> the network and "connects them through" to a serial port. It turns out that 
> avrdude, the program used to upload sketches to the arduino can send the 
> data to a remote TCP port. Sounds like a match!
>
> So now come all the steps to make the above happen. If you just want to 
> program arduino from your BBB you just need the serial port part. If you're 
> using a USB serial dongle you just need the ser2net part. In other words, 
> you may not want exactly the same set-up as I have but I hope my 
> description helps you get there.
>
> Step 1: disable HDMI
> I decided to use UART4 because the pins conflict with HDMI, which I don't 
> need since the BBB is far away from me. You could use UART1 just as easily 
> with a few tweaks, then you don't need to do step 1. The nice thing about 
> UART1 is that all the pins are on the P9 connector. Mhhh, maybe I should 
> indeed switch to that...
>
> You will need to add a device tree overlay to your BBB to enable UART4 
> with RTS and you will need to disable the HDMI device trees (you don't need 
> to do the latter if you're using UART1). To disable HDMI run the following 
> shell commands as root (I'm using Ubuntu but I believe these work the same 
> on Angstrom):
> mkdir /mnt/card; mount /dev/mmcblk0p1 /mnt/card
> sed -i -e '/^optargs/ s/$/ capemgr.disable_partno=BB-
> BONELT-HDMI,BB-BONELT-HDMIN/' /mnt/card/uEnv.txt
> grep optargs /mnt/card/uEnv.txt
> You should see something like this:
> optargs=fixrtc capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
> Reboot your BBB so it comes up without HDMI (I'm assuming your logged in 
> remotely).
>
> Step 2: enable RTS on UART4
> Now comes the device tree overlay for the UART. Download the 
> attached BB-UART4-RTS-00A0.dtbo compiled tree or compile your own version 
> from the attached source in BB-UART4-RTS.dts. You can find other overlays 
> on the web to enable RTS on other uarts. Copy the dtbo file into 
> /lib/firmware and then run:
> echo BB-UART4-RTS >/sys/devices/bone_capemgr.*/slots
> dmesg | tail
> cat /proc/tty/driver/OMAP-SERIAL
> You should see something like this:
> [   96.571871] bone-capemgr bone_capemgr.9: part_number 'BB-UART4-RTS', 
> version 'N/A'
> [   96.572057] bone-capemgr bone_capemgr.9: slot #7: generic override
> [   96.572106] bone-capemgr bone_capemgr.9: bone: Using override eeprom 
> data at slot 7
> [   96.572156] bone-capemgr bone_capemgr.9: slot #7: 'Override Board 
> Name,00A0,Override Manuf,BB-UART4-RTS'
> [   96.572424] bone-capemgr bone_capemgr.9: slot #7: Requesting part 
> number/version based 'BB-UART4-RTS-00A0.dtbo
> [   96.572477] bone-capemgr bone_capemgr.9: slot #7: Requesting firmware 
> 'BB-UART4-RTS-00A0.dtbo' for board-name 'Override Board Name', version 
> '00A0'
> [  

Re: [beagleboard] Re: CAUTION: musb: Babble Interrupt Occurred

2014-08-11 Thread shadowsor
Anyone know about the patch referenced here? Or any other workaround to make 
USB usable on BBB?

http://comments.gmane.org/gmane.linux.usb.general/87138

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.