Unsupported Pin GPIO error with SDK 2.6.0

Hi,

We have developed our code against SDK 2.3.0 and I wanted to try to upgrade the SDK to 2.6.0. I had to remove CONFIG_OPENTHREAD_CHILD_SUPERVISION from my prj.conf, but after that the project was build. But when I flashed the new hex, it seems just hanged. There are no other code changes.

I tried debugging from the start to see where this happens. It occurs from the call to dk_leds_init (). 

I can trace the execution path down to 

static inline int z_impl_gpio_pin_configure(const struct device *port,
                        gpio_pin_t pin,
                        gpio_flags_t flags)
in gpio.h.
The error occurs in the line 1001.
__ASSERT((cfg->port_pin_mask & (gpio_port_pins_t)BIT(pin)) != 0U"Unsupported pin");
There are no changes to the device tree. 
This is what I have in leds section of my device tree overlay. 
	leds {
		compatible = "gpio-leds";
		led0: led_0 {
			gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;  // Rev1.0 	0.16-Blue
			label = "Blue LED";
			status = "okay";
		};
		led1: led_1 {
			gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;	// Rev1.0 	0.20-Red
			label = "RED LED";
			status = "okay";
		};
		led2: led_2 {
			gpios = <&gpio0 26  GPIO_ACTIVE_HIGH>;	// Rev1.0 	0.17-GREEN
			label = "Green LED";
			status = "okay";
		};
		led3: led_3 {
			gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;	// NTC_EN	Rev 1.0 - 1.9
			label = "NTC_EN";
			status = "okay";
		};
		led4: led_4 {
			gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;  // This is to compansate for Rev 1.2 with Minew and without Minew designs
			label = "Blue1 LED";
			status = "okay";
		};
		led5: led_5 {
			gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;	// This is to compansate for Rev 1.2 with Minew and without Minew designs
			label = "RED1 LED";
			status = "okay";
		};
	};
What could be going wrong here?
Cheers,
Kaushalya
Parents
  • I can reproduce this on the DK.

    diving more in, it goes into the definition of the &gpio0 in ncs\v2.6.1\zephyr\boards\arm\nrf52840dk_nrf52840\nrf52840dk_nrf52840.dts. If you look into this

    &gpio0 {
    	status = "okay";
    	gpio-reserved-ranges = <0 2>, <6 1>, <8 3>, <17 7>;

    You see that set <17 7> meaning gpio pin number from 17-23 are reserved. If you look in the back of the nRF52830 DK, you can see that this pins are connected to different things and hence not usable for anything else on the DK. If you have a custom board and if you are sure that these pins are free to use for the application, then you need to change the gpio-reserved-ranges in your overlay file.

  • Hi Susheel,

    Thanks. When I upgrade my 2.3.0 project to 2.6.0, what I did was 

    1. From NRF CONNECT ->Welcome->Manage toolchains, pick 2.6.0 toolchain and set as active

    2. From NRF CONNECT ->Welcome->Manage SDKs, pick 2.6.0 SDK and set as active

    I can see from bottom right corner that 2.6.0 toolchain and SDK are active. But when I check nrf52840dk_nrf52840.dts path from the Devicetree node, it points to my old dts file from 2.3.0 SDK. How can I fix this?

    Another thing I noted is that my project pane shows an error in my kconfig. The error seems to be in 

    source "Kconfig.zephyr"
    and higlighted error shows "couldn't parse 'default $(dt_gpio_hogs_enabled)': macro expanded to blank string" But the project can be built successfully.

    Cheers,

    Kaushalya

Reply
  • Hi Susheel,

    Thanks. When I upgrade my 2.3.0 project to 2.6.0, what I did was 

    1. From NRF CONNECT ->Welcome->Manage toolchains, pick 2.6.0 toolchain and set as active

    2. From NRF CONNECT ->Welcome->Manage SDKs, pick 2.6.0 SDK and set as active

    I can see from bottom right corner that 2.6.0 toolchain and SDK are active. But when I check nrf52840dk_nrf52840.dts path from the Devicetree node, it points to my old dts file from 2.3.0 SDK. How can I fix this?

    Another thing I noted is that my project pane shows an error in my kconfig. The error seems to be in 

    source "Kconfig.zephyr"
    and higlighted error shows "couldn't parse 'default $(dt_gpio_hogs_enabled)': macro expanded to blank string" But the project can be built successfully.

    Cheers,

    Kaushalya

Children
Related