Unable to print using printf or nrf_log_info

I am using nrf5 sdk 17.1.0, segger embedded studio v6.40 and nrf52832-dk, when running the spi example, i do able to see the log only after the build, and when i reset the device no log is shown on the Jlink-RTT viewer. When running the uart example provided in nrf5 sdk i was unable to see any anything on the terminal also. Can you please let me know what might be the potential reason?

Parents
  • #include <zephyr/kernel.h>
    #include <zephyr/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);
    
    int main(void)
    {
    	int ret;
    
    	if (!gpio_is_ready_dt(&led)) {
    		return 0;
    	}
    
    	ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
    	if (ret < 0) {
    		return 0;
    	}
    
    	while (1) {
    		ret = gpio_pin_toggle_dt(&led);
    		if (ret < 0) {
    			return 0;
    		}
    		printk("\nError: no device found.\n");
    
    		k_msleep(SLEEP_TIME_MS);
    	}
    	return 0;
    }

    I have tried to print using printk in blinky sample of nordic connect sdk, it does show led blink, but it also not print anything on the terminal.

Reply
  • #include <zephyr/kernel.h>
    #include <zephyr/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);
    
    int main(void)
    {
    	int ret;
    
    	if (!gpio_is_ready_dt(&led)) {
    		return 0;
    	}
    
    	ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
    	if (ret < 0) {
    		return 0;
    	}
    
    	while (1) {
    		ret = gpio_pin_toggle_dt(&led);
    		if (ret < 0) {
    			return 0;
    		}
    		printk("\nError: no device found.\n");
    
    		k_msleep(SLEEP_TIME_MS);
    	}
    	return 0;
    }

    I have tried to print using printk in blinky sample of nordic connect sdk, it does show led blink, but it also not print anything on the terminal.

Children
No Data
Related