Tool/software:
Hi everyone,
i'm using TMS570LC4357 microntroller on my custom board. I load the firmware on the MCU through TMS320-XDS100-V3 jtag emulator.
After trying to configure some clock source registers of the MCU (code below ****), I'm not able to access the DAP through the JTAG emulaor (-1170 error code).
I'm asking you if there is some way to erase the internal flash of the MCU to restore the factory configuration, without using the JTAG.
I'm not able to access the flash after connecting to the Icepick and DAP directly from CCS debug configuration.
I tried to hold on the reset of the MCU(nRST) in order to inhbit the firmware and to erase the flash but in this way there is no access to the PRSC module(-6306 error code).
Regards,
Luigi
****
typedef unsigned int t_UINT;
systemREG1->CSDIS |= (t_UINT)((t_UINT)1U << 11U) /* Disable AVCLK4 */
| (t_UINT) ((t_UINT) 0x1U << 0x7U) /* Disable clock source 7: EXTCLKIN2 */
| (t_UINT) ((t_UINT) 0x1U << 0x6U) /* Disable clock source 6: PLL2 */
| (t_UINT)((t_UINT)1U << 5U ) /* Disable AVCLK2 */
| (t_UINT)((t_UINT)1U << 4U ) /* Disable AVCLK1 */
| (t_UINT) ((t_UINT) 0x1U << 0x3U) /* Disable clock source 3: EXTCLKIN */
| (t_UINT) ((t_UINT) 0x1U << 0x2U); /* Disable clock source 2 (unimplemented) */
systemREG1->CSDISSET |= (t_UINT) (((t_UINT) 0x1U << 6U) /* Disable clock source 6 */
| (t_UINT) ((t_UINT) 0x1U << 1U)); /* Disable clock source 1 */
systemREG1->CLKTEST &= (t_UINT) (~((t_UINT)0x1U << 25U)); /* Disable clock monitor range detection circuitry */
flashWREG->FBPWRMODE |= (t_UINT)((t_UINT)SYS_ACTIVE << 14U) /* BANK 7 */
| (t_UINT)((t_UINT)SYS_ACTIVE << 2U) /* BANK 1 */
| (t_UINT)((t_UINT)SYS_ACTIVE << 0U); /* BANK 0 */
emifREG->CE2CFG &= ~((t_UINT)((t_UINT)1U << 31U) /* Disable strobe mode */
| (t_UINT)((t_UINT)1U << 30U)); /* Disable extended wait cycles */
emifREG->CE3CFG &= ~((t_UINT)((t_UINT)1U << 31U) /* Disable strobe mode */
| (t_UINT)((t_UINT)1U << 30U)); /* Disable extended wait cycles */