finally its working with JLinkGDBServer

This commit is contained in:
2021-12-09 21:00:22 +01:00
parent b47ce37955
commit 1c16e903fd
6 changed files with 29 additions and 13 deletions

View File

@ -14,6 +14,21 @@ Purpose : J-Link target setup file for VORAGO VA416xx
---------------------------END-OF-HEADER------------------------------
*/
int DisableRomProt(void) {
JLINK_SYS_Report("VA416XX: Disabling ROM protection");
return JLINK_MEM_WriteU32(0x40010010, 0x1); // ROM_PROT = 0x1
}
int DisableWatchdog(void) {
JLINK_MEM_WriteU32(0x400210C0, 0x1ACCE551); // WDOGLOCK = 0x1ACCE551
JLINK_MEM_WriteU32(0x40021008, 0x0); // WDOGCONTROL = 0x0 (diable)
}
int SetupTarget (void) {
JLINK_SYS_Report("SetupTarget()");
return DisableRomProt(); // ROM_PROT = 0x1
}
/*********************************************************************
*
* AfterResetTarget
@ -21,9 +36,8 @@ Purpose : J-Link target setup file for VORAGO VA416xx
int AfterResetTarget (void) {
JLINK_SYS_Report("AfterResetTarget()");
// disable watchdog and unlock code RAM for write
JLINK_MEM_WriteU32(0x400210C0, 0x1ACCE551); // WDOGLOCK = 0x1ACCE551
JLINK_MEM_WriteU32(0x40021008, 0x0); // WDOGCONTROL = 0x0 (diable)
return JLINK_MEM_WriteU32(0x40010010, 0x1); // ROM_PROT = 0x1
DisableWatchdog();
return DisableRomProt(); // ROM_PROT = 0x1
}
/*********************************************************************
@ -32,7 +46,7 @@ int AfterResetTarget (void) {
*/
int BeforeTargetDownload (void) {
JLINK_SYS_Report("BeforeTargetDownload()");
return JLINK_MEM_WriteU32(0x40010010, 0x1); // ROM_PROT = 0x1
return DisableRomProt(); // ROM_PROT = 0x1
}
/*********************************************************************
@ -41,7 +55,7 @@ int BeforeTargetDownload (void) {
*/
int AfterTargetDownload (void) {
JLINK_SYS_Report("AfterTargetDownload()");
return JLINK_MEM_WriteU32(0x40010010, 0x0); // ROM_PROT = 0x0
return DisableRomProt(); // ROM_PROT = 0x0
}
/*********************************************************************
@ -50,7 +64,7 @@ int AfterTargetDownload (void) {
*/
int HandleBeforeFlashProg(void) {
JLINK_SYS_Report("HandleBeforeFlashProg()");
return JLINK_MEM_WriteU32(0x40010010, 0x1); // ROM_PROT = 0x1
return DisableRomProt(); // ROM_PROT = 0x1
}
/*********************************************************************
@ -59,5 +73,5 @@ int HandleBeforeFlashProg(void) {
*/
int HandleAfterFlashProg(void) {
JLINK_SYS_Report("HandleAfterFlashProg()");
return JLINK_MEM_WriteU32(0x40010010, 0x0); // ROM_PROT = 0x0
return DisableRomProt(); // ROM_PROT = 0x0
}