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

nrf5280 re-config TRACEDATA pin as general gpio for pulse generation

hello Nordic

i am using nrf52840, sdk 16.0, working base on the peripheral app_ble_blinky example

i wish to use the p0_11 pin for pulse generation (not pwm), but when i try to config that pin as nrf_drv_gpiote_out_init(), i get err_code = 8 (NRF_ERROR_INVALID_STATE )

i looked into the data sheet and the forum for a bit and understood this is TRACEDATA2 pin but that it can also be configured as gpio, so the question is how to reconfigure it as gpiote (timer will generate a pulse with ppi to this pin) ?

also, since i understood the TRACEDATA has something to do with debugging, does configuring the pin as gpiote will have any affect on debugging with development board or in the future with a programmer via j-link connection to a PCB to be ?

also, i am using TRACDATA 1 (p0_12) as MOSI pin in an SPI comm and i did not get any problem there, so why is there a difference ?

best regard

Ziv

Parents
  • Hello,

    nrf_drv_gpiote_out_init() will return the invalid state error if you try to initialize a pin that has already been assigned, and P0.11 will be assigned as BUTTON_1/BSP_BUTTON_0 if you are using the default board configuration (See "Using the SDK with other boards").

    Best regards,

    Vidar

  • Hi Vidar

    so if i understand you correct the error i am getting has nothing to do with debug mode and will actually accrue also on running ?

Reply
  • Hi Vidar

    so if i understand you correct the error i am getting has nothing to do with debug mode and will actually accrue also on running ?

Children
  • Hi Ziv,

    Yes, this error will be returned regardles of whether you are in debug mode or not. To fix this, you either need to change the pin assignment for button 1 to a different pin, or select another GPIO for your output.

    , please post your question in a new thread. The problem you are describing appears to be unrelated to the problem OP had.