Flash Magic Forum

In-System Programming Support => ARM Cortex => Topic started by: simonchin on August 15, 2012, 08:34:36 PM

Title: Fail to Connect to LPC1752
Post by: simonchin on August 15, 2012, 08:34:36 PM
Hi,
I just get the flash magic production system and minor modify the multiprogrammerARM code to be work on device LPC1752. Somehow it always display unable to connect to device (error -5).
Attach with the code changes:

wprintf(L"MultiProgrammer\nPrograms two devices in parallel.\n");

  // program a device using channel 0, COM 1
  channelconfig.channelnum = 0;
channelconfig.device     = FM_LPC1752; //FM_LPC2378;
...
channelconfig.channelnum = 1;
  channelconfig.comportnum = 41; //3;
  channelconfig.device     = FM_LPC1752;//FM_LPC2129;
...
// connect
  options.osc            = 12.0000;
  sprintf_s(options.comportname, FM_MAXCOMPORTNAMELEN, "COM%d", channelconfig.comportnum);
  options.baudrate       = 115200; //19200;
  options.selecteddevice = channelconfig.device;
  options.highspeed      = 0;
  options.clocks         = 0;
  options.halfduplex     = 0;
  options.hwconfig       = FM_HWBOOTEXEC;//FM_HWNONE;
  options.hwt1           = 50;//120;
  options.hwt2           = 100;//60;
  options.i2caddr        = 0;
  options.maxbaudrate    = 230400;
  options.usinginterface = 0;
  options.interfacetype  = FM_INTERFACETYPE_NONE;
  options.flashbank      = 0;
.
It is working on flash magic window, refer to pic1.

Pic 2 is the error return back..

regards,


Title: Re: Fail to Connect to LPC1752
Post by: Andy Ayre on August 16, 2012, 03:07:52 AM
Did you change the DLL being used from FlashMagicARM.dll to FlashMagicARMCortex.dll?

Andy
Title: Re: Fail to Connect to LPC1752
Post by: simonchin on August 16, 2012, 03:59:17 AM
Hi Andy,

You're right. Different device need to attach with different dll support.

thanks and regards,
Title: Re: Fail to Connect to LPC1752
Post by: simonchin on August 20, 2012, 09:14:16 PM
Hi Andy,
How do i add the progress % during the each DUT program and display the serial number device on every success program (refer attachment pic)??
Do you hv any examples or link, i'm in learning stage of vc++??
Attach with on going codes. I cannot get back the serial number as show in picture

thanks and regards,






Title: Re: Fail to Connect to LPC1752
Post by: Andy Ayre on August 21, 2012, 01:41:11 AM
The progress is passed to program_progress in your code. See the manual for the relevant parameters.

What is the error code being returned when you try to read the serial number?

Andy
Title: Re: Fail to Connect to LPC1752
Post by: simonchin on August 21, 2012, 02:07:33 AM
In debug mode, _fm_serial_number return back hex value of 0x00af207c.
Is it correct?? Or should i do some convertion here?
Title: Re: Fail to Connect to LPC1752
Post by: Andy Ayre on August 21, 2012, 07:54:59 AM
The function returns a pointer to a RESULTS structure. You should access that. Please see the description of the function in the manual.

Andy
Title: Re: Fail to Connect to LPC1752
Post by: simonchin on August 21, 2012, 11:46:22 PM
Attach with the code & error captured when calling api serial_number.
Title: Re: Fail to Connect to LPC1752
Post by: Andy Ayre on August 22, 2012, 01:39:41 AM
The only thing I can see you are doing wrong is that results->details is ASCII, not UNICODE, so you have to use printf instead of wprintf. I will email you my working example.

Andy