8 years, 5 months ago.

How can I change the function of RESET pin in FRDM-KL25Z?

Hello,

I would like to use the RESET button of my FRDM-KL25Z as a general-purpose button. I know that I have to reconfigure the FOPT register. Searchong in the forum, I found this topic:

https://developer.mbed.org/questions/1387/How-can-I-access-the-FTFA_FOPT-register-/

However, it seems that mbed-src changes after this post were substantial. I cannot find the specified file, and not even the EQU statement using a search.

Doea anyone know how to change the FOPT contents in mbed-src library?

Thanks in advance,

Antonio

2 Answers

8 years, 5 months ago.

You need to use mbed-dev rather than mbed-src. No idea why they changed the name but they did.

The file is now targets/cmsis/TARGET_Freescale/TARGET_KLXX/TARGET_KL25Z/TOOLCHAIN_ARM_STD/startup_MKL25Z4.S it looks like it's still line 181 you would need to change.

Sorry, i changed the library to mbed-dev, but I cannot find the startup_MKL25Z4.S file into that directory path.

posted by Antonio Quevedo 20 Jul 2016

It's there. I wouldn't have been able to post the link to it in the library if it wasn't there. Looking in the online compiler I can see the file.

posted by Andy A 20 Jul 2016

That's strange, I have deleted the library and then I have imported it from the link you provided. The file still does not show in the path. I have tried to add it manually and the compiler says that it already exists. So, it seems I am dealing with an invisible file. I will search on how to make it visible.

posted by Antonio Quevedo 21 Jul 2016
8 years, 5 months ago.

Can't you just change its pin function to GPIO after it booted? Thats probably easier, although I don't know if the Reset pin is added in the list of pin names, or if you would need to do it manually.

However a word of caution: Been there, done that by using someone elses bin file to test something USB related. It works nicely. But afterwards you CANNOT use drag and drop programming anymore. I did manage to get it functional again by spending quite some time in Keil uVision using the CMSIS-DAP debugger to get the stupid thing to erase itself. The drag and drop programming uses the reset line, so if you reprogram it to be something else it simply stops functioning.

I have tried changing the pin function by MUX, but it is not enough, you really need to fiddle with the FOPT register. And thank you for the warning, I use NXP CodeWarrior too, and OpenSDA. I have changed RESET pin function in that IDE, and after that I still could load another program, so there should be no issue for me.

posted by Antonio Quevedo 20 Jul 2016