lpc21isp icon indicating copy to clipboard operation
lpc21isp copied to clipboard

Auto reboot (with -control options)

Open vanbwodonk opened this issue 9 years ago • 1 comments

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.

vanbwodonk avatar May 27 '16 03:05 vanbwodonk

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

domenpk avatar Nov 22 '16 21:11 domenpk