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

Custom Board Pin Mapping

Hi Nordic Team!

After developing our firmware on the nRF52 HDK, we designed our custom board, and we're starting to write our custom board configuration file.

The main problem I have is that there's no official documentation on how to do this.

From what I gathered around the forum, is that I need to define my custom board file assigning each pin it's function, and then change the board flag on the make file (see here).

On the other hand, there's also the possibility of editing the nrf_drv_config.h file (see here).

Finally, certain pins have to be configured trough their register if they want to be used for GPIO or other peripheral drivers (see here and here).

So my question is, do I have to do all three? Is writing the custom_board enough?

As a reference here's the mapping needed for our board design:

  • GPIO Inputs: P0.00, P0.19, P0.20, P0.26, P0.29 and P0.30
  • GPIO Outputs: P0.13, P0.17, P0.18, P0.21, P0.31
  • Analog Inputs: AIN0, AIN1, AIN2, and AIN3
  • TWI: P0.11(SCL) and P0.12 (SDA)
  • UART: P0.28(TXD), P0.29(RXD), P.027(CTS) and P0.25(RTS)
  • SPI: P0.14(MOSI), P0.15 (MISO) and P0.16 (SCK)
  • PWM: P0.09

Our firmware is based on the nRF52832 using S132 SD and SDK ver 11.0 and we're using a GCC based environment.

Thanks in advance

Parents
  • Hi,

    You are not required to create a custom_board.h, but it is convenient to have all peripheral pin defines in a common file. This also makes it easier to switch between different boards, given that the rest of the source files is setup to use the common defines. There is a short description of how to create the file here, but I would recommend that you start with the pca10040.h board file if you have developed your firmware using the nRF52 DK.

    You can use the defined from custom_board.h in nrf_drv_config.h, for configuration of TWI, UART etc. As the NFC and reset pins have special functions, they have to be configured if you want to use these for general GPIO.

    Best regards,

    Jørgen

  • I forgot to write this on my previous comment.

    Since I only have one button, and all the LED's in my system are access trough a I2C I/O expander, I'm not planning in using the BSP. Is this OK or I need to define a BSP file for my custom board?

Reply Children
No Data
Related