FlashMagic on Linux using wine

After long time, I found some time to work on my new P89V51RD2 (8051 MicroController from NXP) kit. NXP provides FlashMagic tool to flash the assembled HEX file. Unfortunately this tool is available only for MS-Windows versions. Since I am using only Linux for all my home works,  for last few months I had been trying to make it work with Linux using wine (Windows Emulator). Today I found it is succesfully flashing. I am using FlashMagic version 4.33. Fine, let us see how to get it done?

Setup

  • P89V51RD2 based Microcontroller kit from Emblitz
  • FlashMagic 4.33 – Previous versions are not working (atleast for me)
  • OpenSUSE 11.0 (linux kernel 2.6.25)
  • Wine 1.0-rc3

Procedure

1. Ensure that wine is installed on your linux machine.

2. Download FlashMagic (only Windows version) from this site.

3. Install the FlashMagic ($wine FlashMagic.exe). Follow the installation wizard and get it installed.

4. Ensure that your login has permission to use serial port (which you use to communicate with kit for flashing). Mostly you may have to be a member of uucp group.

5. Run FlashMagic ($wine ~/.wine/drive_c/Program Files/Flash Magic/FlashMagic.exe)

Running FlashMagic on OpenSUSE linux

Running FlashMagic on OpenSUSE linux

6. Set the Step-1 Communications section parameters as per your Kit’s requirement.

7. For me, this setting was not enough to get it done. I had to do the following settings also.

Options -> Advanced options -> Hardware config -> Use DTR to control RTS should be unchecked.

Options -> Advanced options -> Hardware config -> Assert DTR and RTS while COM Port open should also be unchecked.

Advanced configuration settings

8. Then to ensure that FlashMagic successfully communicates with Kit, read the signature of Microcontroller using ISP -> Read Device Signature option. It may ask you to reset the kit in ISP mode; do it as per your kit. If you are able to read the signature, you will be able to flash the chip.

Reading the device signature may need a ISP reset

Successfully read Device Signature

Enjoy the world of chips and l-o-w l-e-v-e-l languages happily!





More posts in this category


10 Comments on “FlashMagic on Linux using wine”

You can track this conversation through its atom feed.

  1. Rohan says:

    Thanks for giving this info for downloading a .hex file.
    But,i am using Laptop and it have no serial port. SO, i am using USB to Serial cable.Can you tell me how to select USB cable in the COM port as well how can i know which port i had to select..

    1. swamytk says:

      Hi Rohan,
      1. Once you plug-in USB-Serial converter, run “dmesg” in command line. At the end, you will see which device your converter mapped. It is something like (e.g. ttyUSB0). This device node file should be available under /dev or its sub-directory. Find it out and note down.
      2. Ensure that you have rw permission for that device. Otherwise add your user in that group (don’t change the permission, once you restart you may lose this permission settings. Device detection and node creation are taken care by the udev during startup!)
      3. Now create a symbolic soft link to this ttyUSB0 in your ~/wine/dosdevices/ as com1 as given below. Execute this command as normal user (not root). It is something like given below.

      ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1

      4. In Flash Magic select COM1 (if you have mapped com1) as your device. that is all man!

  2. Rohan says:

    Thanks….
    As, you told me i have done all the setting, but still i am not able to communicate with my target.
    I am getting the error..
    Unable to Communicate.(configuration)Ensure no other applications are using the COM port……
    i m not using any other application with COM port also….

  3. revanth says:

    i am very delighted to use know about this,i use open suse for all my needs but only for 8051 related things,i have to switch back to windows,if this works for me,i’l forget windows.

    i tried the steps,i downloaded flashmagic,but when i give,wine FlashMagic.exe on bash,i get the following error,how to solve this,please help,
    wine: could not load L”C:\\windows\\system32\\FlashMagic.exe”: Module not found

  4. revanth says:

    i found the solution,its working fine, thanks for the idea,
    linux rocks…

    Jai Hind

  5. T. Nickerson says:

    I believe I have been hearing about Kindle in general terms for a year or so. The only time it really became an item of interest was when I saw it on an AT

  6. naz says:

    As, you told me i have done all the setting, but still i am not able to communicate with my target.
    I am getting the error..
    operation failed:failed to auto baud step1..

    1. swamytk says:

      Your case may be different from me… try to work around the various settings in the tool – that is how I got it done :-)

  7. viswanath says:

    dude.. thanks a lot man.. ur a life saver!!

  8. darkore says:

    Thanks! Working like a charm. Yet another good reason not to boot Windows at all, not even from VBox :)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

RSSSubscribe to Comments on this post



Educate Elevate!

Well said!

If you have to gain all these other "soft skills" or business skills in order to just be a regular software engineer, then why keep working for someone else? One of the main reasons for being an employee is because it's (supposed to be) both easier and safer than striking out on your own. Instead of long hours and having to wear many hats, you can just concentrate on your own skill, and leave the business stuff to the people who specialize in that. Anyone familiar with the idea of specialized labor should understand this. The downside is (supposed to be) your pay is lower than it could potentially be by owning and operating your own business. If today's corporations want their regular rank-and-file employees to wear many hats, be multi-talented, and have a lot of business skills, then they're simply not doing their own jobs correctly. - Grishnakh (Slashdot user)

Archives

Google Page Rank

Creative Commons License
Black God by KaruppuSwamy Thangaraj is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at www.karuppuswamy.com.
Permissions beyond the scope of this license may be available here