Hi, My question is how to config p21 as a gpio?
Hi, My question is how to config p21 as a gpio?
That's what I said, you need to erase the UICR which will reset it back to 0xffffffff. Just perform a full erase on the chip with whatever tools you're using, and then reload the softdevice and your code. As long as you no-longer have that #define, it won't replace the value back to 0x15 when you run and the pin will work as normal. if it does put it back, you still have the define defined.
Note also that P0.21 is connected to the debug in, so if (unlikely) you are using an external debugger, it may hold that pin high. Looking at the schematic, I believe that is not the case as long as you are using the on-board debugger, which you probably are.
That's what I said, you need to erase the UICR which will reset it back to 0xffffffff. Just perform a full erase on the chip with whatever tools you're using, and then reload the softdevice and your code. As long as you no-longer have that #define, it won't replace the value back to 0x15 when you run and the pin will work as normal. if it does put it back, you still have the define defined.
Note also that P0.21 is connected to the debug in, so if (unlikely) you are using an external debugger, it may hold that pin high. Looking at the schematic, I believe that is not the case as long as you are using the on-board debugger, which you probably are.