www.8devices.com
View unanswered posts | View active topics It is currently 23 Oct 2014, 05:51



Reply to topic  [ 5 posts ] 
 Using Carambola 2 serial port for connecting external device 
Author Message

Joined: 18 Nov 2013, 18:44
Posts: 40
Hi, has anybody disabled serial console on Carambola 2 and used serial port for connecting external devices?

I thought also about bitbanging serial port over gpio pins, but see that there is no gpio serial driver for bitbanging. Then I found this interesting article and which explains how it is possible to use SPI pins as serial port:
http://raspberrypi.stackexchange.com/qu ... ample-code


19 Apr 2014, 17:28
Profile

Joined: 21 Aug 2013, 21:21
Posts: 83
valent wrote:
...

step 1 - If You # out the line "::askconsole:/bin/ash --login" or similar (ttyS0/ttyATH0 might be included) in /etc/inittab, then You can use the port as input at default 115200 baud, but kernel messages like connected / disconnected wired devices and several other message and uboot/bootlog will still appear on it, so its not ideal as output.

step 2 - To remove kernel messages, You should play with conloglevel and kconloglevel in Luci>System>Logging - i dont remember, wich value makes it silent

step 3 - But uboot and bootlog will still appear on it, so You have to take care about it! And if You send any garbage character to serial port during uboot, then You might break the boot and enter to uboot or failsafe command line... To remove the bootlog, You should re-compile the whole openwrt with disabled kernel console options in kernel hacking menu and char devices menu too.

step 4 - Then only the uboot remains on every bootup > to disable it, You have to modify and recompile the uboot too - but its very risky due to You will have no failsafe option anymore, You need to desolder the flash and write it with external device to restore the system in a fatal case!

So the best solution would be to remove console and kernel messages from it (first 2 steps) and use an additional GPIO pin to control the external device:
- if its a uC, GPS or similar, then You can keep it in reset until the boot is ready and there is no more activity on serial port
- if its a different external device, then You can use a logical AND gate to filter every noise from output and input until bootup

OR

You can use an SPI/I2C serial port expander or USB>serial adapter...


05 May 2014, 16:13
Profile

Joined: 11 Mar 2012, 18:42
Posts: 18
FPeter wrote:
[...]
step 4 - Then only the uboot remains on every bootup > to disable it, You have to modify and recompile the uboot too - but its very risky due to You will have no failsafe option anymore, You need to desolder the flash and write it with external device to restore the system in a fatal case!
[...]

https://github.com/pepe2k/u-boot_mod :)


09 May 2014, 16:00
Profile

Joined: 18 Nov 2013, 18:44
Posts: 40
Thanks to both!


09 May 2014, 16:06
Profile

Joined: 21 Aug 2013, 21:21
Posts: 83
pepe2k wrote:
FPeter wrote:
[...]
step 4 - Then only the uboot remains on every bootup > to disable it, You have to modify and recompile the uboot too - but its very risky due to You will have no failsafe option anymore, You need to desolder the flash and write it with external device to restore the system in a fatal case!
[...]

https://github.com/pepe2k/u-boot_mod :)

ohhh, i forgot it, but i already used it on several MR3020 boards when i upgraded their flash to 16MB! Very nice job, thanks!


09 May 2014, 17:23
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Yahoo [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.