[PATCH] LPC2ISP 1.64 Uprava resetovaci funkce

Nevim proc ale od nejake doby mi prestalo fungovat preprogramovani procesoru pomoci LPC2ISP s FTDI prevodnikem. Asi to ma neco spolecneho s tim, ze nyni nefungujou nove verze s FTDI prevodnikem. Vytvoril jsem jednoduchy patch na resetovaci funkci. Prosim aby to jeste nekdo jinej vyzkousel predtim nez se bude patch aplikovat do syslessu. Zaroven upozornuji, ze toto neni oficielni patch. LPC2ISP posledni doubou nejak zkomira. --- arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c | 43 +++++++++++++++------- 1 files changed, 29 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c b/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c index a34b040..9440f32 100644 --- a/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c +++ b/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c @@ -1209,24 +1209,39 @@ void ResetTarget(ISP_ENVIRONMENT *IspEnvironment, TARGET_MODE mode) switch (mode) { /* Reset and jump to boot loader. */ - case PROGRAM_MODE: - ControlModemLines(IspEnvironment, 1, 1); - Sleep(100); - ClearSerialPortBuffers(IspEnvironment); - Sleep(100); - ControlModemLines(IspEnvironment, 0, 1); - //Longer delay is the Reset signal is conected to an external rest controller - Sleep(500); - // Clear the RTS line after having reset the micro - // Needed for the "GO <Address> <Mode>" ISP command to work */ - ControlModemLines(IspEnvironment, 0, 0); - break; - +// case PROGRAM_MODE: +// ControlModemLines(IspEnvironment, 1, 1); +// Sleep(1000); +// ClearSerialPortBuffers(IspEnvironment); +// Sleep(1000); +// ControlModemLines(IspEnvironment, 0, 1); +// //Longer delay is the Reset signal is conected to an external rest controller +// Sleep(5000); +// // Clear the RTS line after having reset the micro +// // Needed for the "GO <Address> <Mode>" ISP command to work */ +// ControlModemLines(IspEnvironment, 0, 0); +// Sleep(5000); +// break; + + + case PROGRAM_MODE: // reset ISP + ControlModemLines(IspEnvironment, 0, 0); // release MCU + Sleep(100); + ClearSerialPortBuffers(IspEnvironment); + Sleep(100); + ControlModemLines(IspEnvironment, 1, 1); // reset MCU + set ISP + Sleep(100); + ControlModemLines(IspEnvironment, 0, 1); // relese MCU and hold ISP + Sleep(500); // give CPU some time + break; + + + /* Reset and start uploaded program */ case RUN_MODE: ControlModemLines(IspEnvironment, 1, 0); Sleep(100); - ClearSerialPortBuffers(IspEnvironment); + ClearSerialPortBuffers(IspEnvironment); Sleep(100); ControlModemLines(IspEnvironment, 0, 0); Sleep(100); -- 1.7.2.2

On Mon, 20 Sep 2010, Jiri Kubias wrote:
Nevim proc ale od nejake doby mi prestalo fungovat preprogramovani procesoru pomoci LPC2ISP s FTDI prevodnikem. Asi to ma neco spolecneho s tim, ze nyni nefungujou nove verze s FTDI prevodnikem. Vytvoril jsem jednoduchy patch na resetovaci funkci.
Prosim aby to jeste nekdo jinej vyzkousel predtim nez se bude patch aplikovat do syslessu. Zaroven upozornuji, ze toto neni oficielni patch. LPC2ISP posledni doubou nejak zkomira.
Cau, ten patch nejde naaplikovat a aktualni verzi: error: patch failed: arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c:1209 error: arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c: patch does not apply
--- arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c | 43 +++++++++++++++------- 1 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c b/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c index a34b040..9440f32 100644 --- a/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c +++ b/arch/arm/mach-lpc21xx/tools/lpc21isp/lpc21isp.c @@ -1209,24 +1209,39 @@ void ResetTarget(ISP_ENVIRONMENT *IspEnvironment, TARGET_MODE mode) switch (mode) { /* Reset and jump to boot loader. */ - case PROGRAM_MODE: - ControlModemLines(IspEnvironment, 1, 1); - Sleep(100); - ClearSerialPortBuffers(IspEnvironment); - Sleep(100); - ControlModemLines(IspEnvironment, 0, 1); - //Longer delay is the Reset signal is conected to an external rest controller - Sleep(500); - // Clear the RTS line after having reset the micro - // Needed for the "GO <Address> <Mode>" ISP command to work */ - ControlModemLines(IspEnvironment, 0, 0); - break; - +// case PROGRAM_MODE: +// ControlModemLines(IspEnvironment, 1, 1); +// Sleep(1000); +// ClearSerialPortBuffers(IspEnvironment); +// Sleep(1000); +// ControlModemLines(IspEnvironment, 0, 1); +// //Longer delay is the Reset signal is conected to an external rest controller +// Sleep(5000); +// // Clear the RTS line after having reset the micro +// // Needed for the "GO <Address> <Mode>" ISP command to work */ +// ControlModemLines(IspEnvironment, 0, 0); +// Sleep(5000); +// break;
A kdyz uz ho budes generovat znovu, nedavej tam ty zakomentovany radky, protoze z toho tvyho patche vubec nevivim co jsi zmenil - musel bych porovnavat radku po radce z tech dvou bloku.
+ + + case PROGRAM_MODE: // reset ISP + ControlModemLines(IspEnvironment, 0, 0); // release MCU + Sleep(100); + ClearSerialPortBuffers(IspEnvironment); + Sleep(100); + ControlModemLines(IspEnvironment, 1, 1); // reset MCU + set ISP + Sleep(100); + ControlModemLines(IspEnvironment, 0, 1); // relese MCU and hold ISP + Sleep(500); // give CPU some time + break; + + + /* Reset and start uploaded program */ case RUN_MODE: ControlModemLines(IspEnvironment, 1, 0); Sleep(100); - ClearSerialPortBuffers(IspEnvironment); + ClearSerialPortBuffers(IspEnvironment);
A tuhle mezeru jsi asi umazal omylem, ne? -Michal
participants (2)
-
Jiri Kubias
-
Michal Sojka