Creating my own board with nrf9161

Hi all,

I've build my own board with nrf9161 LACA, so for now I've tried to create my own board, for the moment I'm just trying to pilot my 3 leds. I've follow dev academy blinky example but unfortunally it's not working.

To create my custom board I've followed this video? I can compile without error but my led doen't blink.

My board is calling gcg_dnv_nrf9161s, I have added a zip in my post, containing my board definition

I have 3 leds connect to PA0.00 PA0.01 and PA0.02 (RGB leds).

gcg_dnv_nrf9161s.zip

My main.c

#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

#define SLEEP_TIME_MS (1000)

#define LED_R_NODE DT_ALIAS(ledg)

static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED_R_NODE, gpios);


int main(void)
{
	int ret;
	//printf("Hello World! %s\n", CONFIG_BOARD);

	if(!gpio_is_ready_dt(&led)){
		return 0;
	}

	ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_INACTIVE);
	if(ret < 0)
		return 0;

	while(1){
		ret = gpio_pin_toggle_dt(&led);
		if(ret < 0)
			return 0;

		k_msleep(SLEEP_TIME_MS);
	}

	return 0;
}

What I'm doing wrong ?

Parents
  • Hello, 

    I've build my own board with nrf9161 LACA, so for now I've tried to create my own board, for the moment I'm just trying to pilot my 3 leds. I've follow dev academy blinky example but unfortunally it's not working

    Could you please provide more information? Have you made a custom hardware for your nRF9161? Did you verify that LEDs are connected to the correct GPIO in the Devicetree? Are you able to run e.g. AT Client or Serial LTE Modem, and verify that these work on your board? 

    I can compile without error but my led doen't blink.

    Any logs from your application?

    Kind regards,
    Øyvind

Reply
  • Hello, 

    I've build my own board with nrf9161 LACA, so for now I've tried to create my own board, for the moment I'm just trying to pilot my 3 leds. I've follow dev academy blinky example but unfortunally it's not working

    Could you please provide more information? Have you made a custom hardware for your nRF9161? Did you verify that LEDs are connected to the correct GPIO in the Devicetree? Are you able to run e.g. AT Client or Serial LTE Modem, and verify that these work on your board? 

    I can compile without error but my led doen't blink.

    Any logs from your application?

    Kind regards,
    Øyvind

Children
  • Hi  

    My basic project works fine right now I can control my leds :). But for now I'm trying to add UART but it's doesn't work, I think I don't understand something with pinctrl

    Let me explain my config, on my custom board I have wired PA0.05 to TX of CP2102N and PA0.06 to RX of CP2102N. My cp2102N works (I can detect it on y computer).

    So in my pinctrl file I've added :

     &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 5)>;
    			bias-pull-up;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 6)>,
    				<NRF_PSEL(UART_RX, 0, 5)>;
    			low-power-enable;
    		};
    	};
     };

    I don't use RTS and CTS pin. SO after that I've added my yart0 to my dts file like this :

    &uart0 {
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };

    And in my chosen part

    	chosen {
    		zephyr,sram = &sram0;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_partition;
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    	};

    But unfortunately I have nothing coming on my serial port whan I'm dping printf() in my while blinking loop

    My cp2102n is wired like this

  • Hi Simon, based on your description, your project sounds similar to the nRF9160 Feather by Circuit Dojo. This board also uses the CP2102 to communicate with the computer. Have a look at the board files in zephyr\boards\arm\circuitdojo_feather_nrf9160\

    I'm not familiar with how the CP2102 works. Comparing you pinctrl with the nRF9160 Feather I see that you have two groups in your setup. 

    uart0_default: uart0_default {
    	group1 {
    		psels = <NRF_PSEL(UART_TX, 0, 6)>,
    			<NRF_PSEL(UART_RX, 0, 5)>;
    	};
    };

    Kind regards,
    Øyvind

  • Thanks  

    Effectively my board is similar with nrf9160 Feather, I'll try your suggestion, keep you in touch :)

    EDIT : looking circuitdojo board help me thanks  
     
Related