(b) Except as provided in subdivision (c), the court shall, prior to the trial of any pending criminal action against the defendant wherein the separate conviction is charged as such, hold a hearing, outside of the presence of the jury, in order to determine the constitutional validity of the charged separate conviction issue. At the hearing the procedure, the burden of proof, and the burden of producing evidence shall be as follows:
- (1) The prosecution shall initially have the burden of producing evidence of the separate conviction sufficient to justify a finding that the defendant has suffered that separate conviction.
- (2) After the production of evidence required by paragraph (1), the defendant then has the burden of proof by a preponderance of the evidence that the defendant’s constitutional rights were infringed in the separate proceeding at issue. If the separate conviction sought to be invalidated is based upon a plea of guilty or nolo contendere, the defendant shall provide the court with evidence of the prior plea, including the court docket, written waivers of constitutional rights executed by the defendant, and transcripts of the relevant court proceedings at the time of the entry of the defendant’s plea. These records shall be provided to the defendant without cost to him or her, when the defendant is represented by the public defender or counsel appointed pursuant to Section 987.2 of the Penal Code.
- (3) If the defendant bears this burden successfully, the prosecution shall have the right to produce evidence in rebuttal.
- (4) The court shall make a finding on the basis of the evidence thus produced and shall strike from the accusatory pleading any separate conviction found to be constitutionally invalid.