This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why I cannot set some GPIO high or low?

I just get DK P10040, I am using SDK_11.0.0_89a8197/s132_nrf52_2.0.1_softdevice. I tried ble_app_uart, it works. But I find a problem, I cannot set P0.09/10/12/13 high or low, but other pins can be done.

And if I connect probe with P0.13, DK board will reset immediately.

Below is part of code.

//Init
nrf_gpio_range_cfg_output(8, 31); 

//Set gpio
static void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)
{
    uint32_t         err_code;
	uint32_t     i;
	uint8_t buffer[20];

switch(p_data[0])
{
case 'D':
	{
		uint8_t temp;
		temp = (p_data[1]-0x30)*10 +(p_data[2]-0x30);
		nrf_gpio_pin_clear(temp);// set low
	}
			break;

	case 'U':
	{
		uint8_t temp;
		temp = (p_data[1]-0x30)*10 +(p_data[2]-0x30);
			nrf_gpio_pin_set(temp);// set high
	}
			break;
				
	default:
		break;
}

Somebody can let me know what is the problem?

Parents Reply Children
No Data
Related