Author Topic: not able to use flash magic tool in linux ubunt - MCB 2300 board not detected  (Read 16550 times)

u2bpavankumar

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
    • Email
Hi All,

Hope everyone is doing good. I am working on MCB2300 kit on Windows for quite some time. It is working well. But now I need to use the same kit on Linux. I have installed Keil IDE on linux Ubuntu with the help of Wine. IDE is working fine. But problem is with flash magic tool. I have installed Flash Magic also on Linux Ubuntu with the help of WIne. In flash magic GUI, it takes COM 1 but in Linux we don't have COM 1. It takes as ttyS0, ttyS1 etc., I have tried to map ttyS0 to COM 1 with the following command


$ ln -s /dev/ttyS0 ~/.wine/dosdevices/com1

In the above command we cannot give COM 1 and we need to give COM1 only. And in the GUI it will take COM 1, COM 2 etc., So I am not very sure with above mapping, system is able to take ttyS0 as COM 1 or not. Ultimately I am not able to dump the code on kit using the flash magic tool.

I guess someone has already used flash magic on linux successfully. Please help me to get out of this loop.

Thanks in advance

Regards,
Pavan

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
I would have thought that if the COM port mapping was that easy WINE would do it for you?

Can you talk to the bootloader using a terminal program?

Have you tried running Windows in a virtual machine in Linux? That might work better. I think with something like WINE it will always be a struggle in some way.

Andy
« Last Edit: December 15, 2010, 01:10:34 am by Andy Ayre »
Embedded Systems Academy, Inc.
support at esacademy dot com

u2bpavankumar

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
    • Email
Hi Andy,

Thanks for your reply. I cannot communicate with the target (MCB 2300).

Also I have n't tried running Windows in a virtual machine in Linux. Yes I do feel that it might be better. But now I am in a situation that I need to use flash magic tool in Linux ubuntu only.

Please let me know how to map the port name from COM 1 to ttyS0 and how to verify whether system is taking ttyS0 when we select COM 1

Pavan


Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
We don't support Flash Magic in Linux because in 10 years there has never been any significant demand. We get about one request per year which isn't enough to justify the engineering time. If you can get it working then that is great, however if you are facing a deadline then I recommend you switch to Windows as it is known to work and we support it.

Alternatively the ISP commands are documented in the user manual from NXP so as long as you are targeting a single device it should be fairly easy to throw something together quickly in Python. It probably would be quicker than messing around with WINE.

For anyone else reading this if you want Linux support let us know. If we get enough requests then we can look into it.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Anders J

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Well, despite the fact that there is a lot of people out there, the community running FM under XP under VB under ubuntu is not massive ;-)

However, we have done just that and it used to work perfectly. The text needed to give only a brief background is rather lengthy, so instead of repeating it here, please have a look at http://jangoteknik.se/weird-linuxvirtual-boxxpflashmagic-problem/.

Yes, we have tried debug mode and we have read all relevant posts here. The obvious solution is to dig out the little XP netbook and try native XP, but it is so extremely frustrating to know that it worked like a charm only a few days ago and that something then got broken.

To clarify, the sequence ?, Synchronized, 14475 as described elsewhere here behaves like expected she we try it at 9600, but all attempts to get any further using FM fails. As I try again writing this, I actually find that being in debug mode and disabling high speed it is actually programming. Utterly slow, but still...

But you are not alone out there, only almost...
« Last Edit: July 18, 2012, 02:00:01 pm by Anders J »

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Quote
FlashMagic to program NXP CPU’s. This runs under Windows and the preferred platform is of course the well-proven XP.

Firstly a correction to your article: the preferred platform for Flash Magic (for Windows) is Windows 7 (64-bit or 32-bit), Vista or XP, in that order. XP is almost 13 years old now.

Are you saying that Flash Magic used to work in a virtual machine in Ubuntu but now doesn't and you don't know why? But Hyperterminal works perfectly when communicating with the bootloader?

We regularly test Flash Magic in a VMWare Player XP 32-bit virtual machine running in Windows 7 64-bit using a USB to RS232 cable, but we don't test with Linux.

What specific version of Flash Magic fails and what specific version works? If you roll back to the previously working version does it start working again? If not then something has changed in your setup and you will have to start rolling those back.

Have you generated any debug files from Flash Magic from the working and non-working version? That would be the next step.

Andy
« Last Edit: July 18, 2012, 02:01:50 pm by Andy Ayre »
Embedded Systems Academy, Inc.
support at esacademy dot com

Anders J

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
So nice to get a response, thanks!

Yes, it used to work so well. But there are so many variables and so many updates so it would be very simple if it was easy to pick a combination that works. Perhaps a 10.10 install may solve the problem...

But thanks to the information here in different posts I now realize that there is some kind of functionality, I will keep experimenting and will let you know.

I also realize that supporting anything else than Windows is a bit "off topic", but then again, it should work, shouldn't it?

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Yes, I believe it should work.

Note that we also have a Mac OSX version as well.

Another thing to try is a fresh XP virtual machine.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Anders J

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
No, the Mac OS version is not for 2387 ;-(

However, I just once succeeded to get response on the "?, Synchronized..." and I only twice got the sequence going using 9600 b/s + debug and probably failed the other 98!

I think it may be a faster to give it all up and dig out the netbook, it takes too many attempts to try to figure out some kind of repeatability. At this moment I have no clue at all why it has worked a couple of times.

Will give to another try tomorrow. There may be something about timing, though. Perhaps disconnecting the 1920 x 1080 screen will improve things?

Edit: After a good night's sleep thinking about it: Since I do not get the expected response from the board when I feed it with the 9600 b/s "?"<CR><LF> sequence, well, that tells me that the problem is not at all FlashMagic. The next step would obviously be to connect an oscilloscope and find out what is actually showing up on these pins. After all, 3 bytes, including stop and start bits, is only 30 bit times and it is not too difficult. It may very well be that the problem is more centered around the FTDI Linux driver...
« Last Edit: July 18, 2012, 11:16:25 pm by Anders J »

Anders J

  • Jr. Member
  • **
  • Posts: 4
    • View Profile
Solved!
« Reply #9 on: September 28, 2012, 12:01:48 am »
...but then the end is, well, a good story.

So, at the same time I upgraded my Linux machine to the 12.04-based Mint Maya/Cinnamon, I also did some external cleaning up outside my lab. Part of that was getting rid of a 230 V extension cable and connecting the electric fence unit to an outlet just beside my window.

The same outlet that also power my lab equipment...

And there you have it, as I slowly went back in my trace, everything works like a charm, 12.04LTS/Mint Maya/Cinnamon/VB/XP/FlashMagic!

So thanks for reading, this took me too much time and frustration.

Horses are dangerous!

(and the fence will be powered from another building)

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2160
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: not able to use flash magic tool in linux ubunt - MCB 2300 board not detected
« Reply #10 on: September 28, 2012, 12:10:58 am »
Yay - thanks for letting us know you solved it - and how!

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com