Skip to content

Commit e500e2b

Browse files
sandeepmistryfacchinm
authored andcommitted
[bootloader] reset JTAG on boot
1 parent c637aa2 commit e500e2b

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

bootloaders/zero/board_driver_jtag.c

+6
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ void jtagDeinit(void)
567567
jtag.id = -1;
568568
}
569569

570+
int jtagReload() {
571+
int ret = LoadJI(JI_PULSE_NCONFIG);
572+
Js_Shiftdr();
573+
return ret;
574+
}
575+
570576
int jtagWriteBuffer(unsigned int address, const uint8_t *data, size_t len)
571577
{
572578
int ret = 0;

bootloaders/zero/board_driver_jtag.h

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ inline int inpin_get(int pin) { return ((PORT->Group[0].IN.reg & (1<<pin)) != 0)
7575
extern "C" {
7676
#endif
7777
int jtagInit(void);
78+
int jtagReload(void);
7879
int jtagWriteBuffer(unsigned int address, const uint8_t* data, size_t len);
7980
int jtagReadBuffer(unsigned int address, uint8_t* data, size_t len);
8081
void jtagDeinit(void);

bootloaders/zero/main.c

+3
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ int main(void)
194194
// Enable port mux
195195
PORT->Group[0].PINCFG[27].reg |= PORT_PINCFG_PMUXEN ;
196196
clockout(0, 1);
197+
198+
jtagInit();
199+
jtagReload();
197200
#endif
198201

199202
#if defined(SAM_BA_UART_ONLY) || defined(SAM_BA_BOTH_INTERFACES)

0 commit comments

Comments
 (0)