Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6908

SDK • Trouble getting UART1 on pins 4,5

$
0
0
Hi,

I've moved a larger project from Arduino IDE , where I have debug printing to Wire Serial1 on gp4 and gp5, to sdk.

Using SDK I'm having trouble getting UART1 on pins 4,5 so I thought I'd take the hello_serial example and test that.
https://github.com/raspberrypi/pico-exa ... o_serial.c

The supplied CMakeLists.txt seemed short of what was needed even to get this trivial example to compile. I added a few lines from what I'd learnt bulding the main project. I now have this:

Code:

                                               cmake_minimum_required(VERSION 3.13)# initialize the SDK based on PICO_SDK_PATH# note: this must happen before project()# v1,v2 include(pico_sdk_import.cmake) copied aboveinclude(pico_sdk_import.cmake)project(dr_hello)pico_sdk_init()add_executable(hello_serial        hello.c        )# pull in common dependenciestarget_link_libraries(hello_serial pico_stdlib)# create map/bin/hex/uf2 file etc.pico_add_extra_outputs(hello_serial)# add url via pico_set_program_url#example_auto_set_url(hello_serial)target_compile_definitions(hello_serial PRIVATE  PICO_DEFAULT_UART=1  PICO_CLOCK_AJDUST_PERI_CLOCK_WITH_SYS_CLOCK=1  PICO_DEFAULT_UART_TX_PIN=4  PICO_DEFAULT_UART_RX_PIN=5)
I have gp4,5 wired to a FTDI device. This was previously seen to work using the IDE.

Code:

dmesg[650402.593516] usb 1-5: Detected FT232R[650402.603015] usb 1-5: FTDI USB Serial Device converter now attached to ttyUSB0
Listening to this port I get nothing.

Code:

 minicom -D /dev/ttyUSB0 -b 115200
It's probably something stupid I'm over looking. Any suggestion?

TIA.

Statistics: Posted by pie_face — Thu Nov 28, 2024 9:43 am



Viewing all articles
Browse latest Browse all 6908

Trending Articles