Undetected Device when add Some code

Hello!
I have developed a simple application to read 2 ADC voltages basically and send them to a central...
I had already finished it and I wanted to add a gpio output that activates a mosfet in my hardware...
I added it as follows:

/****************************************************************************************/
/* LED configuration */
/****************************************************************************************/
#if defined (__DA14531__)
#define GPIO_LED_PORT GPIO_PORT_0
#define GPIO_LED_PIN GPIO_PIN_9
#define ADC_INPUT_PORT GPIO_PORT_0
#define ADC_INPUT_PIN GPIO_PIN_6
#define BRIDGE_CTRL_PORT GPIO_PORT_0
#define BRIDGE_CTRL_PIN GPIO_PIN_11
#else
#define GPIO_LED_PORT GPIO_PORT_1
#define GPIO_LED_PIN GPIO_PIN_0
#endif

And the reservation...

#if DEVELOPMENT_DEBUG

void GPIO_reservations(void)
{
RESERVE_GPIO(LED, GPIO_LED_PORT, GPIO_LED_PIN, PID_GPIO);
RESERVE_GPIO(BRIDGE_W, BRIDGE_CTRL_PORT , BRIDGE_CTRL_PIN, PID_GPIO);


/*
i.e. to reserve P0_1 as Generic Purpose I/O:
RESERVE_GPIO(DESCRIPTIVE_NAME, GPIO_PORT_0, GPIO_PIN_1, PID_GPIO);
*/

#if defined (CFG_PRINTF_UART2)

I then use my GPIO output as follows in "user_cuts1_impl.c":

void app_adcval1_timer_cb_handler()
{
struct custs1_val_ntf_ind_req *req = KE_MSG_ALLOC_DYN(CUSTS1_VAL_NTF_REQ,
prf_get_task_from_id(TASK_ID_CUSTS1),
TASK_APP,
custs1_val_ntf_ind_req,
DEF_SVC1_ADC_VAL_1_CHAR_LEN);
// Disable the Extended Sleep Mode so ADC can work as expected
arch_set_sleep_mode(ARCH_SLEEP_OFF);
GPIO_SetActive(BRIDGE_CTRL_PORT, BRIDGE_CTRL_PIN); //ACTIVE BRIDGE CURRENT
//DELAY
// ADC value to be sampled


//new
/* Perform single ADC conversion */

uint16_t result = gpadc_read();
uint16_t adc_val_mv = gpadc_sample_to_mv(result);
//A PARTIR DEL ADC CONVERTIR PERO EN aNDROID A TEMPERATURA Y MOSTRAR
//float adc_val_V= adc_val_mv/1000.0;
//float Rmedida= (adc_val_V/(Vref/2))*R_ref;
//float Temp= (Rmedida / R0_PT1000 -1.0) / alpha_PT1000;
//uint16_t Final_temp= (uint16_t) Temp;
contador++;
if(contador >= 10){
contador=0;
}
//Enable the Extended Sleep mode again for better current consumption
GPIO_SetInactive(BRIDGE_CTRL_PORT, BRIDGE_CTRL_PIN); //INACTIVE BRIDGE CURRENT
arch_set_sleep_mode(ARCH_EXT_SLEEP_ON);

//req->conhdl = app_env->conhdl;
req->handle = SVC1_IDX_ADC_VAL_1_VAL;
req->length = DEF_SVC1_ADC_VAL_1_CHAR_LEN;
req->notification = true;
/*Change the value updated with adc_val_mv */


memcpy(req->value, &adc_val_mv, DEF_SVC1_ADC_VAL_1_CHAR_LEN); //replace "sample" for value required

ke_msg_send(req);

if (ke_state_get(TASK_APP) == APP_CONNECTED)
{
// Set it once again until Stop command is received in Control Characteristic
timer_used = app_easy_timer(APP_PERIPHERAL_CTRL_TIMER_DELAY, app_adcval1_timer_cb_handler);
}
}

I didn't really add or do anything else....
I thought that by some hardware error I had damaged my DA14531MOD, so I changed it and the new one let me program it the first time and when I tried to read it again to program it, again the message "undetected" appears in flash programmer... I tried with a hardware where I only have the DA14531MOD and the programming pins without more components and the same thing happens, the first time it detects it and lets it program, but after loading the program the same thing happens:

I am really worried since I discarded one module because I thought I had damaged it and I would only have one left to continue....
I don't know if maybe I have some conceptual error with gpioreservations or what happens in memory when uploading my code? I appreciate your help... Thank you.