nRF52 pin configuration

Hi all, I've searched through the devzone but unfortunately my issue is never mentioned. 

The problem is: my nRF51 project is converted to a nRF52 project. Pins are all re-assigned etc. Now I'm programming but have an issue configuring the pin. Normally when assigning pins I've used for for example pin number 0.05:

nrf_gpio_pin_clear(5);
nrf_gpio_cfg_output(5);

Now with the nRF52 project, I'm trying to assign pin value 1.05:

nrf_gpio_pin_clear(32+5);
nrf_gpio_cfg_output(32+5);  

Unfortunately I get this error:

Please help :)

Parents Reply Children
  • Hi,

    Thanks for your answer. I've seen this question. Unfortunately this is a step further than mine. I'm not able to compile. I'm using SDK17...

  • Are you using one of the exact releases of the IDE as described in the release notes?

    nRF5 SDK v17.1.0
    ------------------------
    Release Date: August, 2021

    Highlights:

    - Added support for the new versions of the nRF52 devices:
    - nRF52820 revision 3
    - nRF52832 revision 3
    - nRF52833 revision 2
    - nRF52840 revision 3
    (Note: Programming these requires nrfjprog v10.13 or newer.)
    - Updated nrf_oberon to v3.0.8.
    - Updated Mbed TLS to v2.16.10.

    The following toolchains/devices have been used for testing and verification:

    - ARM: MDK-ARM version 5.25
    - GCC: GCC ARM Embedded 9.2020-q2.major
    - IAR: IAR Workbench 7.80.4
    - SES: SES 5.42a

    Kenneth

  • Hi Kenneth,

    Answer on your questions: Yes I have.

    I'm using:

    - nRF5_SDK_17.1.0_ddde560

    - GNU Arm Embedded Toolchain 10 2021.10

    within Eclipse.

    So not sure what's going wrong.

    I don't understand that everyone is able to compile but I'm getting this error:  nrf_gpio.h:541:17: error: array subscript 40 is above array bounds of 'volatile uint32_t[32]' {aka 'volatile long unsigned int[32]'} [-Werror=array-bounds]

  • Hi, so I think I found the problem.

    Somewhere in the solution this board is defined:

    defined (NRF52832_XXAA) || defined (NRF52832_XXAB)

    However, in my makefile I have defined NRF52840.

    Can anyone help me where all these definitions take place? I've looked everywhere but cannot find where it is defined. It somehow overrules what I have defined in my makefile.

  • Hello,

    Please try to use the NRF_GPIO_PIN_MAP() macro when you configuring pins on PORT 1.

    e.g.,

    nrf_gpio_pin_clear(NRF_GPIO_PIN_MAP(1,5));

    Awi said:
    Can anyone help me where all these definitions take place? I've looked everywhere but cannot find where it is defined. It somehow overrules what I have defined in my makefile.

    These symbols should only be defined in your Makefile.

Related