OpenCores
Issue List
CPU state corruption when DBG_RST_BRK_EN is defined #18
Closed sebx86 opened this issue over 10 years ago
sebx86 commented over 10 years ago

When DBG_RST_BRK_EN is defined, the CPU starts with pmem_cen=0 and halt_flag=1 as reset values. The CPU still makes a program memory access to fetch the reset vector (from a likely not initialized memory area) and updates the PC value with it.

The PC is corrupted and the CPU has to be reset after the program memory is loaded.

olivier.girard commented over 10 years ago

Hi Sebastien,

This is actually the expected behavior. With this option, the CPU will stop just before executing the first instruction after a reset, which means that the instruction fetch already occurred.

Generating a CPU reset after the program memory is loaded from the serial debug interface is exactly what the software development tools are doing. For example, if you have a look at the "openmsp430-loader.tcl" tool, you will see that it calls the "ReleaseDevice" function, which in turns perform a reset cycle and then tells the CPU to resume execution.

Regards, Olivier

sebx86 commented over 10 years ago

Thanks Olivier,

you may now close this non-existing bug... No problem to live with it.

Sebastien

olivier.girard closed this over 10 years ago

Assignee
No one
Labels
Bug