Hi, I am using a third party module based on nRF52840. I want to use a standard UART to operate the CLI shell. I am not clear how to do this, any help?
Thanks,
Kaushalya
Hi, I am using a third party module based on nRF52840. I want to use a standard UART to operate the CLI shell. I am not clear how to do this, any help?
Thanks,
Kaushalya
Hi, I have removed the overlay_usb.conf from the Kconfig fragments. I need to find how the UART is specified to trace which pins are Tx and RX. I searched for a reference of PSEL.TXD anywhere in the project, but I couldnt find any. Really need some help here.
Thanks,
Also at add to my previous comment, by looking at resources list in my project, I can see UART0 Tx is GPIO0.6 and RX is GPIO0.8. I can see when I measure the voltage of these, they are both at 3V (VDD). Unfortunately I dont see any response once I hooked up a USB to TTL cable (3V3) to these ports. This may mean still the project is configured for USB transport layer. How can we verify which transport the project is configured to?
Thanks,
Hi Andreas,
Since the same program seems to be behaving differently on Nordic Dev Kit and my module, I wanted to see if the program starts and continue without any errors like a crash.
So I added the following section to the CLI main.c
#define LED2_NODE DT_ALIAS(led2)
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED2_NODE, gpios);
...
void main(void)
{
gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
gpio_pin_set_dt(&led, 1);
k_msleep (100);
...
}
Now when I program this to the Dev Kit, the LED3 stays lit up and the CLI shell seems to be working.
When I program this to my module, the LED (on P0.15) doesnt light up!! So the program doesnt seem to execute properly.
Any ideas?
Thanks heaps,
I tried debugging in to my module with the CLI program. When I tried debugging with Dev Kit, I could see the main() got executed, but with my module, it never reaches the main(). It jumps from
ok I managed to solve it. I will leave this to help someone as new as me to Nordic SDK may find it useful.
I thought this may be caused by some rant interrupt or something like that since my module has nothing connected to it except uart cable and the LED on _0.15. So I disabled all unnecessary interfaces from DTS and DTSI. Eventually the culprit was the RTS and CTS lines as I am using 3 wire cable for UART.
So I did the following to remove unused RTS and CTS pin mapping from DTSI file.
uart0_default: uart0_default {
group1 {
//psels = <NRF_PSEL(UART_TX, 0, 6)>,
// <NRF_PSEL(UART_RTS, 0, 5)>;
psels = <NRF_PSEL(UART_TX, 0, 6)>;
};
group2 {
//psels = <NRF_PSEL(UART_RX, 0, 8)>,
// <NRF_PSEL(UART_CTS, 0, 7)>;
psels = <NRF_PSEL(UART_RX, 0, 8)>;
bias-pull-up;
};
};
One thing strange though is still my P0.15 LED is not lighting up. I have not removed pin mapping for that.
Anyway the CLI shell is now working.
Cheers,
Hi,
Glad to hear that you managed to solve the issue and I am very thankful for you both leaving all the details in your debugging as well as leaving the solution you found in this thread for others to see!
I have some minor input to add to your reply chain:
There can be small differences between a Nordic DK and a custom module which may be causing the same sample to work on one board but not the other.
As for why P0.15 LED is not lighting up might be harder to solve, but unless you've already done so I would double check if the LED is mapped to the pin you believe it is mapped to and/or see if the connection to the LED has been shortened in any manner.
If you believe your issue has beensolved, please let me know and I will flag this case as verified!
Kind regards,
Andreas
Hi Andreas,
Thanks again.
I also found out the issue with LED on P0.15. The current DTS has configured this pin as an active-low. I wired the LED to suit an active high. I changed the DTS pin mapping and it works.
So this issue is fully resolved. Please close it.
Cheers,
Hi Andreas,
Thanks again.
I also found out the issue with LED on P0.15. The current DTS has configured this pin as an active-low. I wired the LED to suit an active high. I changed the DTS pin mapping and it works.
So this issue is fully resolved. Please close it.
Cheers,