When PIN=0 P0.00 is used it doesn't work (No error message or failing, i also tried several other ports), no toggling output.
The code works with PIN=28 (P0.28=LED1), led is blinking.
If i try it with the PIN=0 P0.00 it doesn't (No error message, i also tried several other ports).
What's wrong ?
void main() {
const struct device *dev0;
const int PIN=0; // 28 (=led1 is working)
bool led_is_on = true;
int ret;
dev0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
if (dev0==NULL) {
printk("device not found");
return;
}
if (!device_is_ready(dev0)) {
printk("GPIO controller not ready");
return -ENODEV;
}
gpio_pin_configure(dev0, PIN, GPIO_OUTPUT);
while(1) {
gpio_pin_toggle(dev0, PIN);
k_msleep(SLEEP_TIME_MS);
}
}
prj.conf
CONFIG_GPIO=y