SSD’s firmware version might be really important

I had a good old Asus EEE 1005HA netbook running Windows 7 just fine, albeit slow. The best way of speed it up was to upgrade it to a SSD. The I/O difference should speed it up considerably as the original disk was a 5400rpm one. The SSD prices are low enough, too.

So I went and bought a small, reasonably priced OCZ Vertex Plush 60GB SSD. The disk replacement process isn’t a very simple one because the disk is buried in the guts of the netbook. See one and two (there are more videos, just google them) and be careful with the connectors as they are really fragile.

I’ve replaced the disk, put everything back together and then booted Windows 8 x86 from an USB stick (the easiest way to burn an ISO to an USB stick is to use Windows 7 USB/DVD Download tool). Everything went smooth until Windows finalized the setup. Bam. I’ve got an “Windows couldn’t configure hardware on this device” error (very helpful description, isn’t it). After restart the computer didn’t boot but rather complained about missing boot disk. Huh? That’s odd and when Windows install fails it has to do with hardware issues usually – this time it hinted some sort of problems related to the SSD. Perhaps the problem lies in the Intel Atom CPU or something other on my netbook. Hence I’ve tried installing Windows 7 x86 as I knew it works. Bam. The same error. Changing BIOS settings didn’t help either. Same error over and over again. I’ve also got odd errors during partition management. BTW I’d really like to know which genius at Microsoft thought of requiring the Windows license key before OS is installed (yes, yes, you have to retype it each try you make, very annoying in such cases). Just for fun I tried installing Ubuntu and, surprisingly, I had no problems and everything was really smooth. At this point I was tempted to leave it with Ubuntu but I had other requirements and had to have Windows.

Then I started googling around if somebody experienced similar problem and after a while I’ve come to a forum thread where they mentioned very faulty OCZ Vertex Plus firmware. According to that thread older (than the latest 3.55) firmware versions have fatal issues with Windows. Only the latest and newest 3.55 should work. Coming from HDD world I never thought that a disk firmware could create such havoc but it fitted the description of my problems. Note that there is no easy way to check the disk’s firmware version without the OS installed (and even then). Anyway, there is an ISO you have to burn to a CD and boot computer from there (beforehand make sure the SSD is in IDE, not AHCI mode). The ISO is linux based and you’d need an utility to burn it to USB stick (netbooks don’t have CD drives usually). Free UNetbootin does the work just fine.

Once I’ve booted from firmware upgrade USB stick I discovered that my SSD was running firmware version 3.50. Bingo. Update went smoothly and after yet another Windows 8 reinstall everything worked as it should.

Burning a bootloader to a (Arduino’s) Atmega CPU

One of the many uses of an Arduino board is using it as an ISP (In-System Programmer). Which means burning bootloaders or programs without use of a bootloader directly to the ATmega CPU.

Why would somebody need to do that? Here is a real example.

I bought a 9 Degrees of Freedom Razor IMU a while ago. It is an Arduino compatible microcontroller with sensors in reality. Anyway, a small batch of these came with the wrong bootloader and I was lucky to get one of these. So, instead of sending it back and getting a new one I’d chose a simpler way. Burn the proper bootloader. There are ISPs out there that do the job just fine but for me it was an one time gig, thus I decided to go with an Arduino Mega ADK (which I have and I’ll refer to it simply as MegaADK) as an ISP.

A word of caution. This procedure worked for me. You might have a different hardware and it might not work well for you.

How to

  1. Download ArduinoISP sketch that lives in Examples folder of Arduino IDE (using latest version – 1.0) to MegaADK.
  2. Connect MegaADK and Razor through SPI. (note: You will need to solder some pins to enable SPI on Razor). Pin 1 on Razor is marked with a white line (here you can find a diagram for SPI header).
    Connect (from MegaADK to Razor) MISO->MISO, MOSI->MOSI, SCK->SCK and SS->RESET. Power for Razor is brought through USB (using 3.3V FTDI Basic Break board) but you can use other power sources.

    razor
    Razor with marked pin 1 (blue) and SPI header (yellow)
    (original photo taken from Sparkfun)
  3. Using Arduino IDE select Tools/Programmer/Arduino as ISP and a target Tools/Board, which is Arduino Pro or Pro Mini (3.3V, 8Mhz) w/ ATmega328 in my case since ATmega328p is used on Razor.
  4. If everything worked properly you’d hit Tools/Burn Bootloader. But there is a bug in Arduino libraries that come with version 1.0. For some reason you have to find HardwareSerial.cpp source file (located in [Arduino setup folder]\hardware\arduino\cores\arduino. Edit the 43th line which goes like "#define SERIAL_BUFFER_SIZE 64” to “#define SERIAL_BUFFER_SIZE 128”. If the buffer isn’t set to 64 the burn process will most probably stop when it tries to burn data pages with error like this:
    avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
  5. Hit the Tools/Burn Bootloader and wait for half a minute and there you go, a fresh bootloader is burned to the Razor and it can be programmed using classic Arduino way again.

Photo of my setup:

IMG_0424

On the left is Razor, on the centre is Arduino Mega ADK and on the right is a bread board for three LEDs that signal the status of the ISP (green, red and yellow signalling the burning in progress).

Using Arduino BT

I think that it is quite possibly to use the Arduino BT (Bluetooth version). I am mentioning BT version because it has an interesting quirk and a feature.

Reset pin

A program mode LED mentioned above is attached by default to pin 7. The problem is that pin 7 on BT version is used to reset the bluetooth module and shouldn’t be used for anything else. Even if you don’t connect the LED it will reset the bluetooth module and thus drop the connection between Arduino IDE and ArduinoBT once the burn process begins.

The remedy is quite simple. Before downloading ArduinoISP sketch to the ArduinoBT (step 1) you should modify the sources by changing the pin used for signalling the program mode. There are two occurrences:

#define LED_PMODE 7 and the other in void setup() procedure (not sure why the later isn’t using the former). Change number 7 to any other suitable pin and the Bluetooth connection won’t drop anymore.

Serial port speed

Bluetooth communication in ArduinoBT is supposed to run at 119200 bauds, but the ArduinoISP sketch is using 19200 bauds. Simply change the value in void setup() procedure to Serial.begin(119200);

There you go, ArduinoBT is a functioning ISP now.

Hope this article will help somebody.

A workaround to a problem when upgrading BlogEngine from 2.0 to 2.5

During the BlogEngine upgrade from 2.0 to 2.5 (one that hosts this blog) I’ve come across a problem. The problem might happen during execution of the SQL Server upgrade scripts that come with BlogEngine 2.5.

After running the scripts I’ve got an error mentioning that constraint FK_be_PostComment_be_Posts can’t be enforced. Huh? After some experimenting I’ve seen that the 2.0 database isn’t exactly well enforced with constraints and I had some comments left that don’t belong to any of the posts (I guess I’ve deleted the posts but comments were still there because database didn’t enforce the constraints and BlogEngine didn’t delete them).

Here is what I’ve did to upgrade.

1. In the upgrade script comment this statement:

       1: ALTER TABLE dbo.be_PostComment
       2:   ADD CONSTRAINT FK_be_PostComment_be_Posts FOREIGN KEY (BlogID, PostID) REFERENCES dbo.be_Posts (BlogID, PostID)
       3: GO

2. Run the upgrade script.

3. (Optional) To find if any comment is parentless execute this SELECT statement

   1: SELECT * FROM dbo.be_PostComment WHERE postid NOT IN (SELECT postid FROM be_posts)

4. Delete the orphaned comments

   1: DELETE FROM dbo.be_PostComment WHERE postid NOT IN (SELECT postid FROM be_posts)

5. Run the statement from upgrade script that you’ve commented in #1.

That’s it. I guess you could delete orphaned comments even before running the upgrade script and thus avoid first and last step.

Observation: Looks like at least database in version 2.0 wasn’t very well enforced, hopefully 2.5 rectifies this problem (it adds constrains here and there). Don’t forget, database is the last defense tier against bad data and should be as much protected as it can be.

Surfing the Croatia

If you are an Internet addict and can’t live without it even on vacation in Croatia then here is a cheap solution. Forget about roaming because it is insanely expensive (the stupid discussions in EU were all about SMS prices, not a word on data connection prices, though it wouldn’t matter in Croatia anyway). Luckily there is VIP mobile provider which offers prepaid data plans which are not expensive at all – compared to roaming that is. Here is what you need:

1. Check VIP coverage of the are you are going – coverage map. I was on the “edge” of HSDPA – thus I had to use Edge.

2. Next, find a VIP points of sale for VIP broadband SIM card. It should list Vipme under offers I think. Note: not all points of sales have those, specially smaller ones.

3. When in Croatia, find selected point of sale and buy a Vipme broadband box (SIM card only – 20 HRK*) or Vipme Broadband USB stick (149 HRK) if you have a laptop. Since I have a WiFi tethering enabled Android Samsung Galaxy S phone I went with former. 20 HRK were automatically added to my account as well.

4. The default data price is 1 MB/1 HRK which is still expensive. That’s why you should go with options:

  • 50 MB/25 HRK
  • 300 MB/91 HRK
  • 1 GB/191 HRK

5. Once you’ve picked an option that suits you (I went with 300MB/91 HRK which I’ve planned to consume in 10 days) you have to buy enough coupons. In my case I had to buy a coupon for 100 HRK. Perhaps I could buy 20 less but I wanted to be on the safe side. Note that an option is valid for 30 days or something like that, not sure about coupons.

6. Put the SIM into the phone and create an APN**: data.vip.hr. Here I had some problems with my phone, finally I’ve found a working combination – add APN, save it, restart the phone. Not sure what went wrong though, I just played with restarts and APNs until it started working.

7. Open internet browser and go to http://vipmevmc.vipnet.hr (remember that you are using 1 MB/1 HRK at this point). Enter you coupon code, so 100 HRKs are added to the account. Activate the 300MB option (or whicever you want) through the website as well. After I’ve confirmed my option I was notified that the option is going to be enabled within a working day, but in reallity it was activated in an hour or less.

8. That’s it. I was fully internet connected at this point. Then I enabled Mobile AP feature of my Samsung Galaxy S which does tethering over WiFi - Saša’s iPhone and laptops were connected without any problem through WiFi.

Happy surfing in Croatia

* HRK to EUR converter (other currencies supported)

** Full APN specs:

Name: Internet
APN: data.vip.hr
Proxy: 212.91.99.91
Port: 8080
Username: not set
Password: not set
Server: not set
MMSC: not set
MMSC proxy: not set
MMS port: not set
MMC: 219
MNC: 10
APN type: Internet
Authentification Type: None

Surfing the Croatia

If you are an Internet addict and can’t live without it even on vacation in Croatia then here is a cheap solution. Forget about roaming because it is insanely expensive (the stupid discussions in EU were all about SMS prices, not a word on data connection prices, though it wouldn’t matter in Croatia anyway). Luckily there is VIP mobile provider which offers prepaid data plans which are not expensive at all – compared to roaming that is. Here is what you need:

1. Check VIP coverage of the are you are going – coverage map. I was on the “edge” of HSDPA – thus I had to use Edge.

2. Next, find a VIP points of sale for VIP broadband SIM card. It should list Vipme under offers I think. Note: not all points of sales have those, specially smaller ones.

3. When in Croatia, find selected point of sale and buy a Vipme broadband box (SIM card only – 20 HRK*) or Vipme Broadband USB stick (149 HRK) if you have a laptop. Since I have a WiFi tethering enabled Android Samsung Galaxy S phone I went with former. 20 HRK were automatically added to my account as well.

4. The default data price is 1 MB/1 HRK which is still expensive. That’s why you should go with options:

  • 50 MB/25 HRK
  • 300 MB/91 HRK
  • 1 GB/191 HRK

5. Once you’ve picked an option that suits you (I went with 300MB/91 HRK which I’ve planned to consume in 10 days) you have to buy enough coupons. In my case I had to buy a coupon for 100 HRK. Perhaps I could buy 20 less but I wanted to be on the safe side. Note that an option is valid for 30 days or something like that, not sure about coupons.

6. Put the SIM into the phone and create an APN**: data.vip.hr. Here I had some problems with my phone, finally I’ve found a working combination – add APN, save it, restart the phone. Not sure what went wrong though, I just played with restarts and APNs until it started working.

7. Open internet browser and go to http://vipmevmc.vipnet.hr (remember that you are using 1 MB/1 HRK at this point). Enter you coupon code, so 100 HRKs are added to the account. Activate the 300MB option (or whicever you want) through the website as well. After I’ve confirmed my option I was notified that the option is going to be enabled within a working day, but in reallity it was activated in an hour or less.

8. That’s it. I was fully internet connected at this point. Then I enabled Mobile AP feature of my Samsung Galaxy S which does tethering over WiFi - Saša’s iPhone and laptops were connected without any problem through WiFi.

Happy surfing in Croatia

* HRK to EUR converter (other currencies supported)

** Full APN specs:

Name: Internet
APN: data.vip.hr
Proxy: 212.91.99.91
Port: 8080
Username: not set
Password: not set
Server: not set
MMSC: not set
MMSC proxy: not set
MMS port: not set
MMC: 219
MNC: 10
APN type: Internet
Authentification Type: None