how to start a "hello world' and connect the board to my mobilephone

I turn on the device, the led turns green. And I use usb to connect it with computer then I  open the nrf connect for desktop, the bluetooth low energy tool,

10:51:05.822
Received status with code 0 PKT_SEND_MAX_RETRIES_REACHED, message: 'No response from device. Tried to send packet 6 times.'
10:51:07.010
serial port COM3 closed.
10:51:07.015
Error occured when opening port. Errorcode: NRF_ERROR_TIMEOUT (0xd)
then this error happened, and I cant find the device on my phone.
How can I start a hello world with my phone?
Parents Reply
  • this is the project I am using, I'll try your way.

    /*
     * Copyright (c) 2016 Intel Corporation
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    #include <zephyr.h>
    #include <drivers/gpio.h>
    
    /* 1000 msec = 1 sec */
    #define SLEEP_TIME_MS   1000
    
    /* The devicetree node identifier for the "led0" alias. */
    #define LED0_NODE DT_ALIAS(led0)
    
    /*
     * A build error on this line means your board is unsupported.
     * See the sample documentation for information on how to fix this.
     */
    static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
    
    void main(void)
    {
    	const struct device *dev;
    	bool led_is_on = true;
    	int ret;
    
    	if (!device_is_ready(led.port)) {
    		return;
    	}
    
    	ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
    	if (ret < 0) {
    		return;
    	}
    
    	while (1) {
    		ret = gpio_pin_toggle_dt(&led);
    		if (ret < 0) {
    			return;
    		}
    		k_msleep(SLEEP_TIME_MS);
    	}
    }
    

Children
No Data
Related