[HOW-TO]Set up a Captivate for Samsung Bootloader Development - Hardware Hacking General

OK, there's been quite a few unanswered questions on bootloader development.. I didn't want to clutter the Make your Own Bootloader thread with hardware stuff. I didn't want to clutter up the UnBrickable Mod thread with Bootloader development setup stuff. UnBrickable mod will be a one-stop shop thread for the Captivate eventually.
Introduction
This thread will get you started with bootloader development speciffic to the captivate, however the same techniques work on all GalaxyS devices with an adjustment to the RX/TX locations
We need to delve into the hardware, remove a resistor, attach a wire, and bring two wires outside of the phone. This is quite a bit more difficult then the typical UART over USB connection which we have used in the past. For bootloader development the UART Output described in this video will not work..
The external UART output with a 619Kohm jig between pins 4 and 5, monitoring 115200 8N1 serial output between pins 2 and 3 will not work because the USB hardware is initialised by the bootloaders. In order to test the bootloaders you are developing, you must go to a lower level.
Note:While the UART output in the video will not work for Bootloader development, itis absolutely unbeatable for Kernel level debug on nearly all Samsung devices.
Getting Started
You will need:
1. UnBrickable modded captivate (or other device)
2. A UART device (Android Acessory Development kit or Arduino Mega or a Bus Pirate or any other UART device)
3. A Soldering Iron
4. Flux
5. Solid core wire
6. A relay (For the wire contained within)
7. A Linux computer (get Ubuntu here and dual boot, or run in a virtual machine)
Instructions
1. Apply the UnBrickable Mod to your Samsung Captivate. See Here: http://forum.xda-developers.com/showthread.php?t=1206216
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
2. Next we need to connect a relay wire to the internal JTAG UART points. We cannot use the external UART via USB as we have seen in the past for writing bootloaders because the chip which handles switching for UART has not been initialized yet. We need to go directly to the source off of the processor. You can connect to the internal JTAG UART RX and TX lines here on the JTAG pads:
Using the JTAG header, you can connect to these points using this header: http://www.mouser.com/ProductDetail/Panasonic/AXT612124/?qs=2rFUEsTwVNwSdqVM5XnLHw==
and this Receptical: http://www.mouser.com/ProductDetail/Panasonic/AXT512124/?qs=2rFUEsTwVNy9TGVyeT43Dg==
They can be connected directly, or you can use a board from a guy named "K-WW" on the Hackaday.com forums
Here is a picture of my JTAG connector... This is optional and you will likely want to run wires directly for this project.
Alternately you can get these same points here, next to the processor:
3. Once you have the wires connected to the board, technically you're done and you can now connect up to your Android using your UART Device of choice. I decided to go the extra step and run those small wires to some solid core wire I bent and melted into the phone's case.
The further one is RX and the closer one is TX. Using this low point allows me to close up the device properly and I can still use my SDCard slot.
4. To do some debugging you can connect your Arduino at 8N1 using the same code from the video above...
Code:
void setup() {
// initialize both serial ports:
Serial.begin(115200);
Serial1.begin(115200);
}
void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.print(inByte, BYTE);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial1.print(inByte, BYTE);
}
}
Or connect the Bus Pirate up to the device using the following options in a terminal:
Code:
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
9. DIO
x. exit(without change)
(1)>3
Set serial port speed: (bps)
1. 300
2. 1200
3. 2400
4. 4800
5. 9600
6. 19200
7. 38400
8. 57600
9. 115200
10. BRG raw value
(1)>9
Data bits and parity:
1. 8, NONE *default
2. 8, EVEN
3. 8, ODD
4. 9, NONE
(1)>1
Stop bits:
1. 1 *default
2. 2
(1)>1
Receive polarity:
1. Idle 1 *default
2. Idle 0
(1)>1
Select output type:
1. Open drain (H=Hi-Z, L=GND)
2. Normal (H=3.3V, L=GND)
(1)>2
Ready
UART>
4. Next you need some firmware. There is firmware in the Captivate Development Platform thread, and there is some in the Create Your Own bootloaders thread You can create your own.
5. In order to debug the firmware it has to be uploaded. You can use the SMDK Download tool attached in this post. Uncompress to your desktop
6. To prepare the phone for debug, remove the battery, insert the battery attach USB and run the following program in a new terminal (not the one you are monitoring USB Output)
Upon plugging in the USB, you should see
Code:
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Uart negotiation Error
Then you execute this in a new window
Code:
sudo ~/Desktop/dltool/smdk-usbdl -f ~/Desktop/dltool/s5pc110_test/s5pc110_sbl_loader.bin -a D0020000
you will see this in the same window
Code:
SMDK42XX,S3C64XX USB Download Tool
Version 0.20 (c) 2004,2005,2006 Ben Dooks <[email protected]>
S3C64XX Detected!
=> found device: bus 002, dev 011
=> loaded 24576 bytes from /home/adam/Desktop/dltool/s5pc110_test/s5pc110_sbl_loader.bin
=> Downloading 24586 bytes to 0xd0020000
=> Data checksum ffb7
=> usb_bulk_write() returned 24586
[email protected]:~$
And upon upload of the primitive bootloader, you will see this in the UART window
Code:
Welcome to the S5PC110 resurrector by Rebellos!
Calling SGS IBL Stage2, pray so it wont hang...
DONE!
Testing if BL3 area is R/W
DONE!
Please prepare USB dltool with BL3 (SBL)
Starting downloader in...
9
8
7
6
5
4
3
2
1
0
7. Unplug the USB cable. As soon as the USB cable is removed all executing commands stop and the device awaits you to push the power on button.
Some notes:
PBL execution automatically occurs at 0xD002000 (this is with a 0x10 signature in front so the actual code begins at 0xD002010)
SBL is in DRAM at 0x40244000
Conclusion
So, there you have it. This is how to set up your Captivate to be a bootloader development kit. You don't have to develop a bootloader to load it up using this method.. You can simply stop at step 1 of this guide, UnBrickable mod, and be able to test results without UART output.
If anyone would like to give me one of the following devices' mainboard I will make a UnBrickable Mod/Development Platform for each device.
Samsung Devices: I9000 S8500, S8530, SGH-897, SGH-i896, SGH-i997, T959, SGH-T849, GT-P1000, GT-i9010, GT-i8350, GT-I917
Google Nexus S, Odroid T,
Apple iPhone4
Any new Samsung WP7
Further reading
Create your own bootloader: http://forum.xda-developers.com/showthread.php?t=1233273
The Captivate Development Platform: http://forum.xda-developers.com/showthread.php?t=1206216
Lets save some bricks: http://forum.xda-developers.com/showthread.php?t=1018862

Samsung Infuse (SGH-i997) Owners:
We've got it much easier when it comes to the JTAG header. As you can see in the picture below, the header is already attached to the PCB, and all we need is the connector board from "K-WW".
The large metallic thing on the left is the SIM card slot. The connector for the display (at the bottom of the picture) might be in the way. If it isn't we'll be able to connect to the JTAG and UART2 ports without doing any soldering or even disconnecting a single cable on the device.
We need someone to donate an Infuse to AdamOutler. He needs to remove the processor from the PCB to be able to find the xOM5 pad. This means destroying the phone, so it doesn't matter what the condition is. If it's bricked with a smashed screen and water damage, it doesn't matter! If you can help us with this, please speak up on this thead: http://forum.xda-developers.com/showthread.php?t=1221064

You don't NEED the board. The receptical itself with wires attached will attach to the header and you could close up the device with it attached. With the socket breakout board, the device would need to remain open. I would be searching for alternate UART points as well so the JTAG header would remain available.
Like I said.... I need device mainboards... they need not work. I'm not gaining anything directly from this except fruits of firmware development.... alternate OSs and open source bootloaders

Or, try to find 5 OM resistors while phone is being powered up.
3 should be 100.3kOhm resistance and connected to GND
2 should be ~10.1kOhm resistance and connected to VCC PDA (most likely exactly 2.8V, but 1.8V and similiar is also possible option)
These should be in row, or close to itselves. Then all whats left is guessing which one of the 3 is OM5. By some dangerous tests most likely, but with much smaller risk of damaging the board, comparing to complete CPU teardown.

aww dude, that's awesome....will try to do some of it on my cappy ; )

Rebellos said:
Or, try to find 5 OM resistors while phone is being powered up.
3 should be 100.3kOhm resistance and connected to GND
2 should be ~10.1kOhm resistance and connected to VCC PDA (most likely exactly 2.8V, but 1.8V and similiar is also possible option)
These should be in row, or close to itselves. Then all whats left is guessing which one of the 3 is OM5. By some dangerous tests most likely, but with much smaller risk of damaging the board, comparing to complete CPU teardown.
Click to expand...
Click to collapse
On my device, all resistors are 100.3kohm.

how to send the MB or how to fix my bricked phone GT-i8350

Adam,
I've been staring at this document, the picture of the infuse and the sgh-t959v pictures from ifixit for a while and finally got the gumption to try finding the internal uart. Big thanks for this picture:
AdamOutler said:
You can connect to the internal JTAG UART RX and TX lines here on the JTAG pads:
Click to expand...
Click to collapse
SGH-T959V Internal Uart thread.
Thanks again for all you do for the community!
-Bryan

Related

Thinking of performing a hardware mod for USB hosted microsd/bluetooth(Kindle Fire)

Ok, so i'm ordering a replacement digitizer and I figure this would be a good time to try this out.
As you all know, we Kindle Fire owners have neither expandable storage or bluetooth. Hashcode's new 3.0 kernel has the proper kernel modules/support for USB hosting. Instead of having to plug things in every time I need/want extra storage I figure that i'll try and hook up the stuff inside.
So here's what I figure i'll do when I get all the materials:
I already have a mini bluetooth USB dongle that i've disassembled.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
And i'll be getting a mini USB microsd adapter that I can tear apart down to the same type of thing as the bluetooth dongle.
Now, the easy part is finding space to put them, there are a few gaps/spaces that I found for the bluetooth dongle, and placing the microsd adapter should be just as easy.
The hard part is getting the wiring all wired up on the inside, and this is where I need advice/input. Trying to solder the wires to the pins on the charge/USB port would be too hard and risky since they're so close.
I took apart a mini-b USB cable to use the pins to try and hook them up like that some way, but I don't have everything I need yet, so it's just a thought.
Ideas, advice, thoughts and/or comments?
Also, I will be documenting what i'm doing so that I can post a tutorial if I succeed.
I've also posted this in the Kindle Fire general forums. http://forum.xda-developers.com/showthread.php?p=25212300
Main problem with the SD adapter is that many USB SD readers behave badly if you insert the SD when the adapter is live - you need to insert the SD THEN plug the reader into a PC.
Entropy512 said:
Main problem with the SD adapter is that many USB SD readers behave badly if you insert the SD when the adapter is live - you need to insert the SD THEN plug the reader into a PC.
Click to expand...
Click to collapse
Hmmm, thanks for bringing that up, I didn't think of that. I'll have to see about putting a small switch in somewhere if I run into that issue.
Have you looked for another USB pinout on the board?
There might be one, if you can post an hi-res picture of the PCB I can try to find something useful
AraKs said:
Have you looked for another USB pinout on the board?
There might be one, if you can post an hi-res picture of the PCB I can try to find something useful
Click to expand...
Click to collapse
I was going to try and do that myself, but I couldn't find anything. Right now I ended up scraping off some of the black plastic around the pins at the point that they're going up and i'm trying to solder them alternating the top and bottom.
If you can find other places though that would be great. It might help me out, and it would def help others out if I succeed and write a tutorial.
Here are some hi-res shots from ifixit, unfortunately my real camera has a broken lens at the moment.
http://guide-images.ifixit.net/igi/BWbx2gTOKoo2SInC.huge
http://guide-images.ifixit.net/igi/SejZs5a65UTRcAYv.huge
There's something I don't understand here; won't doing this render the USB port unusable? Don't you need a hub if connecting more than one USB device? Can the USB port provide enough power for these additional devices?
Sent from my SGH-I777 using Tapatalk 2
scidon37 said:
There's something I don't understand here; won't doing this render the USB port unusable? Don't you need a hub if connecting more than one USB device? Can the USB port provide enough power for these additional devices?
Sent from my SGH-I777 using Tapatalk 2
Click to expand...
Click to collapse
You need the USB hub for power from what I understand. The microsd adapter doesn't require any power and i'm not sure how much the bluetooth takes, but since the other takes none it might work out. If they don't work together then it doesn't really matter to me cause I don't need bluetooth.
Also, about it making the USB port unusable, yes and no. If you look at this pinout diagram here http://www.kineteka.com/microusb-b.aspx you'll see that there are 5 pins. On a USB cable only 4 are used. On a USB otg cable pins 4 and 5 ar econnected telling the device that it's a host and not a slave. When pins 4 and 5 are connected are connected USB will not work at all(So no adb or file transfers, etc.) because the cable is being told it's a host device. Once those two wires are separated then USB will work again because it will see itself as a slave device.
I searched info trought the TI OMAP 4430 documentation about the USB implementation.
(i have to "hide" the link or i won't be able to post!)
Here you can find a block diagram of a reference USB implementation:
h_t_t_p://w!w!w.ti.com/pdfs /wtbu/OMAP4430_ES2.x_DM_Public_Book_V_D .pdf
Section
A.4.4.2 USBA0 PHY Implementation Example
Also, Section
2.1 Terminal Assignments
Shows the pinout of the processor
Table
Table 2-1. Ball Characteristics
Shows the chip connections
The document lists also USB0, USB1 and USB2 but i can only see ball pinouts for "usba0_*" and anything like "usba1_*" or "usba2_*".
So i think that there's only one USB connection and you'll have to solder a USB HUB somewhere between the CPU and the USB connector.
AraKs said:
I searched info trought the TI OMAP 4430 documentation about the USB implementation.
(i have to "hide" the link or i won't be able to post!)
Here you can find a block diagram of a reference USB implementation:
h_t_t_p://w!w!w.ti.com/pdfs /wtbu/OMAP4430_ES2.x_DM_Public_Book_V_D .pdf
Section
A.4.4.2 USBA0 PHY Implementation Example
Also, Section
2.1 Terminal Assignments
Shows the pinout of the processor
Table
Table 2-1. Ball Characteristics
Shows the chip connections
The document lists also USB0, USB1 and USB2 but i can only see ball pinouts for "usba0_*" and anything like "usba1_*" or "usba2_*".
So i think that there's only one USB connection and you'll have to solder a USB HUB somewhere between the CPU and the USB connector.
Click to expand...
Click to collapse
Thanks for the help, but how am I going to solder directly to the processor?
And if I could get the correct pins anyways there would be no need to use USB I could just hook the microsd up directly since the 4430 already has those.
If there was a data sheet somewhere out there for this specific board something like what you're suggesting might be possible, but it's not really the way it is now.
And i've never used USB host capabilities before, but from the videos i've watched people on other devices don't use a hub unless they hook up more than one device.
I see. You are right!
Anyway, i came up with another solution for the bluetooth connectivity: it requires a bit of soldering and a couple of kernel modules (or a custom-built kernel).
You can solder some wires from the serial port of the kindle fire:
http://forum.xda-developers.com/showthread.php?t=1525439
to a UART bluetooth module:
h_ttp://w_w.tdvdesign(dot)com/BluetoothModule/
Then write a script the brings up the bluetooth interface at boot.
In Linux should be feasible, in Android i don't know... maybe there's a praticular framework that needs specific drivers...
---------- Post added at 04:53 PM ---------- Previous post was at 04:23 PM ----------
Enable kernel bluetooth+UART HCI:
ht_tp://docs.blackfin.uclinux(dot)org/doku.php?id=bluetooth_over_uart
AraKs said:
I see. You are right!
Anyway, i came up with another solution for the bluetooth connectivity: it requires a bit of soldering and a couple of kernel modules (or a custom-built kernel).
You can solder some wires from the serial port of the kindle fire:
http://forum.xda-developers.com/showthread.php?t=1525439
to a UART bluetooth module:
h_ttp://w_w.tdvdesign(dot)com/BluetoothModule/
Then write a script the brings up the bluetooth interface at boot.
In Linux should be feasible, in Android i don't know... maybe there's a praticular framework that needs specific drivers...
---------- Post added at 04:53 PM ---------- Previous post was at 04:23 PM ----------
Enable kernel bluetooth+UART HCI:
ht_tp://docs.blackfin.uclinux(dot)org/doku.php?id=bluetooth_over_uart
Click to expand...
Click to collapse
**Disregard**This could help with bluetooth if I can't get USB host to work, but that still leaves no solution for the sdcard, which is my primary concern. I've actually gotten all the wires soldered onto the correct pins on the usb port, but I can't get USB host to work for any device, with or without the correct modules.**Disregard**
You got me thinking though, I could probably add a UART sdcard and GPS module on like that. Awesomeness, thanks for the idea. I'll try that out if I can't get USB host to work.
aaricchavez said:
You got me thinking though, I could probably add a UART sdcard and GPS module on like that. Awesomeness, thanks for the idea. I'll try that out if I can't get USB host to work.
Click to expand...
Click to collapse
I've also seen a lot of hardware mods that connected sdcards to gpio lines. That could be an option too.
For the sdcard over UART it's possible, but i'm concerned about the performances...
At 115200bps baud rate you get 14.0625KBps!!!
AraKs said:
I've also seen a lot of hardware mods that connected sdcards to gpio lines. That could be an option too.
For the sdcard over UART it's possible, but i'm concerned about the performances...
At 115200bps baud rate you get 14.0625KBps!!!
Click to expand...
Click to collapse
True, true. You seem to have more experience then I do at this. I'll prob buy a GPS UART module and do that. I have the wires soldered onto the USB pins on my Kindle, but I haven't had time to do anything more then that yet.
Thank you
A GPS module will be very useful.
A 7" tab it's portable enough to be carried around and used with a simple car mount...
I'll look for the needed kernel modules asap
Sent from my Nexus S using XDA
This is interesting:
ht__tp://wiki_openpilot_org/plugins/viewsource/viewpagesrc.action?pageId=950326
BUMP
webstas said:
BUMP
Click to expand...
Click to collapse
I'm just waiting for some stuff I need that I ordered offa ebay. The digitizer should be here tomorrow and the other stuff some time this week. I'll update when I get the stuff and start working on it again.
I don't really understand why using the usb-port should be a Problem. Just solder your what-ever-you-want-device to the original usb pinout, it's big enough. Solder a rly small switch (taken from an old mobile Phone for example) between pin 4 and 5 to change host and normal mode. Finally, if u need more power there of course is a battery inside the Kindle, get it from there
I'll receive my Kindle in a few days i hope (u can't buy it regularly in germany...), will play a bit with this stuff
Deehee3 said:
I don't really understand why using the usb-port should be a Problem. Just solder your what-ever-you-want-device to the original usb pinout, it's big enough. Solder a rly small switch (taken from an old mobile Phone for example) between pin 4 and 5 to change host and normal mode. Finally, if u need more power there of course is a battery inside the Kindle, get it from there
I'll receive my Kindle in a few days i hope (u can't buy it regularly in germany...), will play a bit with this stuff
Click to expand...
Click to collapse
I've already got the wires soldered to the pins, I just wasn't able to get USB host working. And there's no room for a switch right on the pins, but I thought of a good solution. Reed switches!
Other thread was created here, just want to keep all the threads up to date: http://forum.xda-developers.com/showthread.php?t=1632277
aaricchavez said:
The UART modules are only an idea, the main problem with going that direction instead of USB host is the drivers the modules would need(They all usually come with generic ones, but they would need to be customized for Android). I have very limited code/coding knowledge so I would need alot of help or soeone to do that part completely. I was going to pm Hashcode for help if I decided to try out the UART modules. Also, i'm unsure if more than one module can be used at the same time.
Like I just posted in the thread i'm still waiting on some stuff to arrive to actually get started on the USB host attempt. I have the wires soldered to the USB/Charge port pins, but since I don't have the microsd adapter or any more spare cords to rip apart I can't go further. I ordered about 10 different mini microsd adapters to take apart and see which works out the best.
Other people have USB host working, so shouldn't be difficult. I've just never used USB host before so i'm not real sure of what to expect.
The only downside is that there needs to be a switch of some sort somewhere to disable USB host so that adb/storage will work. I'm trying to think of something a little more elegant that having a huge hole in the case with a switch protruding out of the side. I'm going to go searching for some solutions and a super small switch.
All the UART GPS modules I found when searching "uart gps module" on Google are mostly from India and are between $30-50ish, the receivers look to be about the size of a quarter.
*http://robokits.co.in/shop/index.php?main_page=product_info&products_id=289
*http://robosapiensindia.com/robomar...n=com_virtuemart&Itemid=64&vmcchk=1&Itemid=64
*http://robosapiensindia.com/robosap...ategory_id=27&option=com_virtuemart&Itemid=64
I decided to look on Sparkfun and adafruit and i'm glad I did, it looks like they both have some modules, but I haven't looked around and dug through them yet.
*http://www.sparkfun.com/categories/4
*http://www.adafruit.com/category/35_58
All the optimism aside i'm not all too sure that we could get the GPS UART module to work. From what I see (First picture: http://forum.xda-developers.com/showthread.php?t=1471813) the UART output that Hashcode put into use only has two GNDs a TX and RX. The modules that I found all look like they need 8 connections. Adafruit has a nice pic of the connections labeled here: http://www.adafruit.com/products/746
If you're talking about microsd UART modules, as mentioned in the thread I created, someone made the point that it wouldn't make much sense because speeds would be way too low.
Click to expand...
Click to collapse
aaricchavez said:
I hate to double post, but I found the perfect solution for the switch. A reed switch or two plus a small magnet will work wonders
http://www.sparkfun.com/products/8642
Edit: Here are the switches that I am buying, they're the cheapest spdt reed switches I could find: http://www.newark.com/hamlin/mdrr-dt-15-20-f/switch-reed-spdt-co-1-5a-175vdc/dp/24C6463
This will allow USB host to be activated constantly and then deactivated easily with a neodymium magnet to use adb, USB storage and whatnot.
I'm pleased that I found such an elegant solution, no need to mess up the housing to put in a switch
Click to expand...
Click to collapse
Just curious about the status of your progress.....

The Samsung Anyway Jig

The Samsung Anyway Jig
Summary: Some information and pictures of the mysterious Samsung Anyway Jig
Skill Level: Medium
==================================================
Do NOT post questions/requests on how to obtain one, they
will not be answered. (Because I have no idea, since its
Samsung proprietary test equipment!)
Do NOT post links to commercial jigs, unless you also post
the internal schematics, in such a way that it can be easily
constructed at home.
If you already have a working home-made multifunction jig
that you would like to share, please remember:
- a picture of the device
- a picture of the schematics
- a detailed parts list
- the phone/models it applies to
- any other relevant features to make it work
==================================================
Purpose
As custom ROM flashing become more and more popular, the XDA-forums are
continuously bombarded with questions and answers on how to debrick their
devices, often using (what used to be) professional hardware analysis and
debugging equipment, like vendor provided JTAG, JIG and software flashing
tools. These tools used to be only available to certified technical repair and
support centers, closely connected with the various phone vendors. However,
this scenario is rapidly changing as more people are getting higher technical
skills, while using these devices and tools on their phones.
One particular such device, provided by Samsung, has been used for years to
program, customize, repair, debug and unbrick essentially all available
Samsung phones. This blue box is called the "Samsung Anyway Jig", and somehow
Samsung has managed to hide it from public scrutiny and analysis, which have
elevated this device to an almost mythical status. At least for the common
person wishing to repair or modify his phone. Probably because Samsung have
realized that there is a great profit to be made, by having their customer
sending their phones in for repair, rather than letting them in on the simple
secret on how to do this kind of repairs themselves. This behavior have also
been a great joy for the few professional service centers that actually have
access to this device (or similar devices) or who were able to figure out how
it works, making it into a million dollar industry, and obviously without
sharing their knowledge to the public.
Thanks to great community oriented websites and forums like XDA and others,
the public awareness have increased to such a level, that today anyone (with
minimal soldering skills) can build a multifunction and debricking JIG. And
because of the increasingly better standardization among mobile phone
manufacturers, very few modifications are needed for this device to be working
with essentially any modern mobile-phone on the market.
This thread is an attempt to better understand the Samsung Anyway Jig, such
that one can build his/her own Jig, with the information contained herein,
together with many other publicly available documents. It shall be noted that
I do not have access to this device, and I have neither factual data, nor
info, on how this thing actually works. But I do have a very good idea!
Close inspection, of the only 3 (!) images found, as obtained by Google Image
Search (which I am growing increasingly unhappy with), provide a good start
for what is going on in that device.
The Anyway Versions
The Anyway Jig come in slightly different versions. And since I only have access
to 4 pictures, I cannot tell what other versions are available. However, I
noticed the following:
Code:
[SIZE=2]Version PartNumber Variation/Note
-------------------------------------------------------------------------------
S100 Doesn't have "EMP" Solution
S101 GH99-36900A Has "EMP" solution. Is used with GT-S7230 (Bada OS)
S102[/SIZE][SIZE=2] GH99-36900B [/SIZE][SIZE=2]1.2A High-Current version for Tabs & Tablets
[/SIZE]
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So let me first reproduce the text as seen on the photo of this box:
Code:
[SIZE=2]
| Function
-------------------------------------------------------------------------------
No Solution | Mode OFF ON
-------------------------------------------------------------------------------
1 Agere TC | Boot Low High
2 Hp, Vision, Infineon | SDS O X
3 NXP Sysol | USB O X
4 NXP Swift Broadcom | DBG X O
5 UMTS (Qualcomm) | M-USB Use Not Use
6 EMP | ID type UART USB
7 - | ID-BOOT Boot-On Boot-Off
8 - | - - -
9 - | SDS TRX - Loop
10 - | DBG TRX - Loop
-------------------------------------------------------------------------------
| O = Connect, X = Disconnect
[/SIZE]
"The Solution"
The first thing to notice, is that the "Solution" column is completely
independent of the "Function" column. The "Solution" column seem to refer to
the manufacturer of the modem hardware used in the device, usually the
cellular/baseband processor (CP/BP) used by your phone or the modem chip in
routers etc. You can find out what you have by using the methods I have
outlined in the thread: "Phone/Modem Hardware Cross Reference List".
Once you know what you have, you use the 10-pole (BCD?) rotary micro-switch,
as shown in the picture below, to set it to the number corresponding to your
phone modem. (The settings in that picture, corresponds to a Samsung Wave
[GT-S7230] which has a Broadcom BP and thus the rotary-switch is set to #4.)
But according to this document, for attaching a [GT-I9000], you need to set
it to #2 (for Infineon).
It is unclear at this point whether or not this setting is actually changed
much when using various modern phones. It is more likely that this is used for
backward compatibility to older phones that use older connectors, and that new
phones all use the same setting since most of them, now use micro-USB
connectors. Otherwise it simply wouldn't make sense to use a
micro-rotary-switch, especially considering the vast number of modems chips
available today, while the uUSB standard connectors doesn't allow other
signals.
"The Function"
As you have already noticed, next to the rotary switch, there is a 10-pole DIL
switch, that is used to set the Jigs "Function", or behavior. The table above
show the various functional options available, that you can use for the JIG.
Although it is unclear what all these functions actually does, without access
to a box or manual, we are free to make some educated guesses.
Here we make the following (rather wild) guesses as what the various modes does:
Code:
[SIZE=2]DILpos Mode Typical What Description-Guess
-------------------------------------------------------------------------------
1 Boot 0 Low ??
2 SDS 1 X ??
3 USB 0 O ?Enable/disable USB pass trough: [target]--->[JIG]--->[PC]
4 DBG 0 X ?Enable/disable debug by "port":
5 M-USB 0 Use ?Enable/disable modem USB connection
6 ID type 1 USB ?"Interface Dongle" output-side selection (wheter to use the USB or UART to connect to PC)
7 ID-BOOT 0 Boot-on ?Determines if the device should bootup/start when connected to the JIG.
8 - - - -
9 SDS TRX 0 - ?Enable/disable Loopback on this interface
10 DBG TRX 0 - ?Enable/disable Loopback on this interface
-------------------------------------------------------------------------------
where (0==OFF, 1=ON) of the 10-pol DIL switch,
while "O" is connect and "X" disconnect.[/SIZE]
If you have any knowledge of what these does, please let us know. For example,
I like to know what the "SDS" refers to and what it is/was used for?
Then What?
So how interesting is this, for our modern Android based and micro-USB
connected phones, on a scale from 1-10? Probably not much more than 3.
Because most of the device magic happens inside the phone, determined by
various internal multiplexers (MUX), resistance/capacitance detectors, the
Power Management IC (PMIC) and related device drivers.
The most important thing to understand, is that today there are very specific
standards regarding what functionality is offered and expected, given certain
conditions on the micro-USB signals. For example, shorting the D+ and D- USB
signals, tells your phone to start charging, using the VBUS and GND lines.
While a resitive short between the micro-USB lines ID_CON (pin 4) and GND
(pin-5), allows and selects a wide range of functionality from remote control,
debug mode, download mode, audio/video transfer and everything else you may
want to do. These are some of the things we would like to focus on here.
So what is more interesting, is how we can build a JIG that is much more
modern and useful than this old dinosaur, that can provide us with a fully
controlled set of the functions mentioned above. So if you still dream about
getting one, forget it and build your own! Below I will link to a list of DIY
multifunction JIGs. That means I only list serious JIGs that contain a little
more functionality, than just a resistor. Post if you have something worth
showing.
Useful Resources
*Fun with resistors (home/car dock mode + more)
Lets Save Some Bricks
*The Captivate Development Platform mod AKA UnBrickable Mod
Set up a Captivate for Samsung Bootloader Development
The Vibrant Development Platform AKA UnBrickable Mod
USB Jig FAQ (Frequently Asked Questions) [4/4/2012] ICS bootloader added
Galaxy S UART JIG & Debugging Connector
Complete USB2.0 Specifications (>13 MB, 30 files, main: 650 pages)
USB Battery Charging Specifications 1.2 (71 pages)
FSA9280A Datasheet (Used in SGS1)
FSA9285 censored Datasheet ()
FSA9485 censored Datasheet ()
FSA3200 Datasheet (Used in SGS2)
---------------------------------------
* Strongly recommended reading
Let me know of any dead links.
Here is an internal photo of the original Anyway S100.
Keywords: jig, samsung, anyway, resistors, multiplex
​
UPDATE: 2012-10-24
Anyway Software, Drivers and Manuals for:
Anyway D100 (8 port factory jig)
Anyway S100 (1 port factory jig)
Can be found for download in Post#67 ...
​
Building your own multifunction JIG
The first thing you need to know, when building your own jig, is how various
resistor values determine the behavior of your phone. Below is a list of
resistor values used in the FSA9280A multiplexer chip. These values have been
become a bit of a standard for new Samsung phones and are thus likely to
remain true also for new models and many other devices running AOS. In
post #3 we use these values to build our Resistor Banks.
FSA9280A/88A Resistor Value Functionality
ID_CON Accessory Detection Table (ID_CON resistance to GND):
Code:
[SIZE=2]ADC-reg Min Typ Max Attn Accessory Detected
-------------------------------------------------------------------------------
00000 GND [COLOR=Red]GND [/COLOR]GND ! Host Mode / OTG (On-The-Go)
00001 1.9K 2K 2.1K Audio Send/End Button
00010 2.47K 2.604K 2.73K Audio Remote S1 Button
00011 3.05K 3.208K 3.37K Audio Remote S2 Button
00100 3.81K 4.014K 4.21K Audio Remote S3 Button
00101 4.58K 4.82K 5.06K Audio Remote S4 Button
00110 5.73K 6.03K 6.33K Audio Remote S5 Button
00111 7.63K 8.03K 8.43K Audio Remote S6 Button
01000 9.53K 10.03K 10.53K Audio Remote S7 Button
01001 11.43K 12.03K 12.63K Audio Remote S8 Button
01010 13.74K 14.46K 15.18K Audio Remote S9 Button
01011 16.4K 17.26K 18.12K Audio Remote S10 Button
01100 19.48K 20.5K 21.53K Audio Remote S11 Button
01101 22.87K 24.07K 25.27K Audio Remote S12 Button
01110 27.27K 28.7K 30.14K Reserved Accessory #1
01111 32.3K 34K 35.7K Reserved Accessory #2
10000 38.19K 40.2K 42.21K Reserved Accessory #3
10001 47.41K 49.9K 52.4 K Reserved Accessory #4
10010 61.66K 64.9K 68.15K Reserved Accessory #5
10011 76.1K [COLOR=Red]80.7K[/COLOR] 84.1K ! Audio Device Type-2
10100 96.9K [COLOR=Red]102K[/COLOR] 107.1K ! Phone Powered Device
10101 115K 121K 127K TTY Converter
10110 143K 150K 157K UART Cable
10111 190K 200K 210K Type-1 Car Kit Charger*
11000 242K 255K 268K Factory Mode Boot OFF-USB
11001 292K 301K 316K Factory Mode Boot ON-USB
11010 347K [COLOR=Red]365K[/COLOR] 383K ! Audio/Video MHL Cable**
11011 420K 442K 464K Type-2 Car Kit Charger*
11100 507K 523K 549K Factory Mode Boot OFF-UART
11101 588K 619K 650K Factory Mode Boot ON-UART
11110 750K 1000/2K 1050K Audio Device Type-1 with Remote
11111 - Open - Slave Mode / Charger Mode***
-------------------------------------------------------------------------------
* USB Car Kit specification: ANSI/CEA-936-A.
** USB MHL (Mobile High definition Link)
! Attention, when these values are used, all pin functions
changes. Having the wrong device connected in this mode, may
short and brick interior phone chips.
-------------------------------------------------------------------------------
[/SIZE]
There is a good reason why some resistor values are marked as "DO NOT USE", in
the original FSA9280A datasheet. That reason is because these values trigger a
signal path switch (by cascading multiplexers), in such a way that the
original 2-5 USB (cable) signals no longer exists as such. If this occurs,
when you have another type of device connected, than what was intended for
that function, you risk short-circuiting and bricking the relevant internal
chip that is driving that function. The best example is the MHL function. When
MHL is activated, all mUSB pins become part of MHL signal lines. If during you
happen to have a dedicated charger connected instead of a dedicated
mUSB-to-HDMI cable, you will for sure burn out your MHL Transmitter chip (or
possibly any other chip using those signals in that path). Why? Because a
dedicated charger has D+ and D- pins shorted, while its trying to provide +5V
(@1.2A) on pin-1. This at the same time the MHL chip is trying to provide
various output signals on all 5 pins!
Factory Mode Auto-Configuration Table (1% Resistors on ID_CON Pin):
Code:
[SIZE=2]Configuration Boot VBUS DP_CON DM_CON ID_CON BOOT JIG
-------------------------------------------------------------------------------
FactoryMode 0 (UART) On Open RxD TxD 619K HIGH LOW --> Triggers "Dock Mode" (Google Car Home)
FactoryMode 0 (UART) Off Open RxD TxD 523K LOW LOW -->
FactoryMode 1 (USB) On Closed DP_Host DM_Host 301K HIGH LOW --> Triggers "Download Mode" (aka "Debrick/Recovery JIG")
FactoryMode 1 (USB) Off Closed DP_Host DM_Host 255K LOW LOW -->
[/SIZE]
In addition to the above resistor values based on just that one chip, and mainly used by Samsung, there is an international standard specification for Battery Charging. In these spec's there are three additional values to consider.
Battery Charging 1.1 Specifications
(May need to be verified...)
Code:
[SIZE=2]DCP: USB Dedicated Charger Port RID_A = 124K
CDP: USB Charging Downstream Port RID_B = 68K
SDP: USB Standard Downstream Port RID_C = 36.5K
where RID = "Resistor Identification"[/SIZE]
List of DIY multifunction JIGs
UberPinguin's Multi-R Jig
Another nice I9100 UART JIG (chinese)
DHylands SGS2 Serial Adapter and Console
Recommended UART Cables
FTDI's "Chipi-X" USB-to-RS232 Cable
Good to Know
Android D2XX FTDI Driver
"Build your own Music dock" [Samsung]
The Dancing MyWay Jig
< here be dragons 2 >
Dude! excellent find. Holy Hack!
you may have seen this thread.. http://forum.gsmhosting.com/vbb/f200/who-used-samsung-anyway-jig-1347210/
that Duc guy may have some info.
someone also links to a user manual where you can see more of that puppy in action.. http://samfirmware.webs.com/I5801_Flash_Tutorial_English.pdf
enjoy. ciao.
^^ Yeah, thanks, but most of those links are dead and the "manual" is just an old standard flashing/service manual. In fact I got the above pictures from some other service manuals. Finally, I don't like having to register to a website, just so that I can see some images.
I do have a AnyWay S100 jig here that i got when samsung support left the place i work. I think i can get a hold of all the cables that they had for it. If i remember correct there was never a micro usb cable tho. But if you want i cna open that puppy up and provide pictures of the inside of the jig. also it could be nice if i could find a way to make a micro usb cable for it...
ParanoidDK said:
But if you want i cna open that puppy up and provide pictures of the inside of the jig.
Click to expand...
Click to collapse
Yes! We'd love to see what's inside! Chips, and wiring etc!
Do you happen to have any windows software drivers for the device? (Why? Because of this.)
Making a micro USB hack would be easy...if you have the right tools or a micro-USB breakout PCB. Just remember that most micro-USB to USB cables do not have the USB_ID line in the cable, but is immediately shorted inside micro-connector. You could get a micro-to-mini-USB cable, that should also include the USB_ID (aka ID_CON) line, but these are hard to find as they are not conforming to common USB cable standards.
Well the usb cable should be the least thing... And if i make one i might just as well make one from start with a micro usb plug, cable and the printer plug in the other end... I think i might be able to use the cable for one of the older samsung phones i have for the box as start point...
i have a print i need to make and then i will open up the box and start to take some pics with my SGS3 just so you can get a preview of the inside...
An anonymous and friendly contributor have come forward with a little bit more information, although not very useful.
1) The S102 model is modified to allow a higher current as used in Tablets.
2) The manual "Function" settings can now be made in software, and is no longer used. (Well then, how is it set in software?)
3) The "Solution" for Galaxy models should be set to "NXP Swift". (But this contradicts the Service Manual for the GT-I9100 and others! But is probably explained by the different BP's used in those devices.)
We need internal pictures! (or the schematics)
Here is some pictures of the internals from the S100 i have here. Proberly not the best ones but the best i can take with my cam... If i have to take better ones i will have to get my friend involved with his DSLR.
I had to upload them to my server as they was to large to upload to xda...
Internals Pictures of the AnyWay S100 Jig
-----EDIT----
I am going to see if i can find the last cables and the psu for the jig today in the bin... As it is now without the PSU windows dont even see the device...
ParanoidDK said:
Here is some pictures of the internals from the S100 i have here. Proberly not the best ones but the best i can take with my cam... If i have to take better ones i will have to get my friend involved with his DSLR.
I had to upload them to my server as they was to large to upload to xda...
Internals Pictures of the AnyWay S100 Jig
-----EDIT----
I am going to see if i can find the last cables and the psu for the jig today in the bin... As it is now without the PSU windows dont even see the device...
Click to expand...
Click to collapse
hi thanks to give all i need full box so can you help me ?
[email protected] said:
hi thanks to give all i need full box so can you help me ?
Click to expand...
Click to collapse
I am not going to part with the anyway jig i got so no... You will have to keep looking on ebay... I dont mind opening it up to let the world see the inside but am not going to sell it.
That's a whole lot of relays in that box.
I don't know if anyone has stated which connector is for what,
but I'd guess that the 25 pin connector goes to a model-specific resistor assembly.
Too much of the relay wiring goes out there.
The big "printer port" is the port for the phone connections that i know... i have a cable for a older samsung phone with the box... and that might be a problem because it might use diffrent pins for diffrent phone models... so without seeing both ends of the micro usb cable naked it will be hard to make a cable...
If you guys need more pics let me know... i can also strip that samsung cable i allready got...
Sent from my GT-I9300 using xda premium
ParanoidDK said:
Here is some pictures of the internals from the S100 i have here... I am going to see if i can find the last cables and the psu for the jig today in the bin... As it is now without the PSU windows dont even see the device...
Click to expand...
Click to collapse
Wow! This thing was (any?) way more complicated inside than what I could have imagined! Containing several relays, a PIC16F876A, and who knows what all those other chips are doing.
This is kind of bad news, as then it will be nearly impossible to build anything like it. At least without the firmware for the PIC and the drivers used. However, I believe that most of its functionality is for switching purposes in order to be able to use it on a broad spectrum of devices. So if we can limit ourselves to the most recent smart phones with micro-USB connectors, much of the internal electronic can be ignored.
So don't worry about the PSU (Power Supply Unit?). It would be much more useful if you have the drivers...
This is how it looks:
<I seem to have some upload problems!! >
(Not sure if its an XDA issue or not...)
EDIT: Now it worked...3 days later!
Could you take apart the shell on the 25 pin adapter cable for the old cell phone model?
I'll bet that there are some precision resistors in there.
Thanks.
I dont have the drivers... and i do worry about the psu because without that the unit dont work....
I will open the cable and upload some pictures of that today....
Sent from my GT-I9300 using xda premium
no comment
You sure have some problems with that image E:V:A
But here it is (I hope):
Did just open the cable i got ant it is a S20 cable.
http://www.samsung.com/us/mobile/cell-phones-accessories/APCBS10UBEBSTD
There is no resistors it is just a 25 pins to S20 cable... Will upload some pics here in a bit... And now i really have to check to see if there are more cables just to check the 25 pins end..
---EDIT----
Link to pictures of the naked cable: http://blog.moonman.dk/files/Anyway_S20_cable.zip
Are you sure that this jig does anything for current cell phones?
It seems to me that this device has nothing to do with the semi-standard today
of 5 pin micro USB connectors with resistance coding on the 5th ID pin.

[Hardware][Arduino][Pre-boot] Universal Arduino Serial Adapter

Overview
I have designed a "universal" serial adapter that the XDA community might appreciate. I recently needed access to a variety of devices using serial TTL and RS232 communication. The devices being a phone, router and firewall unit. I talked with a few friends that are in IT and polled some other ROM developers to get an idea on what they may find useful in a serial adapter device. Below is the result of the work. The idea is to have 1 serial adapter that takes care of all of your DB9 / null modem / goofy pinouts in one package.
Project Page
I have posted all of the code, pictures and an early circuit diagram to github: https://github.com/mcrosson/arduino_universal_serial_adapter . As I continue to develop and implement the project I will be pushing to github. Please note at this time the circuit diagram is a bit out of date. I am working on getting an updated diagram built but I am still learning Eagle and it will be a little while before I have it published.
Compatible Devices
Phone UART chips
Null modem serial ports
Cisco serial consoles
Working Features
Configurable line speed
TTL voltage adjustments (1.8V, 3.3V, 5V)
RS232 communication
Full UI
Future Features
Session recording to SD card
RTC for timestamped sessions and output timestamps
Inline display of serial communication on LCD Won't fix, LCD response is too low for this
RX/TX status via blinking the button LEDs
Known Issues
At 115200 line speeds the serial channel may drop characters -- This appears to be a speed limitation / bad code Fixed in dd981aa44d
UI timeout isn't reset when events occur Fixed in 7f60a42f9b
Timeout config doesn't reset / change current timeout Fixed in ebd4ac5d04
Code
IDE / Environment
This project was developed using stino (Sublime Text 2 plugin). It works slightly differently (read: more powerful) than the standard Arduino IDE. This project may or may not build under the Arduino IDE.
Configuration
The `Project.h` and `Project.cpp` files define the pinouts in use, Arduino pinout and a number of other items that may vary between builds. Please read through these [short] files and update the pinouts, addresses and anything else that may be different before uploading to your Arduino.
Prototype
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Demo
I have posted some rough demo videos here (clickable) demonstrating some of the projects functions.
Parts
Arduino Mega
AdaFruit 1.8" LCD with MicroSD Card Slot
PSP Joystick
LED backlit buttons
Spark Fun MicroUSB breakout
AdaFruit logic level converter (bi-directional)
RJ-45 jacks
DB9 jack
Maxim Max3232 RS232 to TTL DIP IC's
Credits / Thanks
ChildOfTheHorn/Stacy Wylie
Adam Outler
Motorhead
utkanos
bhundven
Articles / Information Used For Project
http://forum.xda-developers.com/showthread.php?t=1901376
http://forums.hackaday.com/viewtopic.php?f=3&t=623
http://petervanhoyweghen.wordpress.com/2012/11/08/using-the-leonardo-as-usb-to-* serial-converter/
http://www.cellbots.com/how-to/handling-3-3v-to-5v-logic-level-conversion/
https://plus.google.com/104711040110222472212/posts/3764HBYeb2X
http://www.cutedigi.com/arduino-shields/rs232-shield-for-arduino.html
http://www.arduino.cc/en/Tutorial/SoftwareSerial
http://arduino.cc/en/Tutorial/ArduinoSoftwareRS232
http://www.ossmann.com/5-in-1.html
http://www.lammertbies.nl/comm/cable/RS-232.html
http://www.usconverters.com/index.php?main_page=page&id=61&chapter=0
Happy to be a part of it KemoNine. I'm all set with my simplified version but I'm still happy to have helped.
second!
great works kemonine96,curious to try it!
sert00 said:
second!
great works kemonine96,curious to try it!
Click to expand...
Click to collapse
Hopefully it works well for you. I've been hoping to find a solid solution to the problem of dropped serial data when running at faster line speeds. I'm thinking the code is setup in a way where it takes too long to process all of the input events. Going to be trying to set it up as an interrupt driven serial read/pass through to see if that fixes the problem any.
If not, I recently obtained an Arduino Due which should have enough CPU to keep up with everything compared to the standard Arduino Mega I'm currently using.
kemonine96 said:
Overview
I have designed a "universal" serial adapter that the XDA community might appreciate. I recently needed access to a variety of devices using serial TTL and RS232 communication. The devices being a phone, router and firewall unit. I talked with a few friends that are in IT and polled some other ROM developers to get an idea on what they may find useful in a serial adapter device. Below is the result of the work. The idea is to have 1 serial adapter that takes care of all of your DB9 / null modem / goofy pinouts in one package.
Project Page
I have posted all of the code, pictures and an early circuit diagram to github: https://github.com/mcrosson/arduino_universal_serial_adapter . As I continue to develop and implement the project I will be pushing to github. Please note at this time the circuit diagram is a bit out of date. I am working on getting an updated diagram built but I am still learning Eagle and it will be a little while before I have it published.
Compatible Devices
Phone UART chips
Null modem serial ports
Cisco serial consoles
Working Features
Configurable line speed
TTL voltage adjustments (1.8V, 3.3V, 5V)
RS232 communication
Full UI
Future Features
Session recording to SD card
RTC for timestamped sessions and output timestamps
Inline display of serial communication on LCD
Known Issues
At 115200 line speeds the serial channel may drop characters -- This appears to be a speed limitation / bad code
UI timeout isn't reset when events occur Fixed in 7f60a42f9b
Timeout config doesn't reset / change current timeout Fixed in ebd4ac5d04
Code
IDE / Environment
This project was developed using stino (Sublime Text 2 plugin). It works slightly differently (read: more powerful) than the standard Arduino IDE. This project may or may not build under the Arduino IDE.
Configuration
The `Project.h` and `Project.cpp` files define the pinouts in use, Arduino pinout and a number of other items that may vary between builds. Please read through these [short] files and update the pinouts, addresses and anything else that may be different before uploading to your Arduino.
Prototype
Demo
I have posted some rough demo videos here (clickable) demonstrating some of the projects functions.
Parts
Arduino Mega
AdaFruit 1.8" LCD with MicroSD Card Slot
PSP Joystick
LED backlit buttons
Spark Fun MicroUSB breakout
AdaFruit logic level converter (bi-directional)
RJ-45 jacks
DB9 jack
Maxim Max3232 RS232 to TTL DIP IC's
Credits / Thanks
ChildOfTheHorn/Stacy Wylie
Adam Outler
Motorhead
utkanos
bhundven
Articles / Information Used For Project
http://forum.xda-developers.com/showthread.php?t=1901376
http://forums.hackaday.com/viewtopic.php?f=3&t=623
http://petervanhoyweghen.wordpress.com/2012/11/08/using-the-leonardo-as-usb-to-* serial-converter/
http://www.cellbots.com/how-to/handling-3-3v-to-5v-logic-level-conversion/
https://plus.google.com/104711040110222472212/posts/3764HBYeb2X
http://www.cutedigi.com/arduino-shields/rs232-shield-for-arduino.html
http://www.arduino.cc/en/Tutorial/SoftwareSerial
http://arduino.cc/en/Tutorial/ArduinoSoftwareRS232
http://www.ossmann.com/5-in-1.html
http://www.lammertbies.nl/comm/cable/RS-232.html
http://www.usconverters.com/index.php?main_page=page&id=61&chapter=0
Click to expand...
Click to collapse
oh how i miss those breadboards
I managed to solve the dropped characters issue tonight. I am now using the Timer3 library (look for Timer1 library on non-mega hardware) to control the serial IO using an interrupt timer.
Works great with the interrupt driven IO. Next up is RTC and SD card integration.
Quick update on progress: I implemented some basic sd card logging and RTC functionality today. I also cleaned up some of the code and generally improved things.
Ran into an issue with sd card data transfers being "slow" which is forcing me to look into non-standard libraries for io purposes. My next step will be to be able to log data at 115200 baud to the sd card. Hopefully I'll have this rectified soon.
kemonine96 said:
Quick update on progress: I implemented some basic sd card logging and RTC functionality today. I also cleaned up some of the code and generally improved things.
Ran into an issue with sd card data transfers being "slow" which is forcing me to look into non-standard libraries for io purposes. My next step will be to be able to log data at 115200 baud to the sd card. Hopefully I'll have this rectified soon.
Click to expand...
Click to collapse
Not a lot of activity in this thread lately, but I'm just getting into this area.
Have you made any progress on logging data to sd card?
Maplobats said:
Not a lot of activity in this thread lately, but I'm just getting into this area.
Have you made any progress on logging data to sd card?
Click to expand...
Click to collapse
No, I ran into some performance issues when I went to implement the feature. I believe I traced it down to some case statements but it's been awhile since I worked on the build.
Sent from my XT1053 using Tapatalk

Phone will not recognize anything I plug in

Me and my wife have 2 identical Verizon note 3 phones. Her phone works flawlessly when I plug it into a computer or external hard drive or even a card reader. But my phone on the other hand will not recognize anything I plug into it. I've tried updating usb drivers with kies 3 but kies doesn't even recognize my phone. I manually downloaded usb drivers and installed, but nothing.
I even did a phone reset and that didn't help. Thanks for any replies and help.
Sent from my SM-N900V using Tapatalk
Most likely a hardware issue then - either something mechanical like an open contact in the connector, or something electrical such as the mux chip connected to the USB connector got fried by static. It is possible that the cable in use is very marginal which would allow it to work with one phone but not the other, but that is sort of rare. But swapping USB cables is a good trial too.
Ignoring software driver issues (on the PC side), does the PC make any noises when you plug the phone in? USB insertions typically are followed on the PC with a two-tone audio confirmation. Second tone higher than the first = hardware detected & driver configured; Second tone lower than the first = hardware detected but driver not configured/not found. No tones at all? Probably a dead USB interface or bad cable or connector.
Also, even on non-rooted phones, from a terminal emulator you can run a 'dmesg' command twice which will spit out the kernel log. By doing it twice (once before plugging in the USB cable and once after) you can see if there is any new hardware detected by Android during the plugging event.
e.g.
Code:
dmesg | tail -n 20
then, plug in the device
Code:
dmesg | tail -n 20
If the Android kernel is detecting new hardware being plugged in, you will see some new jibberish saying something about USB in the second 'dmesg' run. (The first one is run before plugging in so you know what the end of the kernel log looks like.) If the kernel log is unchanged the second time, then you pretty much know that you have a dead USB port (or a bad cable which mysteriously works for one phone but not the other).
You should try to complete the 3-step sequence above fairly rapidly - other stuff routinely appears in the kernel log such as battery status messages. One way of doing that is
Code:
dmesg | tail -n 20 ; sleep 7 ; dmesg | tail -n 20
that gives you seven seconds to plug the cable in - do it as soon as you see output appearing on the screen.
This is the error I get when I plug my phone into the computer.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is error I get when I try to use the terminal emulator with the command u gave me.
I tried using a different usb cord also.
Thanks
Sent from my SM-N900V using Tapatalk
slufoot69 said:
This is the error I get when I plug my phone into the computer.
This is error I get when I try to use the terminal emulator with the command u gave me.
I tried using a different usb cord also.
Thanks
Sent from my SM-N900V using Tapatalk
Click to expand...
Click to collapse
Thanks for posting the pics
Well, for the 2nd part it looks like you need to be root to run the "dmesg" command. rats. (I assume you are not rooted.)
But the fact that you get a pop-up for the device on the PC says that there *probably* isn't anything wrong electrically, that's good news I suppose.
Let's try this: do you have the developer options turned on on your phone but not the wife's? Specifically I note the ADB interface in your first picture. Try turning off ADB (settings->Developer Options iirc) and possibly also Developer Options and re-plugging the device to see how things go.
The thing which is curious though is that you also mentioned not being able to plug in "other devices" - are you using a OTG cable adapter or something for that purpose? Note that drivers on the PC should have nothing to do with this use case. (Kies does not install "drivers on the phone", only on the PC)
I turned off USB Debugging and then turned Developer Options in settings off. (My wife's phone has Debugging ON and Developer Options ON)
Yes I have a OTG cable which works perfectly on external HD when my wife's phone is plugged into HD
Well after turning off Debugging and Developer Options I get the same error on pc after plugging it in. Any other suggestions? Thanks.
Sent from my SM-N900V using Tapatalk
slufoot69 said:
Any other suggestions? Thanks.
Click to expand...
Click to collapse
Not really. Your phone and the wifes are on the same boot firmware and OS release?
The only other thing that I can think of is that some ROMs pop up a USB notification when you attach a device; in the case of a PC, tapping on that notification will give you a choice between MTP mode and PTP mode. (I don't know if your stock ROM does that).
But given that the first pic you showed indicated a problem with a Mass Storage device, you could experiment with that MTP/PTP toggle (if you can find it).
But I don't know why that would have any effect on the phones behavior with an OTG device attached.
I can say this: there is a "mux" chip directly attached to the USB connector on the phone which allows for detection of a wide variety of devices; it typically comes into play not when using "normal" four-wire USB connections (like to a PC), but has the 5th wire attached to a resistance that goes to the ground terminal. This 5th connection is used in OTG, though. (I know this because I am using a UART adapter on my Note 3 - when the right resistance is present, it switches the connector from a USB interface to the UART interface - different voltages levels and all).
Anyhow, the point is that if that particular part of the Mux chip (OTG device detection pin) was messed up, the mux could (possibly?) stay stuck in a specific mode; it might be electrically active, but never proceed to the correct USB mode.
I don't know how you would correct such a situation, but you could probably identify something like this by looking at the USB "VID/PID" identifier pair that the PC sees for your device when you plug it in, and compare to see if those values are identical to your wife's phone.
In the Windows Device Manager, you find the USB device, select Properties, and then Details Tab. In the pull-down "Property" selector, look at the values for the field called "Hardware Ids" - the VID (Vendor ID) and PID (Product ID) should be identical between the two phones.
Sorry, that's all I've got.
FWIW, I stumbled across something this morning which - while not a "solution" - might make it easier for you to collect some data by comparing the wife's phone to yours.
The Windows Driver Kit 10 (yes, I am assuming you are using a Windows PC) has a graphical tool named "usbview.exe" which provides lots of details about USB devices attached to your PC. (I was installing the WDK for a different reason and happened to notice it).
It's a free download from Microsoft (note also it downloads hundreds of MB of components during it's install), and while the Microsoft Docs describe it as integrating with VisualStudio, there are a bunch of standalone tools in there (including "usbview.exe"). So, for this particular purpose installing VisualStudio is not required.
In my install they were located at
C:\Program Files (x86)\Windows Kits\10\Tools\x64\usbview.exe
(or, if you are on 32-bit)
C:\Program Files (x86)\Windows Kits\10\Tools\x86\usbview.exe
good luck! (The only thing the above will do for you is determine what the differences are; from there you will have to figure out a solution.)
PS. Quite a long time ago (in a different context) I ran into an odd problem where two peer computers were not talking to each other correctly. Eventually I traced the problem down to a situation where one side could successfully send and receive data, but the other end could only send (but not receive). If you have something like that going on, it is possible that the PC sees data sent from the USB device - enough to start the configuration process, but can't complete the negotiation process because the other side is deaf.
This is all hypothetical, but it could be something like that - a bad connector pin on one side of the D+/D- USB pins. (Obviously it's not the cable, as you swapped that with no change). On the Note 3, the charging port assembly can be replaced without replacing the motherboard. That could be something to try if you make no more progress.
Thanks for the help I will give it a go
Sent from my SM-N900V using Tapatalk

[GUIDE] Samsung Galaxy S7 UART

It is happened that I needed to obtain UART access on Galaxy S7. I tried Google search, apparently. I have found several threads on XDA dedicated to this question; however, they all are a bit outdated (2012-2013 years), containing information about an old loader.
Moreover, they are describing information in a very limited way, mostly telling the reader only about how to use UART with loader and do not going deeper into details.
Finally, despired to find any valuable piece of information, I performed my own research and here I will structure all the information I gathered and discovered.
To begin with, there is an USB multiplexing unit between USB-connector and USB-controller, aimed to measure the value of resistance between ID and GND, and setup a USB controller mode in dependance of that. That is not a new thing: the same way works, for instance, USB OTG.
But there exist other work modes which are hidden from the normal user. These work modes are utilized by a special device which is used by Samsung engineers. One can order a device like this on Ebay, but I do not se any reason for. Source codes of the mobile phone kernel are available for download and include a multiplexing unit driver.
The S7's MUIC name is MAX77854, which comes with lack of documentation, but we have a driver, which, obviously, has source codes which are available here: drivers/muic/max77854-muic.c. Going through the sources, I found an actual table of the resistance values and work modes for this device:
OTG =*GND
MHL = 1K
VZW_ACC = 28.7K
VZW_INCOMPATIBLE = 34K
RDU_TA = 40.2K
HMT = 49.9K
AUDIODOCK = 64.9K
USB_LANHUB = 80.07K
CHARGING_CABLE = 102K
GAMEPAD = 121K
TYPE1_CHG = 200K
JIG_USB_OFF = 255K
JIG_USB_ON = 301K
DESKDOCK = 365K
TYPE2_CHG = 442K
JIG_UART_OFF = 523K
JIG_UART_ON = 619K
TA = OPEN
USB = OPEN
CDP = OPEN
UNDEFINED_CHARGING =*UNDEFINED
ATTACHED_DEV_NUM = NUM
I have no idea what the listed most modes mean, but I see one very interesting mode JIG_UART_ON, which has been researched a bit and which allowes us to connect a device through USB-UART adapter and get a SBOOT boot log. I was inspired by an article about SBOOT where a guy researched the possibility of hijacking the boot loader and discovered a way how to change boot parameters including kernel boot parameters.
First of all, we need to build a JIG(UART) adapter. For that purpose we need to have any USB-UART adapter (I used FT232) and resistance unit for 619kOm (I have purchased one for 620kOm in the shop next to my house). Then we need to get them together as on the scheme:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The newly created adapter we need to plug in to the computer and wait for a new device name (on my system it set as /dev/ttyUSB0), then connect to this device through a terminal application (I used minicom).
Code:
sudo minicom -D /dev/ttyUSB0
I am not sure what settings will you have for your terminal application, that's why I highly recommend you to set up your port settings and disable the hardware flow control setting. After all things done, you have to plug a mobile phone to this adapter and turn it on using the key combo: Vol-(Volume Down) + Power.
As symbols on the screen start displaying, you need to quickly press Enter key as minimum as 3 times until we see the command line. Congratulations! We are in the SBOOT console! Run the following command:
Code:
setenv CMDLINE console=ttySAC4,115200 loglevel=4
saveenv
After its execution complete, press and hold Vol-(Volume Down) (if the above mentioned key has not been pressed, SBOOT will not print anything in the console) and enter the command into the SBOOT console:
Code:
reset
The device will reboot and we will see a SBOOT boot log and a part of kernel boot log. Why only a part? Because as of my research, a small bug is located in the kernel sources, I give you a patch for it below:
Code:
diff --git a/drivers/muic/universal/muic_apis.c b/drivers/muic/universal/muic_apis.c
index 342bc51..5af193c 100755
--- a/drivers/muic/universal/muic_apis.c
+++ b/drivers/muic/universal/muic_apis.c
@@ -796,7 +796,7 @@ int detach_jig_uart_boot_off(muic_data_t *pmuic)
*/
int attach_jig_uart_boot_on(muic_data_t *pmuic, muic_attached_dev_t new_dev)
{
- int com_index = COM_OPEN;
+ int com_index = COM_UART_AP;
int ret = 0;
pr_info("%s:%s JIG UART BOOT-ON(0x%x)\n",
After it has been applied, we will be able to see all the kernel boot log; however, we will break the GSM component of the mobile device. This UART port is used be system to communicate with a GSM modem. At this stage we can use it for kernel debugging, but it wasn't our goal.
Now let's get mobile device console access through UART, using the information received above.
To achieve this, we have to install TWRP on our device and using it, get root access. Then we have to install busibox, which includes getty application and that is the only its difference from the original. Afterwards, we boot our device, install a terminal emulator and switch the device to the airplane mode.
Now start the emulator and enter the following commands:
Code:
su
echo 1 > /sys/devices/virtual/sec/switch/uart_en
echo AP > /sys/devices/virtual/sec/switch/uart_sel #на этом этапе должен появиться лог ядра
su root -c "getty -n -L -l /system/bin/sh 115200 ttySAC4 vt102"
Useful links:
xda old forum thread
SBOOT hacking
and you connected the 3.3v line -why- exactly? the samsung won't power your max232 (if it does, like with usb otg, it will supply 5v, not 3.3 or usb converter and 3.3v won't power the samsung. just txd rxd and gnd is enough. also the 301ohm one always turns on the phone and boots to factory 'odin' mode for mass deployment of new firmware. (normal usb tho). when using them with the rs232 resistor value they'll output some crap at 115k2 during the bootloader.
cb3rob said:
and you connected the 3.3v line -why- exactly? the samsung won't power your max232 (if it does, like with usb otg, it will supply 5v, not 3.3 or usb converter and 3.3v won't power the samsung. just txd rxd and gnd is enough. also the 301ohm one always turns on the phone and boots to factory 'odin' mode for mass deployment of new firmware. (normal usb tho). when using them with the rs232 resistor value they'll output some crap at 115k2 during the bootloader.
Click to expand...
Click to collapse
I connected 3.3v because it normal to connect this line and it works. Probably without this line it will work. Everything that I write was tested by me. If you see crap during bootloader check minicom config.
lSDriim said:
I connected 3.3v because it normal to connect this line and it works, ft232 won't power Samsung because it's not working like that. Everything that I write was tested by me. If you see crap during bootloader check minicom config.
Click to expand...
Click to collapse
connecting a 3.3v line to a 5v line (regardless of which way the power goes) doesn't seem very practical for long time use. at least for 'factory odin' mode the phone can be powered from the 5v usb side during the firmware deployment (as usually the batteries aren't all too full when we pull them out of the box anyway
nah not crap as in frame errors and random bytes crap. crap as in some status messages but nothing useful. could not find any way to stop it and drop into a machine language monitor, get any type of prompt, inject code to be booted, or anything else that would be useful from there. it literally just seems to be some debug messages of the bootloader(s)
1650 pages of leaked "samsung confidential" datasheet but finding how to actually -use- the things for anything 'not android' (as in registers, memory map instruction set)? nah. it's more work to figure out how samsung screwed things up and get rid of all their 'monopoly' code which they try to pass off as 'security' than to just design a new phone and order it into production
anyway, the age of the post of the resistor values doesn't matter. the values are the same for every samsung device i've tried (we only use s7's but i got boxes full of other models, including very old ones. the resistor cables work exactly the same way all of those - although the 'magic bytes' for samsungs 'modified' simg format are different for each model, as are obviously the partition sizes. and really old ones seem to use a different and incompatible version of the odin protocol alltogether). haven't tried it with those usb-c connectors on those j5/a5 or whatever those things are called, as i don't have usb-c male pcb connectors in stock, but most likely there too. it's also not very picky on the actual resistor value. 300 ohm instead of 301 is fine. as long as it's 'close enough' it'll go to the desired mode. (as their specified values are weird, you can't buy 301 ohm resistors (pretty much all of them do uart mode and turn on+odin factory mode)
cb3rob said:
connecting a 3.3v line to a 5v line (regardless of which way the power goes) doesn't seem very practical for long time use. at least for 'factory odin' mode the phone can be powered from the 5v usb side during the firmware deployment (as usually the batteries aren't all too full when we pull them out of the box anyway
nah not crap as in frame errors and random bytes crap. crap as in some status messages but nothing useful. could not find any way to stop it and drop into a machine language monitor, get any type of prompt, inject code to be booted, or anything else that would be useful from there. it literally just seems to be some debug messages of the bootloader(s)
1650 pages of leaked "samsung confidential" datasheet but finding how to actually -use- the things for anything 'not android' (as in registers, memory map instruction set)? nah. it's more work to figure out how samsung screwed things up and get rid of all their 'monopoly' code which they try to pass off as 'security' than to just design a new phone and order it into production
anyway, the age of the post of the resistor values doesn't matter. the values are the same for every samsung device i've tried (we only use s7's but i got boxes full of other models, including very old ones. the resistor cables work exactly the same way all of those - although the 'magic bytes' for samsungs 'modified' simg format are different for each model, as are obviously the partition sizes. and really old ones seem to use a different and incompatible version of the odin protocol alltogether). haven't tried it with those usb-c connectors on those j5/a5 or whatever those things are called, as i don't have usb-c male pcb connectors in stock, but most likely there too. it's also not very picky on the actual resistor value. 300 ohm instead of 301 is fine. as long as it's 'close enough' it'll go to the desired mode. (as their specified values are weird, you can't buy 301 ohm resistors (pretty much all of them do uart mode and turn on+odin factory mode)
Click to expand...
Click to collapse
I write from my phone, because I am on vacation now and can't write long messages(too lazy now). But in this guide I write how to get bootloader prompt and change kernel start command and you can change kernel and boot anything you want... I already do this to boot up normal linux. In links there are link to guy that tried to hack sboot, may be he can help you.

Categories

Resources