diff --git a/.gitignore b/.gitignore new file mode 100755 index 000000000..c81441881 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +_build +images diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100644 new mode 100755 index b6e6ddbc7..eae8b133d --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,55 @@ +# CMakeLists.txt for YaPicoprobe +# +# Parameters +# ---------- +# - PICO_BOARD pico|pico_w|pico_debug_probe, default "pico" +# - PICOPROBE_VERSION_MAJOR major version number +# - PICOPROBE_VERSION_MINOR minor version number +# - lot more options below +# +# - GIT_HASH short git hash +# - PROJECT project name for cmake +# cmake_minimum_required(VERSION 3.12) # -# board definition: pico or pico_w, default is pico +# Compile options # if(PICO_BOARD STREQUAL "") set(PICO_BOARD pico) endif() -set(PICO_STDIO_UART 0) +if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set(DEFAULT_OPT_PROBE_DEBUG_OUT 1) +else() + set(DEFAULT_OPT_PROBE_DEBUG_OUT 1) +endif() +option(OPT_CMSIS_DAPV1 "Enable CMSIS-DAPv1" 1) +option(OPT_CMSIS_DAPV2 "Enable CMSIS-DAPv2" 1) +option(OPT_TARGET_UART "Enable CDC for target UART I/O" 1) +option(OPT_PROBE_DEBUG_OUT "Enable CDC for probe debug output" ${DEFAULT_OPT_PROBE_DEBUG_OUT}) +option(OPT_SIGROK "Enable sigrok" 0) +option(OPT_MSC "Enable Mass Storage Device" 1) +option(OPT_MSC_RAM_UF2 "Enable file 'RAM.UF2' on Mass Storage" 1) +set(OPT_MCU_OVERCLOCK_MHZ "240" CACHE STRING "Set processor frequency. Should be a multiple of 24MHz, disable with empty string (=120MHz)") +set(OPT_NET "NCM" CACHE STRING "Enable lwIP on the Pico via NCM/ECM/RNDIS, disable NET with empty string") +set(OPT_NET_192_168 14 CACHE STRING "Set the subnet of 192.168.x") +option(OPT_NET_ECHO_SERVER "Enable echo server for testing" 1) +option(OPT_NET_IPERF_SERVER "Enable iperf server for tuning" 1) +option(OPT_NET_SYSVIEW_SERVER "Enable SysView over TCPIP" 1) +option(OPT_CDC_SYSVIEW "Enable SysView over CDC" 0) + +# extra +option(OPT_SPECIAL_CLK_FOR_PIO "Ignore clock frequency request of 1MHz (this is for PlatformIO tuning)" 0) + + +# +# SDK options # -# below order is important +set(PICO_STDIO_UART 0) # disable stdio UART, actually this goes to a CDC + +# +# below (and above) order is important # include(pico_sdk_import.cmake) @@ -19,8 +59,30 @@ include(FreeRTOS_Kernel_import.cmake) set(PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}/include/boards) pico_sdk_init() +# message("--------- " ${PICO_LWIP_PATH}) +# message("--------- " ${PICO_LWIP_CONTRIB_PATH}) +# message("--------- " ${PICO_TINYUSB_PATH}) + +# +# set some things inherited from Makefile / command line +# +if(PICOPROBE_VERSION_MAJOR) + add_definitions(-DPICOPROBE_VERSION_MAJOR=${PICOPROBE_VERSION_MAJOR}) +else() + set(PICOPROBE_VERSION_MAJOR 0) +endif() +if(PICOPROBE_VERSION_MINOR) + add_definitions(-DPICOPROBE_VERSION_MINOR=${PICOPROBE_VERSION_MINOR}) +else() + set(PICOPROBE_VERSION_MINOR 0) +endif() -project(${PROJECT}) +project(${PROJECT} + VERSION ${PICOPROBE_VERSION_MAJOR}.${PICOPROBE_VERSION_MINOR} + DESCRIPTION "YAPicoprobe CMSIS-DAP" + HOMEPAGE_URL https://github.com/rgrr/yapicoprobe + LANGUAGES C CXX ASM +) string(TOUPPER ${PICO_BOARD} PICO_BOARD_UPPER) @@ -32,31 +94,21 @@ add_definitions( -DPICO_HEAP_SIZE=0x0 -DPICO_STACK_SIZE=0x400 -DTARGET_BOARD_${PICO_BOARD_UPPER} + -DOPT_SPECIAL_CLK_FOR_PIO=${OPT_SPECIAL_CLK_FOR_PIO} ) - -# -# set some things inherited from Makefile / command line -# -if (PICOPROBE_VERSION_MAJOR) - add_definitions(-DPICOPROBE_VERSION_MAJOR=${PICOPROBE_VERSION_MAJOR}) -else() - set(PICOPROBE_VERSION_MAJOR 0) -endif() -if (PICOPROBE_VERSION_MINOR) - add_definitions(-DPICOPROBE_VERSION_MINOR=${PICOPROBE_VERSION_MINOR}) -else() - set(PICOPROBE_VERSION_MINOR 0) +if(NOT OPT_MCU_OVERCLOCK_MHZ STREQUAL "") + add_compile_definitions(OPT_MCU_OVERCLOCK_MHZ=${OPT_MCU_OVERCLOCK_MHZ}) endif() # set version string to "x.yy" # there are perhaps smarter ways... -if (PICOPROBE_VERSION_MINOR LESS "10") +if(PICOPROBE_VERSION_MINOR LESS "10") add_definitions(-DPICOPROBE_VERSION_STRING="${PICOPROBE_VERSION_MAJOR}.0${PICOPROBE_VERSION_MINOR}") else() add_definitions(-DPICOPROBE_VERSION_STRING="${PICOPROBE_VERSION_MAJOR}.${PICOPROBE_VERSION_MINOR}") endif() -if (GIT_HASH) +if(GIT_HASH) add_definitions(-DGIT_HASH="${GIT_HASH}") endif() @@ -65,9 +117,8 @@ endif() add_executable(${PROJECT} - src/cdc_uart.c src/dap_util.c - src/get_serial.c + src/get_config.c src/led.c src/main.c src/misc_utils.c @@ -78,12 +129,6 @@ add_executable(${PROJECT} src/usb_descriptors.c ) -if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - target_sources(${PROJECT} PRIVATE - src/cdc_debug.c - ) -endif() - target_sources(${PROJECT} PRIVATE CMSIS_5/CMSIS/DAP/Firmware/Source/DAP.c CMSIS_5/CMSIS/DAP/Firmware/Source/JTAG_DP.c @@ -102,8 +147,6 @@ target_include_directories(${PROJECT} PRIVATE # this is for MSC/DAPLink operation # target_sources(${PROJECT} PRIVATE - src/msc/msc_drive.c - src/msc/msc_utils.c src/daplink/daplink/util.c src/daplink/daplink/drag-n-drop/flash_manager.c src/daplink/daplink/interface/swd_host.c @@ -144,22 +187,143 @@ add_compile_definitions(DAPLINK_HIC_ID=0x08154711) # required to get required DAPLink functions add_compile_definitions(DRAG_N_DROP_SUPPORT=1) +#-------------------------------------------------------------------------------------------------- +# +# Enable/disable several USB endpoints +# +if(OPT_TARGET_UART) + add_compile_definitions(OPT_TARGET_UART=1) + target_sources(${PROJECT} PRIVATE + src/cdc/cdc_uart.c + ) +endif() +if(OPT_PROBE_DEBUG_OUT) + add_compile_definitions(OPT_PROBE_DEBUG_OUT=1) + target_sources(${PROJECT} PRIVATE + src/cdc/cdc_debug.c + ) +endif() +if(OPT_CMSIS_DAPV1) + add_compile_definitions(OPT_CMSIS_DAPV1=1) +endif() +if(OPT_CMSIS_DAPV2) + add_compile_definitions(OPT_CMSIS_DAPV2=1) +endif() +if(OPT_CDC_SYSVIEW) + add_compile_definitions(OPT_CDC_SYSVIEW=1) + target_sources(${PROJECT} PRIVATE + src/cdc/cdc_sysview.c + ) +endif() + #-------------------------------------------------------------------------------------------------- # # this is for SIGROK operation (taken from https://github.com/pico-coder/sigrok-pico) # -target_sources(${PROJECT} PRIVATE +if(OPT_SIGROK) + add_compile_definitions(OPT_SIGROK=1) + + target_sources(${PROJECT} PRIVATE src/pico-sigrok/cdc_sigrok.c src/pico-sigrok/sigrok.c src/pico-sigrok/sigrok_int.c -) + ) -target_link_libraries(${PROJECT} PRIVATE + target_link_libraries(${PROJECT} PRIVATE hardware_adc hardware_dma -) + ) + + pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/src/pico-sigrok/sigrok.pio) +endif() + +#-------------------------------------------------------------------------------------------------- +# +# this is for SystemView operation (requires RTT) +# +if(NOT OPT_NET STREQUAL "") + if(OPT_NET STREQUAL "ECM") + add_compile_definitions(OPT_NET_PROTO_ECM=1) + elseif(OPT_NET STREQUAL "NCM") + add_compile_definitions(OPT_NET_PROTO_NCM=1) + elseif(OPT_NET STREQUAL "RNDIS") + add_compile_definitions(OPT_NET_PROTO_RNDIS=1) + else() + message(FATAL_ERROR "OPT_NET must be either empty or one of ECM/NCM/RNDIS but is '${OPT_NET}'") + endif() + + add_compile_definitions(OPT_NET=1) + add_compile_definitions(OPT_NET_192_168=${OPT_NET_192_168}) + + target_sources(${PROJECT} PRIVATE + src/net/net_glue.c + + ${PICO_TINYUSB_PATH}/lib/networking/dhserver.c + ) + + if(OPT_NET STREQUAL "NCM") + # NCM: use own copy of ncm_device, original one is removed from target_sources() with a trick + message("--------- " ${PICO_TINYUSB_PATH}) + target_sources(${PROJECT} PRIVATE + src/net/tinyusb/ncm_device_simple.c + ) + set_source_files_properties( + ${PICO_TINYUSB_PATH}/src/class/net/ncm_device.c + PROPERTIES HEADER_FILE_ONLY ON + ) + else() + # !NCM + target_sources(${PROJECT} PRIVATE + ${PICO_TINYUSB_PATH}/lib/networking/rndis_reports.c + ) + endif() + + target_include_directories(${PROJECT} PRIVATE + ${PICO_TINYUSB_PATH}/lib/networking + ) + + target_link_libraries(${PROJECT} PRIVATE + pico_lwip_freertos + ) -pico_generate_pio_header(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/src/pico-sigrok/sigrok.pio) + if(OPT_NET_SYSVIEW_SERVER) + add_compile_definitions(OPT_NET_SYSVIEW_SERVER=1) + target_sources(${PROJECT} PRIVATE + src/net/net_sysview.c + ) + endif() + + if(OPT_NET_ECHO_SERVER) + add_compile_definitions(OPT_NET_ECHO_SERVER=1) + target_sources(${PROJECT} PRIVATE + src/net/net_echo.c + ) + endif() + + if(OPT_NET_IPERF_SERVER) + add_compile_definitions(OPT_NET_IPERF_SERVER=1) + target_sources(${PROJECT} PRIVATE + ${PICO_LWIP_PATH}/src/apps/lwiperf/lwiperf.c + ) + endif() +endif() + +#-------------------------------------------------------------------------------------------------- +# +# this is for MSC operation +# +if(OPT_MSC) + add_compile_definitions(OPT_MSC=1) + + target_sources(${PROJECT} PRIVATE + src/msc/msc_drive.c + src/msc/msc_utils.c + ) + + if(OPT_MSC_RAM_UF2) + add_compile_definitions(OPT_MSC_RAM_UF2=1) + endif() +endif() #-------------------------------------------------------------------------------------------------- diff --git a/Makefile b/Makefile index bcdb7c82f..d67e4cf80 100755 --- a/Makefile +++ b/Makefile @@ -4,9 +4,9 @@ # VERSION_MAJOR := 1 -VERSION_MINOR := 14 +VERSION_MINOR := 15 -BUILD_DIR := build +BUILD_DIR := _build PROJECT := picoprobe @@ -45,7 +45,7 @@ details: all .PHONY: cmake-create-debug cmake-create-debug: - cmake -B $(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DPICO_BOARD=$(PICO_BOARD) $(CMAKE_FLAGS) + cmake -B $(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DPICO_BOARD=$(PICO_BOARD) $(if $(OPT_SIGROK),-DOPT_SIGROK=$(OPT_SIGROK)) $(CMAKE_FLAGS) # don't know if this is required @cd $(BUILD_DIR) && sed -i 's/arm-none-eabi-gcc/gcc/' compile_commands.json @@ -73,16 +73,16 @@ flash: all .PHONY: create-images create-images: $(MAKE) clean-build - $(MAKE) cmake-create-debug PICO_BOARD=pico + $(MAKE) cmake-create-release PICO_BOARD=pico OPT_SIGROK=0 $(MAKE) all mkdir -p images cp $(BUILD_DIR)/$(PROJECT).uf2 images/yapicoprobe-$(shell printf "%02d%02d" $(VERSION_MAJOR) $(VERSION_MINOR))-pico-$(GIT_HASH).uf2 # - $(MAKE) cmake-create-debug PICO_BOARD=pico_w + $(MAKE) cmake-create-release PICO_BOARD=pico_w OPT_SIGROK=0 $(MAKE) all cp $(BUILD_DIR)/$(PROJECT).uf2 images/yapicoprobe-$(shell printf "%02d%02d" $(VERSION_MAJOR) $(VERSION_MINOR))-picow-$(GIT_HASH).uf2 # - $(MAKE) cmake-create-debug PICO_BOARD=pico_debug_probe + $(MAKE) cmake-create-release PICO_BOARD=pico_debug_probe OPT_SIGROK=0 $(MAKE) all cp $(BUILD_DIR)/$(PROJECT).uf2 images/yapicoprobe-$(shell printf "%02d%02d" $(VERSION_MAJOR) $(VERSION_MINOR))-picodebugprobe-$(GIT_HASH).uf2 @@ -91,3 +91,8 @@ create-images: check-clang: # clang-tidy has its limit if another target is used... @cd $(BUILD_DIR) && run-clang-tidy -checks='-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling' + +.PHONY: show-options +show-options: + @cd $(BUILD_DIR) && cmake -LH . | sed -n -e '/OPT_/{x;1!p;g;$!N;p;D;}' -e h + diff --git a/README.adoc b/README.adoc index 425bbb2db..e48eaa245 100644 --- a/README.adoc +++ b/README.adoc @@ -32,8 +32,9 @@ Finally there is **Y**et **A**nother **Picoprobe** around, the YAPicoprobe. ** UART connection between target and probe is redirected ** RTT terminal channel is automatically redirected into this CDC (if there is no CMSIS-DAPv2/MSC connection) -* CDC - virtual com port for logging of the probe -* CDC sigrok probe - data collection on eight digital and three analog channels +* https://www.segger.com/products/development-tools/systemview/[SystemView] support over TCP/IP (NCM/ECM/RNDIS) +* CDC - virtual com port for (debug) logging of the probe +* optional CDC sigrok probe - data collection on eight digital and three analog channels (logic analyzer and oscilloscope) with auto-trigger capability * LED for state indication * Other Benefits @@ -80,6 +81,8 @@ For information about cabling between Pico Debug Probe and target refer to the c https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html[documentation]. For details about probe pin assignments see the link:doc/hardware.adoc[hardware section]. +Ochamodev wrote a nice https://github.com/ochamodev/raspberry_pico_setup_guide[setup guide], +containing the steps from installation until debugging in VSCode. @@ -96,7 +99,7 @@ For details about probe pin assignments see the link:doc/hardware.adoc[hardware |yes |`openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 25000" -c "program {firmware.elf} verify reset; shutdown;"` -|pyOCD 0.34.x +|pyOCD 0.34 & 0.35 |yes |yes |`pyocd flash -f 400000 -t nrf52840 firmware.elf` @@ -107,6 +110,9 @@ For details about probe pin assignments see the link:doc/hardware.adoc[hardware |`cp firmware.uf2 /media/picoprobe` |=== +NOTE: For best RP2040 support, OpenOCD bundled with PlatformIO is recommended. + See <> + #### Parameter Optimization @@ -143,7 +149,7 @@ Unfortunately DAP converts internally the frequency into delays which are always That means that actual clock speeds are `125MHz / (2*n)`, `n>=3` -> 20833kHz, 12500kHz, 10417kHz, ... Normally the requested frequency is rounded down according to the possible values from above. But if the specified frequency -is completely out of range, the allowed maximum SWD frequency of the RP2040 is used, which is 24MHz. +is completely out of range, the allowed maximum target SWD frequency is used, e.g. for the RP2040 24MHz. Actually usable frequency depends on cabling and the DAP speed. If the DAP cannot access memory with speed determined by the host, it responds with WAIT and the host needs to retry. @@ -189,17 +195,16 @@ Because CMSIS-DAP access should be generic, flashing of other SWD compatible dev ### RTT - Real Time Transfer https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/[RTT] -allows transfer from the target to the host in "realtime". YAPicoprobe currently reads -channel 0 of the targets RTT and sends it into the CDC of the target. Effectively this -allows RTT debug output into a terminal. +allows transfer from the target to the host in "realtime" via the SWD interface. + +The RTT control block on the target is automatically detected. Currently channels 0 and 1 are supported. -If an RTT control block has been detected, characters received via the target CDC are transmitted -with RTT to the target. +To get the RTT channels running, code on the target has to be either instrumented or adopted. [NOTE] ==== * only the devices RAM is scanned for an RTT control block, for unknown devices - RAM in the range 0x20000000-0x2003ffff is assumed + RAM the range 0x20000000-0x2003ffff is assumed * don't be too overwhelmed about Seggers numbers in the above mentioned document. The data must still be transferred which is not taken into account in the diagram @@ -211,11 +216,34 @@ with RTT to the target. ==== +#### Terminal I/O + +RTT channel 0 is used for bidirectional console communication. This channel is directed into the UART CDC +of the target device. + +Communication is birectional, but don't expect high transfer rates from host to target. + + +#### SystemView + +RTT channel 1 is used for communication with Seggers https://www.segger.com/products/development-tools/systemview/[SystemView]. +YAPicoprobe provides the data over TCP at port 19111 which is the default for SystemView communication. +Default IP address of the probe (if not built otherwise) is 192.168.14.1. + +[NOTE] +==== +SystemView communication via TCP/IP had been chosen to spare you from another CDC port and also +because SystemView over COM port works on my Linux device just until v3.30 (Segger promises +a fix for > 3.50a, nevertheless TCP/IP is used...) +==== + + ### Sigrok - Data Collection [IMPORTANT] ==== -Sigrok is disabled on the Pico Debug Probe. +Sigrok is no longer compiled per default into the probe firmware. If you want sigrok support, +the <> have to be checked. ==== The probe allows data collection for a https://sigrok.org/[sigrok] compatible @@ -327,9 +355,9 @@ The Pico Debug Probe has four additional LEDs. Assignment is as follows: ==== -### Configuration +## Configuration -#### udev rules for MSC and CMSIS-DAP +### udev rules Under Linux one wants to use the following udev rules for convenience. @@ -343,6 +371,7 @@ SUBSYSTEM=="usb", ATTR{idVendor}=="2e8a", ATTR{idProduct}=="000c", MODE:="0666" ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ATTRS{interface}=="YAPicoprobe CDC-UART", MODE:="0666", SYMLINK+="ttyPicoTarget" ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ATTRS{interface}=="YAPicoprobe CDC-DEBUG", MODE:="0666", SYMLINK+="ttyPicoProbe" ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ATTRS{interface}=="YAPicoprobe CDC-SIGROK", MODE:="0666", SYMLINK+="ttyPicoSigRok +ACTION=="add", SUBSYSTEMS=="usb", KERNEL=="ttyACM[0-9]*", ATTRS{interface}=="YAPicoprobe CDC-SysView", MODE:="0666", SYMLINK+="ttyPicoSysView" # mount Picoprobe to /media/picoprobe ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="000c", RUN+="/usr/bin/logger --tag picoprobe-mount Mounting what seems to be a Raspberry Pi Picoprobe", RUN+="/usr/bin/systemd-mount --no-block --collect --fsck=0 -o uid=hardy,gid=hardy,flush $devnode /media/picoprobe" @@ -353,7 +382,53 @@ ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesys ACTION=="remove", SUBSYSTEMS=="usb", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0003", RUN+="/usr/bin/logger --tag rpi-pico-mount Unmounting what seems to be a Raspberry Pi Pico", RUN+="/usr/bin/systemd-umount /media/pico" ---- -#### PlatformIO +### Network Configuration + +SystemView connectivity over TCP/IP is on most systems not configuration free. + +#### Debian + +On Debian the configuration is as follows: + +* after connecting the probe with the host, `ip a` shows its network interface, e.g. `enxfe`. + If the network interface already shows an IP address everything is fine and you are ready +* if not, then you can get the IP address with `sudo dhclient enxfe` +* to make the permanent add the following lines to `/etc/network/interfaces`: + +[source] +---- +allow-hotplug enxfe +iface enxfe inet dhcp +---- + +On my system this unfortunately leads to error messages (which are harmless) if the probe is not connected. + +The default address of the probe is 192.168.14.1. If there is a collision with the current setup of the +host, the probe firmware has to be rebuilt with `-DOPT_NET_192_168=`. + +#### Win10 + +A certain version of Win10 is required for USB-NCM connectivity. Exact version is unknown. + +The driver needs to be installed manually. Procedure is roughly as follows: + +* in "Device Manager" search for `YaPicoprobe NCM` with an exclamation mark +* "Update Driver" +* "Browse my computer for drivers" +* "Let me pick..." +* "Network adapters" +* "Microsoft" +* "UsbNcm Host Device" - if this is not available, then the version of Win10 is not ready for USB-NCM +* confirm any dialog boxes +* if `ipconfig` on a command line shows `192.168.14.2` for an Ethernet adapter, the procedure has most likely + succeeded and SystemView is ready for operation + +#### Win11 + +It is said, that USB-NCM is working out of the box. This is not tested. + + +### PlatformIO [[platformio]] https://platformio.org/[PlatformIO] configuration in `platformio.ini` is pretty straight forward: .PlatformIO configuration @@ -384,12 +459,12 @@ upload_command = cp .pio/build/pico_cp/firmware.uf2 /media/picoprobe I'm sure there are smarter ways to specify the image path. -There is also a special PlatformIO handling in the probe: it ignores the defensive 1MHz clock setting which is used by +Optional: there is also a special PlatformIO handling in the probe: it ignores the defensive 1MHz clock setting which is used by the above contained OpenOCD. Standard clock is thus 15MHz. If this is too fast, set the frequency with `pyocd reset -f 1100000 -t rp2040` or similar. If this is too slow, use `pyocd reset -f 50000000 -t rp2040`. -##### RTT +#### RTT To use RTT for debug/console output the following has to be done: * in `platformio.ini`: @@ -427,7 +502,7 @@ rtt.println("sub module"); ## Internals -### Building from Source +### Building from Source [[how-to-build]] Building from source is done with the help of a stub Makefile which eases integration into Eclipse (but can be used from command line as well). The Makefile creates via cmake a `build.ninja` which is responsible for @@ -436,6 +511,8 @@ the actual build process. To build the project, there must be somewhere a recent https://github.com/raspberrypi/pico-sdk[Pico SDK] and the environment variable `PICO_SDK_PATH` must point to it. +If you want to adopt YAPicoprobe options to your needs, check CMakeLists.txt and invoke cmake accordingly. + Requirements: * arm-none-eabi-gcc @@ -453,10 +530,10 @@ git submodule update --init .General build sequence [source,bash] ---- -# create build/ninja.build for a debug target +# create _build/ninja.build for a debug target make cmake-create-debug -# build yapicoprobe, output in build/picoprobe.uf2 +# build yapicoprobe, output in _build/picoprobe.uf2 make all # clean build files @@ -477,6 +554,19 @@ make all make create-images ---- +.Bare call of cmake +[source,bash] +---- +mkdir _build; cd _build +cmake .. -D