Wednesday, November 16, 2011

Magic Safari Disappearing Trick

Maybe its an old developer bug/Easter egg, or a iPhone 2G jailbreak shadow hanging on, but since I can remember (iPhone 3G iOS3, iPhone 3GS iOS4, iPhone 4S iOS5) triple tapping my Safari icon will make it disappear and the only way to bring it back is to move the icons around which makes it pop back, but it still won't work anymore.  I have to restart the phone to make it work, otherwise I need to use the taskbar or search in Spotlight to open the app.  None of my co-workers or family have the phenomenon.  Anyone else?

Tuesday, November 15, 2011

Shortcuts to WiFi and Other Settings on iPhone Homescreen

Finally! One click access to the WiFi switch without having to jailbreak.

http://iphoneza.co.za/IconSettings/

Thx u for the WiFiz.

Friday, November 11, 2011

Broken Visual Studio 2008/2010 Wizards?

On multiple computers at various times I have run into this INSANELY frustrating issue where creating a new project in Microsoft Visual Studio 2008 or 2010 will fail when the created project type brings up one of those Application Wizard screens.  The symptom is that instead of the Wizard showing its content a File Download window pops up asking if you want to save, open, or cancel the download of Default.htm.  Microsoft is surprisingly quiet on the issue, but its gone on a for a long time, since the IE7 days and VS2005, judging from the forums. I searched for "Visual Studio Wizard Navigation to this webpage cancelled" and every variant I could think of and tried multiple solutions until I found this: Microsoft Forum that at the very bottom linked to this: Registry Keys to Fix the Problem in which you can find the ".htm" fixer.  The registry keys that it defines are extensive, and I haven't gone through all of the file to see what exactly it does, but it does work.  Disclaimer is that I've only used this on Windows 7 32-bit.

Here is a listing of the registry keys from the second link, for posterity:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\.htm]
[HKEY_CLASSES_ROOT\.htm]"PerceivedType"="text"@="htmlfile""Content Type"="text/html"
[HKEY_CLASSES_ROOT\.htm\OpenWithList]
[HKEY_CLASSES_ROOT\.htm\OpenWithList\notepad.exe]@=""
[HKEY_CLASSES_ROOT\.htm\PersistentHandler]@="{eec97550-47a9-11cf-b952-00aa0051fe20}"
[HKEY_CLASSES_ROOT\htmlfile]"AppUserModelID"="Microsoft.InternetExplorer.Default"@="HTML Document""FriendlyTypeName"="@C:\\Windows\\System32\\ieframe.dll,-912"
[HKEY_CLASSES_ROOT\htmlfile\CLSID]@="{25336920-03F9-11cf-8FD0-00AA00686F13}"
[HKEY_CLASSES_ROOT\htmlfile\DefaultIcon]@=hex(2):25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,\  00,73,00,25,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,65,00,74,00,20,00,\  45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,00,65,00,78,00,70,\  00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,2d,00,31,00,37,00,\  00,00
[HKEY_CLASSES_ROOT\htmlfile\ScriptHostEncode]@="{0CF774D0-F077-11D1-B1BC-00C04F86C324}"
[HKEY_CLASSES_ROOT\htmlfile\shell]@="opennew"
[HKEY_CLASSES_ROOT\htmlfile\shell\open]@="Open in S&ame Window""MUIVerb"="@C:\\Windows\\System32\\ieframe.dll,-5732"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\command]@="\"C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe\" -nohome"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec]@="\"file://%1\",,-1,,,,,""NoActivateHandler"=""
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec\Application]@="IExplore"
[HKEY_CLASSES_ROOT\htmlfile\shell\open\ddeexec\Topic]@="WWW_OpenURL"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew]@="&Open""MUIVerb"="@C:\\Windows\\System32\\ieframe.dll,-5731"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\command]@="\"C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe\" %1"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec]@="\"%1\",,-1,0,,,,""NoActivateHandler"=""
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\Application]@="IExplore"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\IfExec]@="*"
[HKEY_CLASSES_ROOT\htmlfile\shell\opennew\ddeexec\Topic]@="WWW_OpenURLNewWindow"
[HKEY_CLASSES_ROOT\htmlfile\shell\print]
[HKEY_CLASSES_ROOT\htmlfile\shell\print\command]@=hex(2):72,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,\  00,20,00,25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,\  73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,73,00,68,00,74,00,6d,00,6c,\  00,2e,00,64,00,6c,00,6c,00,2c,00,50,00,72,00,69,00,6e,00,74,00,48,00,54,00,\  4d,00,4c,00,20,00,22,00,25,00,31,00,22,00,00,00
[HKEY_CLASSES_ROOT\htmlfile\shell\printto]
[HKEY_CLASSES_ROOT\htmlfile\shell\printto\command]@=hex(2):72,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,\  00,20,00,25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,\  73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,73,00,68,00,74,00,6d,00,6c,\  00,2e,00,64,00,6c,00,6c,00,2c,00,50,00,72,00,69,00,6e,00,74,00,48,00,54,00,\  4d,00,4c,00,20,00,22,00,25,00,31,00,22,00,20,00,22,00,25,00,32,00,22,00,20,\  00,22,00,25,00,33,00,22,00,20,00,22,00,25,00,34,00,22,00,00,00
[-HKEY_CLASSES_ROOT\htmlfile_FullWindowEmbed]
[HKEY_CLASSES_ROOT\htmlfile_FullWindowEmbed]@="HTML Plugin Document""AppUserModelID"="Microsoft.InternetExplorer.Default"
[HKEY_CLASSES_ROOT\htmlfile_FullWindowEmbed\CLSID]@="{25336921-03F9-11CF-8FD0-00AA00686F13}"
[-HKEY_CLASSES_ROOT\SystemFileAssociations\.htm]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.htm]"PerceivedType"="document"
[HKEY_CLASSES_ROOT\SystemFileAssociations\.htm\ShellEx]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.htm\ShellEx\{8895b1c6-b41f-4c1c-a562-0d564250836f}]@="{f8b8412b-dea3-4130-b36c-5e8be73106ac}"
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\OpenWithProgids]"htmlfile"=hex(0):

Wednesday, September 21, 2011

Play Spotify Over Airplay from Mac

How on Earth are we going to do this (for free)?!  Without this feature Spotify is little more than background noise for me.

Potentially useful tools available to us:
MacPorts
DarkIce
IceCast
Jack
Soundflower

I will be noodling this one, feel free to join in!

Wednesday, September 14, 2011

Apple USB-Ethernet Adapter Drivers for Windows 7 64-bit [UPDATED x2]

Through a series of incredibly unbelievable events I ended up needing to use an Apple USB-Ethernet adapter on this fully loaded Alienware M17X laptop running Windows 7 64-bit. The rest of you will probably be approaching this from the much more believable but equally incredible event of installing Boot Camp on your new MacBook Air. Congratulations.

[UPDATE 1/9/2013]
The driver link below has been updated now that MobileMe is dead!

[UPDATE 9/14/2011]
The proper driver is now included in Boot Camp 4.0 from Apple.  At the time of this writing the only way to get 4.0 is to download it from your Mac by running Boot Camp assistant and asking it to download Windows support files.
[/UPDATE]

Originally posted 8/10/2011...
Anyway, why these drivers are so hard to find is beyond me. Here’s the link to them on my iDisk. When iDisk becomes iCloud I will have to update this link, remind me if necessary. Apple USB-Ethernet Win7 64-bit Drivers

The .ini files were modified as taught by: YouGottaBeKiddingYou

Wednesday, September 7, 2011

Enable VNC Server in Mac OS X

This is so easy I can't believe it's taken me this long to find it.  This works for Snow Leopard and Lion as far as I know, though I've only tested it on Lion.

Go this route:
  • System Preferences
  • Sharing
  • Choose "Screen Sharing" and check the box to turn it on
  • Click "Computer Settings..."
  • Enable the "VNC views may control screen with password:" option and give it a password.  Password length is limited to 8 characters.
Now you can connect to and control your Mac from your favorite VNC application, including free versions like Mocha VNC (Lite) for iPhone or Chicken of the VNC for Mac.  I personally use Mocha VNC and it is a very good VNC app for my casual use.  It is surprisingly fast over my home network Wireless-G iPhone 3GS to Gigabit-connected early-2007 iMac, and it works perfect with my iMac's dual monitor setup.  It's the best Spotify "remote" I've found yet.


Tuesday, September 6, 2011

Part 4: Mac OS + Eclipse + OpenOCD + STM32 (ARM Cortex M3)

Intro
I really wanted to program and debug ARM processors from my Mac. This series of entries is a work in progress as I fine tune my setup for regular use.  Be sure to read the full story:
Part 1: Getting Started, what we are going to do and what parts we are going to use.
Part 2: Laying the Foundation, getting all the parts installed.
Part 3: Connecting the Plumbing, hook up all the pieces and run it.
Part 4
: Finishing Touches, troubleshooting and final thoughts.

Finishing Touches
I know that established, commercial software can often have more start-up issues than we care to deal with, especially when dealing with external development hardware.  My experience is that open-source, home-grown, multiple-author, work-on-it-in-my-spare-time, no-warranty-expressed-or-implied solutions are even more difficult.  I hope to someday build an Eclipse plug-in automate all of the things so my company can use a low maintenance open toolchain, but it's not going to happen right now!  Instead, I will show you the troubles that I've seen and the solutions that worked for me.  Deal?  Deal.

OpenOCD External Tool Troubleshooting
Installing OpenOCD
I don't have any comments on installing OpenOCD since the MacPorts installation works so well.

External Tool Configuration Reminders
This setup is pretty easy from the Eclipse perspective since only one tab in the External Tools Configuration screen needs to be populated.  Just be sure that your Location path is absolute and correct for your machine.  Same goes for the paths used in Arguments fields.  If you aren't using an Olimex ARM-USB-TINY-H JTAG or STM32 then be warned that you may need different flags on Arguments command, and that you will need to find the necessary .cfg files for your setup.

Target Connection Errors
A common thing that I ran into initially was not having my target connected and/or powered so OpenOCD couldn't connect.  When running the OpenOCD External Tool from Eclipse I would get error messages in the Eclipse Console that looked like this:

Open On-Chip Debugger 0.4.0 (2011-07-22-14:08)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
1000 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Command handler execution failed
Warn : jtag initialization failed; try 'jtag init' again.
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
error: -100
Command handler execution failed
With a properly connected target you should see something less scary like:
Open On-Chip Debugger 0.4.0 (2011-07-22-14:08)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
1000 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
Info : max TCK change to: 30000 kHz
Info : clock speed 1000 kHz
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1) 
You might also see this displayed when starting OpenOCD:
Error: JTAG-DP_STICKY_ERROR
This doesn't happen all the time, or very often at all, for me, but I have seen it, and it makes it impossible to start debugging when it does happen.  I found a page at TinCanTools that said it is related to an OpenOCD 0.4.0 bug and it can be fixed by simply relaunching OpenOCD (the method I stumbled on) or by changing the OpenOCD launch arguments from:
-f /opt/local/share/openocd/scripts/interface/olimex-arm-usb-tiny-h.cfg -f /opt/local/share/openocd/scripts/target/stm32.cfg -c "init" -c "reset"
to:
-f /opt/local/share/openocd/scripts/interface/olimex-arm-usb-tiny-h.cfg -f /opt/local/share/openocd/scripts/target/stm32.cfg -c "init" -c "reset init" 
I did that and it worked, but then I switched back to the original to test the theory and it still worked.  YMMV.

Debugger Troubleshooting
No source available for ""
This being displayed in the source file area of the Debug Perspective happens for any number of reasons, but its always when something prevented the program download or run from happening properly.  Go through your Console output and look for "Error:" messages.

Error: couldn't open test_rom.hex
This is thrown when the debugger can find your binary file (obviously).  One reason is because you haven't build your program yet, or you did but then you cleaned the project before running the debugger.  Another reason is that in your debugger configuration has the wrong path to your binary file in the "'Run' commands" section of the "Commands" tab.  Your run command should look like the block below, but you need to edit it to reflect the correct relative path to your binary output file.  The location is dependent on your project directory structure and the name of your output files which are dependent on what you called them and if your are compiling for Flash or RAM.  Notice that the "symbol-file" path doesn't require the same path information.  Why? I don't know right now. The two paths I'm talking about are in bold:

monitor soft_reset_halt
monitor wait_halt
monitor poll
monitor flash probe 0
monitor stm32x mass_erase 0
monitor flash write_bank 0 STM32Test2/test_rom.hex 0
monitor soft_reset_halt
symbol-file test_rom.elf
thbreak main
continue
Conclusion
This was fun and I hope you were able to use it for your own work.  Looking back it took quite a long time to figure out and a surprising amount of time to write about...there's a lot to do!  All of this stuff certainly helps you appreciate the simplicity of IAR Embedded Workbench for ARM.

In the future I want to show you how to use IAR sample projects in our new toolchain, and I want to develop a quick-install method or plug-in of some kind to automate all of this work, as well as make it easy to change JTAG and target processor types.  Should be fun!  Please feel free to put questions/corrections/etc in the comments and I'll try to reply quickly.