Skip to content

Execute original code when programing flash #3

Closed
@Joey-Ye

Description

@Joey-Ye

I noticed that there are several times of cmsis_dap reset during the flash operation conducted in pyOCD. They were initiated by calling to self.transport.reset()

The negative impact of these cmsis_dap reset is that they doesn't stop at reset handler. Instead they a few mini-seconds before other resets happens (for example NVIC_AIRCR_SYSRESETREQ), and resulted some output to serial line that I don't expect on lpc1768. The behavior is:

  1. connect via pyOCD and gdb
  2. gdb initiate load command
  3. pyOCD reset target by flash.init->setTargetState->self.reset()->self.transport.reset()
  4. target runs for a while, producing unexpected output (people don't expect original program still runs when flashing it)
  5. execution stop when
    self.writeMemory(DHCSR, DBGKEY | C_DEBUGEN)
    self.writeMemory(DEMCR, VC_CORERESET)
    self.writeMemory(NVIC_AIRCR, NVIC_AIRCR_VECTKEY | NVIC_AIRCR_SYSRESETREQ)

Here are my questions:
a. Why it is need to reset cmsis_dap in a flash operation?
b. If A is necessary, is there any way to halt the execution once cmsis_dap resets?
c. What's difference between NVIC_AIRCR_SYSRESETREQ (local reset) and SWJ nRESET (cmsis_dap reset)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions