Author Topic: Unsupported Operation?  (Read 3618 times)

JamesM

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Unsupported Operation?
« on: June 23, 2020, 11:33:11 AM »
I am using C++ Builder XE6. I have linked with the Borland C++ 5 DLLs. However, when I run the following code, fm_connect returns "Device does not support operation. Only COM connections supported."

I must be missing something obvious? Thank you in advance for any help - James


Code: [Select]
#include "flashmagicarmcortex.h"

//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  fm_results *presults;
  presults = fm_version();

  fm_connectoptions_com options;

  fm_set_default_timeouts();

  options.osc               = 12.000;
  sprintf_s(options.comportname, FM_MAXCOMPORTNAMELEN, "COM%d", 5);
  options.baudrate          = 115200;
  options.selecteddevice    = FM_LPC1758;
  options.highspeed         = 0;  //1;
  options.clocks            = 0;
  options.halfduplex        = 0;
  options.hwconfig          = FM_HWBOOTEXEC;
  options.hwt1              = 200;
  options.hwt2              = 200;
  options.i2caddr           = 0;
  options.maxbaudrate       = 115200;
  options.usinginterface    = 0;
  options.interfacetype     = FM_INTERFACETYPE_NONE;
  options.flashbank         = 0;
  options.protocoloptions   = FM_PROTOCOLCOM_AUTOLF;
  options.postopendelay     = 0;
  options.bootloaderpath[0] = NULL;

  presults = fm_connect(&options, sizeof(options));

  if (presults->result != FM_OK)
ShowMessage(presults->details);
}

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Unsupported Operation?
« Reply #1 on: June 23, 2020, 12:25:01 PM »
I don't know which version you are using, however:

Use the Microsoft DLLs
Use implib to generate Borland-compatible lib files from the Microsoft DLLs
Make sure the header files and the DLLs come from the same version.

Please post back if that does not help.

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

JamesM

  • Jr. Member
  • **
  • Posts: 2
    • View Profile
Re: Unsupported Operation?
« Reply #2 on: June 23, 2020, 03:28:14 PM »
Thank You Andy - That works fine