Error in configuring UART pins in SDK2.3.0

Hi there,

I have recently switched my complete "Bluetooth Peripheral" Project from the SDK version 1.9.1 to 2.3.0 

I have been facing some of the pin control issue for the UART, as I have observe you have change the way the UART is working and added the pinctrl functionality.

Previously on the 1.9.1, I was using the UART pins shown under.

&uart0 {
	rts-pin = < 0xff >;
	cts-pin = < 0xff >;
};

&uart2 {
	current-speed = <9600>;
	status = "okay";
	tx-pin = <4>;  
	rx-pin = <5>;
	rts-pin = < 0xff >;
	cts-pin = < 0xff >;
	rx-pull-up;
};

I am using this UART2 for communicating with the BMS(Battery management system), but now in the new SDK when using the same pin configuration, I am getting the error 

"d:\v2.3.0\zephyr\include\zephyr\toolchain\gcc.h:78:36: error: static assertion failed: "/soc/peripheral@50000000/uart@b000 defined without required pin configuration""

"d:\v2.3.0\zephyr\include\zephyr\toolchain\gcc.h:78:36: error: static assertion failed: "/soc/peripheral@50000000/uart@b000 has legacy *-pin properties defined although PINCTRL is enabled"

I am using SDK 2.3.0, and my board is the Nordic Thingy53.

Could you please advise on how to resolve this error and properly configure the UART on my SoC?

Regards 
Sachin

Parents Reply Children
  • Thanks  

    I have gone through the link you provided and get into another link in that. 
    this is what I have  added in my build  -DCONFIG_NO_OPTIMIZATIONS=y 

    This gives me more detail about the error. The error is due to stack overflow

    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    [00:00:00.078,765] <inf> fs_nvs: nvs_mount: 8 Sectors of 4096 bytes
    [00:00:00.079,956] <inf> fs_nvs: nvs_mount: alloc wra: 0, fe8
    [00:00:00.081,054] <inf> fs_nvs: nvs_mount: data wra: 0, 0
    [00:00:21.955,017] <err> os: usage_fault: ***** USAGE FAULT *****
    [00:00:21.956,115] <err> os: usage_fault:   Stack overflow (context area not valid)
    [00:00:21.957,366] <err> os: esf_dump: r0/a1:  0x200152f0  r1/a2:  0x0008f7d1  r2/a3:  0x00000000
    [00:00:21.958,923] <err> os: esf_dump: r3/a4:  0x200043a0 r12/ip:  0x00000000 r14/lr:  0x00000000
    [00:00:21.960,418] <err> os: esf_dump:  xpsr:  0x00068800
    [00:00:21.961,578] <err> os: esf_dump: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000
    [00:00:21.963,439] <err> os: esf_dump: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000
    [00:00:21.965,301] <err> os: esf_dump: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000
    [00:00:21.967,163] <err> os: esf_dump: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000
    [00:00:21.968,994] <err> os: esf_dump: fpscr:  0x00000000
    [00:00:21.970,092] <err> os: esf_dump: Faulting instruction address (r15/pc): 0x20015308
    [00:00:21.971,466] <err> os: z_fatal_error: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
    [00:00:21.972,869] <err> os: z_fatal_error: Current thread: 0x200049a8 (BT TX)
    [00:00:21.994,140] <err> fatal_error: k_sys_fatal_error_handler: Resetting system

    I have changed the number of CONFIG to resolve this error especially CONFIG_BT_RX_STACK_SIZE=32768

    Here is what my prj.conf is having the stack sizes
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=16384
    CONFIG_MAIN_STACK_SIZE=16384	
    CONFIG_BT_L2CAP_TX_MTU=700
    CONFIG_BT_L2CAP_TX_BUF_COUNT=4
    CONFIG_BT_L2CAP_TX_FRAG_COUNT=3
    CONFIG_BT_BUF_ACL_TX_SIZE=550
    CONFIG_BT_BUF_ACL_RX_SIZE=550
    CONFIG_HEAP_MEM_POOL_SIZE=8192
    CONFIG_BT_RX_STACK_SIZE=32768 
     
    I have look into the code using debugger and the error is in the bt_enable(NULL); library
    The error is displaying when CPU moves in bt_init(); --> hci_init(); function.

    Please help me more to resolve this.   
    NOTE: As the stack problem is caused after adding the device pointer for UART2 that is why I am not creating another ticket for this problem.
Related