Pull up P0.08

Hi, 

I am trying to pull up P0.08 as an enable pin for this switch TPS7A0518 

I use the following code and verified on development board 

gpio_pin_configure(gpio0_dev, GPIO_0_TPS_EN, GPIO_OUTPUT);
gpio_pin_set(gpio0_dev, GPIO_0_TPS_EN, 1);

However, when I move to customized board, it does not work. I am providing a 1.8V source to VCC_NRF 

Anything else I should check or correct? 

Thank you

  • Hello Zhang,
    Not sure how you are configuring the settings for your custom board, but I suspect that gpio0_dev isn't working on the same gpio on your custom board as it is on the development board.
    So check which gpio is used by the gpio0_dev is using or do the same configuration writes directly to gpio0.8 to make sure you set the right pin.
    Best regards
    Asbjørn
  • Hi Asbjørn, thank you for the reply! 
    Can you show me any sample on how to "do the same configuration writes directly to gpio0.8 to make sure you set the right pin" 

    I attached my schematic as reference 


    Also parts of my overlay file,  can this issue due to disable some features? but I did the same thing with development board

    I use the same overlay file to test on my customized PCB and development board

    &i2c0 {	status = "disabled";};
    &spi0 {	status = "disabled";};
    &i2c1 {	status = "disabled";};
    &qspi {	status = "disabled";};
    &led1 {	status = "disabled";};
    &led3 {	status = "disabled";};

  • Hello,

    I'd recommend you to have a look at the documentation here:

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/config_and_build/hardware/use_gpio_pin_directly.html

    You should aslo be able to check the GPIO names with the correct absolute pin number, you can use the NRF_GPIO_PIN_MAP helper macro in nrf_gpio.h.

    Best regards

    Asbjørn

  • i have this error 

    devicetree error: D:/WOS/IMU/IMU_16JAN/nrf52840dk_nrf52840.overlay:43 (column 1): parse error: undefined node label 'gpiote0'
    -- In: D:/WOS/IMU/IMU_16JAN/build/zephyr, command: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe;C:/ncs/v2.5.2/zephyr/scripts/dts/gen_defines.py;--dts;D:/WOS/IMU/IMU_16JAN/build/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;C:/ncs/v2.5.2/nrf/dts/bindings;C:/ncs/v2.5.2/zephyr/dts/bindings;--header-out;D:/WOS/IMU/IMU_16JAN/build/zephyr/include/generated/devicetree_generated.h.new;--dts-out;D:/WOS/IMU/IMU_16JAN/build/zephyr/zephyr.dts.new;--edt-pickle-out;D:/WOS/IMU/IMU_16JAN/build/zephyr/edt.pickle;--vendor-prefixes;C:/ncs/v2.5.2/nrf/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;C:/ncs/v2.5.2/zephyr/dts/bindings/vendor-prefixes.txt
    CMake Error at C:/ncs/v2.5.2/zephyr/cmake/modules/dts.cmake:279 (message):
    gen_defines.py failed with return code: 1
    Call Stack (most recent call first):
    C:/ncs/v2.5.2/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
    C:/ncs/v2.5.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v2.5.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:2 (find_package)

    but i comment out that part and it works!! just FYI and hopefully understand it better

Related