Re: Soft serial 9k6 for debugging on free GPIO?
Hi Henrik,toggle quoted messageShow quoted text
RTT is the way to move forward as it seems, since it will provide a clean interface both on hardware and config. Thanks for pointing me there, and thanks for the soft-serial pointers from others in this thread as it might come in handy.
So, I've tried for the last two days to set RTT up, using the blinky or logging examples using a PCA10059 nRF52840 dongle just to experiment. I'm not connecting the dongle using USB but with a tag-connect TC2050-IDC-NL on the Segger J-Link with the pogo-pins directly on the board.
If I only use the CONFIG_RTT_CONSOLE=y nothing happens and the JLinkRTTLogger keeps searching for the RTT Control Block. Nothing happens.
If I take the log sample from the Zephyr project and use the prj_rtt.conf setting provided I run into different issues:
When using the Nordic SDK I'm getting into a world of hurt getting the Segger to compile in as this is triggered by the CONFIG_USE_SEGGER_RTT directive which can be fixed adding more include directories. The RTT tarball from Segger J-Link install is more forgiven, but I cannot get my project to compile since it eventually boils down to a missing include file on the ninja ccache step
[109/116] Building C object zephyr/CMakeFiles/zephyr.dir/drivers/console/rtt_console.c.obj
ccache /usr/local/bin/arm-none-eabi-gcc -DBUILD_VERSION=zephyr-v1.14.0-1238-gbd001081fce1 -DKERNEL -DNRF52840_XXAA -D_FORTIFY_SOURCE=2 -D__ZEPHYR__=1 -I../../../../../kernel/include -I../../../../../arch/arm/include -I../../../../../include -I../../../../../include/drivers -Izephyr/include/generated -I../../../../../soc/arm/nordic_nrf/nrf52 -I../../../../../soc/arm/nordic_nrf/include -I../../../../../lib/libc/minimal/include -I../../../../../ext/hal/cmsis/Include -I../../../../../ext/hal/nordic/nrfx -I../../../../../ext/hal/nordic/nrfx/drivers/include -I../../../../../ext/hal/nordic/nrfx/hal -I../../../../../ext/hal/nordic/nrfx/mdk -I../../../../../ext/hal/nordic/. -isystem /usr/local/Cellar/arm-none-eabi-gcc/8-2018-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/8.2.1/include -isystem /usr/local/Cellar/arm-none-eabi-gcc/8-2018-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/8.2.1/include-fixed -Os -nostdinc -g -imacros /Users/smeedy/code/zephyrproject/zephyr/samples/subsys/logging/logger/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -mthumb -mcpu=cortex-m4 -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/Users/smeedy/code/zephyrproject/zephyr=. -ffunction-sections -fdata-sections -mabi=aapcs -march=armv7e-m -std=c99 -MD -MT zephyr/CMakeFiles/zephyr.dir/drivers/console/rtt_console.c.obj -MF zephyr/CMakeFiles/zephyr.dir/drivers/console/rtt_console.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/drivers/console/rtt_console.c.obj -c /Users/smeedy/code/zephyrproject/zephyr/drivers/console/rtt_console.c
/Users/smeedy/code/zephyrproject/zephyr/drivers/console/rtt_console.c:16:10: fatal error: SEGGER_RTT.h: No such file or directory
Could be this is going to be a cmake question (sorry for that). I added stuff like include_directories(...) and others into the CMakeLists.txt file, but I cannot seem to get this going since the extra include dirs keep on missing.
Any pointers are welcome,
Thanks again for your time,
On 01/06/2019, 14:11, "devel@... on behalf of Henrik Brix Andersen" <devel@... on behalf of henrik@...> wrote:
If you are using a Segger J-Link probe you can use the RAM-based RTT console by setting CONFIG_RTT_CONSOLE=y
See https://docs.zephyrproject.org/latest/guides/debugging/host-tools.html#jlink-debug-host-tools for more information.
Henrik Brix Andersen
On 31 May 2019, at 15.53, martijn@... wrote:>
> Hi there,
> We have a prototype utilising the nRF52840 BME340 SoC module. Since we use a LoRaWAN module and a MAX3485 we used the two 840 uarts for connecting to these subsystems. But I do have some free GPIOs on the prototype PCB which I'd like to use as a console when running the project in debug mode. So I'm looking for a way to have a low-speed soft-serial taking care of logging. Any pointers, or perhaps other ways to get logging output (we are using BLE)?
> Looked at some discussions on the Nordic devzone, but not a lot going for it.