Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - JamesM

#1
General / Re: Unsupported Operation?
June 23, 2020, 03:28:14 PM
Thank You Andy - That works fine
#2
General / Unsupported Operation?
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



#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);
}