Hi Xiangjun,
Yes, you helped me! What you said is totally true.
I realized that I had connected the pin 38 (PTA4/EZP_CS_b) to GND with a pull down resistor. A low state in this pin enables the EZPort flash programming mode, so I couldn't program the flash via JTAG.
I wanted to use this pin as a GPIO so I forced a low state with a pull down resistor before reset, I didn't realize that this pin had a function (wrong decision!).
Finally I took off the pull down resistor and everything works. This is because this pin has an internal pull up by default and I could leave this pin open.
Thank you very much.