Hi Xiangjun_rong,
Thank you for your reply, in fact that was the answer to all my issues. I was already trying to use that tool but your answer helped me confirm my thoughts.
For the people who might be having the same problems (as we all are newbies sometime) i'll be a little more specific on the answer to this post.
There's a tool called target task in which you can create the different tasks as Xiangjun_rong wrote before.
When you create a task to Export the code from the mcu to your computer, you need to specify the size of the code, the name of the file and its path, the format in which will be saved (I used binary) and the location of the memory where the code starts.
Once you have the code you need to create an Import task, there you have to select the type of MCU and then add an action (I erased the memory, and the chose programe and verify) in this last option you have to select the file where the code its located and of course the same other characteristics mentioned before.
At last, once you create the tasks, you just need to connect the external debugging tool and go ahead. Good luck everyone.