Can I use P32 and P2 as GPIO? They seem to be stuck as PUART.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
legic_1490776
Level 5
Level 5
25 likes received 10 likes received First like received

In my application I am trying to use P2 and P32 as GPIO pins.  I am using the GPIO configuration call to configure them in the usual way. However they appear to still be operating as a serial port; P2 seems permanently operating as an input, and P32 can be controlled as an output but trace data is still output to it.  (This despite setting the trace UART to HCI in spar_init.c)

I think I am turning off the peripheral port this way (following example of hello sensor):

// Following structure defines UART configuration

const BLE_PROFILE_PUART_CFG vehicle_tag_puart_cfg =

{

    /*.baudrate   =*/ 115200,

    /*.txpin      =*/ PUARTDISABLE | GPIO_PIN_UART_TX,

    /*.rxpin      =*/ PUARTDISABLE | GPIO_PIN_UART_RX,

};

Is there anything else I need to do to make sure the PUART is off so I can use these GPIO?

BTW my application is running on a custom board based on the 20732S.

0 Likes
1 Solution
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

Use NULL instead of this vehicle_tag_puart_cfg when invoking bleapp_set_cfg() in your APPLICATION_INIT function.

View solution in original post

0 Likes
2 Replies
asridharan
Employee
Employee
10 comments on KBA 5 comments on KBA First comment on KBA

Use NULL instead of this vehicle_tag_puart_cfg when invoking bleapp_set_cfg() in your APPLICATION_INIT function.

0 Likes