capiman / lpc21isp

lpc21isp - Portable command line ISP for Philips LPC family and Analog Devices ADUC70xx
68 stars 57 forks source link

Auto reboot (with -control options) #19

Open vanbwodonk opened 8 years ago

vanbwodonk commented 8 years ago

I think is easier if the chip do auto reboot after finishing downloading. Is it possible? Maybe i miss some options to do that. I did little hack for auto reboot. More like Arduino now.

In lpc21isp.c line 2402 `

ifdef LPC_SUPPORT

    case NXP_ARM:
        downloadResult = NxpDownload(IspEnvironment);
        ResetTarget(IspEnvironment, RUN_MODE);
        break;

endif

` Adding ResetTarget(IspEnvironment, RUN_MODE) after download is done.

domenpk commented 7 years ago

This should already happen (and does happen for me).

Is something failing for you? How are you using lpc21isp?

#ifdef LPC_SUPPORT
        case NXP_ARM:
            downloadResult = NxpDownload(IspEnvironment);
            break;
#endif

#ifdef AD_SUPPORT
        case ANALOG_DEVICES_ARM:
            downloadResult = AnalogDevicesDownload(IspEnvironment);    // <-- download happens here
            break;
#endif
        }

        if (downloadResult != 0)     // <-- does it maybe fail for you?
        {
            CloseSerialPort(IspEnvironment);
            exit(downloadResult);
        }
    }

    if (IspEnvironment->StartAddress == 0 || IspEnvironment->TerminalOnly)   // <-- do these checks fail for you?
    {
        /* Only reset target if startaddress = 0
        * Otherwise stay with the running program as started in Download()
        */
        ResetTarget(IspEnvironment, RUN_MODE);
    }