A defendant in any criminal action has the right of appeal under the rules hereinafter prescribed, provided, however, before the defendant who has been convicted upon either his plea of guilty or plea of nolo contendere before the court and the court, upon the election of the defendant, assesses punishment and the punishment does not exceed the punishment recommended by the prosecutor and agreed to by the defendant and his attorney may prosecute his appeal, he must have permission of the trial court, except on those matters which have been raised by written motion filed prior to trial. This article in no way affects appeals pursuant to Article 44.17 of this chapter.
Tex. Code Crim. Proc. § 44.02