Flash Magic Forum

In-System Programming Support => LPC2xxx => Topic started by: LittleBit on July 12, 2018, 12:27:15 am

Title: LPC2294 .NET Cant Connect
Post by: LittleBit on July 12, 2018, 12:27:15 am
Hello everyone

Currently i try to automate the Programming of a LPC2294 with the .NET Library from Flash Magic. When i use the FM Program with the GUI everything works fine, the device responds and can be programmed but with the .NET Library i cant connect to the Device. Even modifying the parameters described in this Post http://forum.flashmagictool.com/index.php?topic=3273.0 (http://forum.flashmagictool.com/index.php?topic=3273.0) didnt help.

Am i missing a difference in the Configuration or something important to consider?

Here is the C# Code to Connect (not working)
Code: [Select]
            try
            {
                //Set up Connection Parameters
                COMOptions comOptions = new COMOptions();
                comOptions.selecteddevice = Devices.LPC2294;                                                //Processor Type
                comOptions.port = "COM32";                                                                  //COM Port
                comOptions.baudrate = 115200;                                                               //Baudrate
                comOptions.highspeed = 0;                                                                   //Use MaxBaudrate
                comOptions.maxbaudrate = 115200;                                                            //Max Baudrate
                comOptions.interfacetype = Interfaces.NONE;                                                 //None required
                comOptions.osc = 14.7456;                                                                   //Processor Oscillator
                comOptions.bootloaderpath = @"H:\idden\due\to\company\rules.hex";                           //Hard coded, get from Settings later
                comOptions.halfduplex = 0;                                                                  //We do not use half duplex
                comOptions.hwt1 = 50;                                                                       //DTR RTS Assert time
                comOptions.hwt2 = 100;                                                                      //DTR RTS Deassert time
                comOptions.protocoloptions = ProtocolOptions.AUTOLF;                                        //Let Flash Magic Handle LF
                comOptions.hwconfig = HardwareConfigurations.BOOTEXEC;                                      //HW Boot and DTR/RTS handle RST/ISP
                comOptions.clocks = 0;                                                                      //Ignored when highspeed = 0  (manual recommends setting to 0 when using ARM)
                comOptions.postopendelay = 0;                                                               //0 because we have no problem with missing data
                comOptions.interfaceserialnumber = String.Empty;                                            //Not used, set to empty
                comOptions.flashbank = 0;                                                                   //Not used, default is 0
                comOptions.usinginterface = 0;                                                              //0 no HW Interface used

                FlashMagicARMCortex cortex = new FlashMagicARMCortex();
                cortex.Connect(comOptions);                                                                 //Throws Exception
            }
            catch (FMException ex)
            {
                Console.WriteLine(ex.Message);         
            }

which throws the Exception
Code: [Select]
Exception thrown: 'ESA.FlashMagic.Common.FMException' in FlashMagicARMCortexNET.dll
Invalid value or command sent. Please try the operation again. (device not found)

The Flash Magic Settings used with the GUI Program are attached (they are working fine)
Title: Re: LPC2294 .NET Cant Connect
Post by: Andy Ayre on July 17, 2018, 06:18:00 am
LPC2294 is an ARM7 not an ARM Cortex device. You are using the wrong .NET assembly.
Title: Re: LPC2294 .NET Cant Connect
Post by: LittleBit on July 17, 2018, 07:22:55 am
Thank you, with the right assembly its working fine.