Firstly, thank kitling,SciresM ,normmatt and so on, who have created ntrboot_flasher.
However ,there seems to be a little bug in the code.
The code is listed as below:
REG_ROMCNT = 0;
REG_MCNT &= 0xFF;
::ioDelay(0x40000);
REG_MCNT |= (MCNT_CR1_ENABLE | MCNT_CR1_IRQ);
REG_ROMCNT = ROMCNT_NRESET | ROMCNT_SEC_SEED;
while (REG_ROMCNT & ROMCNT_BUSY);
However, ::ioDelay(0x40000) should be added in the end just as below:
REG_ROMCNT = 0;
REG_MCNT &= 0xFF;
::ioDelay(0x40000);
REG_MCNT |= (MCNT_CR1_ENABLE | MCNT_CR1_IRQ);
REG_ROMCNT = ROMCNT_NRESET | ROMCNT_SEC_SEED;
while (REG_ROMCNT & ROMCNT_BUSY);
::ioDelay(0x40000);
Some delay is needed after the Reset is just set to high again.
This little bug will lead to some errors.
However ,there seems to be a little bug in the code.
The code is listed as below:
REG_ROMCNT = 0;
REG_MCNT &= 0xFF;
::ioDelay(0x40000);
REG_MCNT |= (MCNT_CR1_ENABLE | MCNT_CR1_IRQ);
REG_ROMCNT = ROMCNT_NRESET | ROMCNT_SEC_SEED;
while (REG_ROMCNT & ROMCNT_BUSY);
However, ::ioDelay(0x40000) should be added in the end just as below:
REG_ROMCNT = 0;
REG_MCNT &= 0xFF;
::ioDelay(0x40000);
REG_MCNT |= (MCNT_CR1_ENABLE | MCNT_CR1_IRQ);
REG_ROMCNT = ROMCNT_NRESET | ROMCNT_SEC_SEED;
while (REG_ROMCNT & ROMCNT_BUSY);
::ioDelay(0x40000);
Some delay is needed after the Reset is just set to high again.
This little bug will lead to some errors.