Fail to Connect to LPC1752

Started by simonchin, August 15, 2012, 08:34:36 PM

Previous topic - Next topic

simonchin

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,



Andy Ayre

Did you change the DLL being used from FlashMagicARM.dll to FlashMagicARMCortex.dll?

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

simonchin

Hi Andy,

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

thanks and regards,

simonchin

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,







Andy Ayre

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
Embedded Systems Academy, Inc.
support at esacademy dot com

simonchin

In debug mode, _fm_serial_number return back hex value of 0x00af207c.
Is it correct?? Or should i do some convertion here?

Andy Ayre

The function returns a pointer to a RESULTS structure. You should access that. Please see the description of the function in the manual.

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

simonchin

#7
Attach with the code & error captured when calling api serial_number.

Andy Ayre

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
Embedded Systems Academy, Inc.
support at esacademy dot com