Author Topic: LPC11C14 CAN .NET Library  (Read 62 times)

b_bann

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
    • Email
LPC11C14 CAN .NET Library
« on: November 07, 2017, 02:20:35 am »
Could you please point me at a working example / documentation for using the .NET libraries to program over CAN.

The following code produces the Error : Operation Failed. reading signature (ERROR_CMD)

Code: [Select]
ESA.FlashMagic.ARMCAN.FlashMagicARMCAN Flash = new ESA.FlashMagic.ARMCAN.FlashMagicARMCAN();
            Flash.SelectDebugMode(ESA.FlashMagic.Common.DebugModes.ON, "C:/Data/FMdebug.fmd");           
            ESA.FlashMagic.Common.CANOptions opt = new ESA.FlashMagic.Common.CANOptions();

            opt.selecteddevice = ESA.FlashMagic.Common.Devices.LPC11C14301CAN;
            opt.interfacetype = ESA.FlashMagic.Common.CANInterfaces.PEAKUSB;
            opt.nodeid = 0x7D;
            opt.sdotimeout = 1000;
            opt.baudrate = 125;

            int n = 0;
            try
            {
                n = Flash.Connect(opt);
                string s = Flash.ReadSignature();
                MessageBox.Show(s);
            }
            catch (ESA.FlashMagic.Common.FMException Exc)
            {
                MessageBox.Show(Exc.ToString(), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            if (n != 0)
            {
                Flash.Disconnect();
            }

Debug File :

Code: [Select]
debug> FlashMagicARMCAN Driver, Version 3.35.4841
debug> Windows version = <unknown> (6.3) build 9600,
debug> General configuration:
debug> Node ID = 0x7D
debug> SDO timeout = 1000 ms
debug> Nom Baudrate = 125 kbps
debug> Data Baudrate = 0 kbps
debug> Hardware config = 0x00000000, 0x00000000
debug> Device = LPC11C14/301
debug> Client aborted - 0x05040000
debug> Client aborted - 0x05040000
debug> Client aborted - 0x05040000
debug> Client aborted - 0x05040000
debug> Client aborted - 0x05040000
debug> Client aborted - 0x05040000

Dlls in application folder :

FlashMagicARMCANNET
FlashMagicCommonNET
FlashMagicARMCAN
ESACANopenPro
FlashMagic


The standalone FM gui connects and reads the device signature, so the hardware seems OK.

Any guidance gratefully received.

  Bob





Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2121
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: LPC11C14 CAN .NET Library
« Reply #1 on: November 08, 2017, 12:37:41 am »
Can you please post a recording of the CAN messages on the bus. It looks like the bootloader is not responding.

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

b_bann

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
    • Email
Re: LPC11C14 CAN .NET Library
« Reply #2 on: November 08, 2017, 01:20:32 am »
SOLVED : User error : RTFM.

That bootloader requires a speed of 100k rather than the 125k I was attempting.

Everything is OK now.

Thanks for your help.