va416xx-rs/va416xx-hal/jlink/JLinkSettings.JLinkScript
Robin Mueller 006a3e022c # This is a combination of 17 commits.
# This is the 1st commit message:

init commit

# This is the commit message #2:

smaller fixes for config files

# This is the commit message #3:

update VA416xx flash script file

# This is the commit message #4:

completed UART HAL, added first example

# This is the commit message #5:

UART, WDT and CLKGEN

# This is the commit message #6:

smaller workspace file tweaks

# This is the commit message #7:

SPI peripheral implementation

# This is the commit message #8:

update VS Code files

# This is the commit message #9:

update JLink files

# This is the commit message #10:

update VS Code files

# This is the commit message #11:

timer, PWM and I2C module

# This is the commit message #12:

Add CI

# This is the commit message #13:

update docs

# This is the commit message #14:

updates for documentation

# This is the commit message #15:

update CI as well

# This is the commit message #16:

add docs for setting up binary crate

# This is the commit message #17:

add additional memory section
2024-06-25 19:57:26 +02:00

77 lines
2.5 KiB
Plaintext

/*********************************************************************
* SEGGER Microcontroller GmbH *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1995 - 2018 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
----------------------------------------------------------------------
File : JLinkSettings.JLinkScript
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
*/
int AfterResetTarget (void) {
JLINK_SYS_Report("AfterResetTarget()");
// disable watchdog and unlock code RAM for write
DisableWatchdog();
return DisableRomProt(); // ROM_PROT = 0x1
}
/*********************************************************************
*
* BeforeTargetDownload
*/
int BeforeTargetDownload (void) {
JLINK_SYS_Report("BeforeTargetDownload()");
return DisableRomProt(); // ROM_PROT = 0x1
}
/*********************************************************************
*
* AfterTargetDownload
*/
int AfterTargetDownload (void) {
JLINK_SYS_Report("AfterTargetDownload()");
return DisableRomProt(); // ROM_PROT = 0x0
}
/*********************************************************************
*
* HandleBeforeFlashProg
*/
int HandleBeforeFlashProg(void) {
JLINK_SYS_Report("HandleBeforeFlashProg()");
return DisableRomProt(); // ROM_PROT = 0x1
}
/*********************************************************************
*
* HandleAfterFlashProg
*/
int HandleAfterFlashProg(void) {
JLINK_SYS_Report("HandleAfterFlashProg()");
return DisableRomProt(); // ROM_PROT = 0x0
}