zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.86k stars 6.62k forks source link

Can not use USE_SEGGER_RTT #63307

Closed KlemenDEV closed 1 year ago

KlemenDEV commented 1 year ago

Describe the bug

When trying to use USE_SEGGER_RTT, I get the following fault

warning: USE_SEGGER_RTT (defined at modules\segger\Kconfig:12) was assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies: HAS_SEGGER_RTT (=n), 0 (=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_USE_SEGGER_RTT and/or look up USE_SEGGER_RTT in the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.

To Reproduce Steps to reproduce the behavior:

I did no changes to the code to get the warning shown above, so this is either bug with zepyhr or something in the sample configuration is wrong.

Expected behavior

RTT should be enabled.

This bug prevents from using RTT in the current latest release (west update) of zepyhr.

More context

I have checked what HAS_SEGGER_RTT is selected by (https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_HAS_SEGGER_RTT) and it is selected by CONFIG_SOC_SERIES_NRF52X (https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SOC_SERIES_NRF52X) so not sure why this is not working.

Board nrf52833dk_nrf52833 defines CONFIG_SOC_SERIES_NRF52X so this seems ok, but still the error happens.

It used to work properly in older versions of zepyhr in the same sample, but since I updated it, this is happening.

nordicjm commented 1 year ago

Works fine for me, you probably forgot to do west update or you have a manifest which blocks getting the segger repo

KlemenDEV commented 1 year ago

This has happened after I ran west update. I was able to use RTT just fine before running this command after picking up the project after a while

KlemenDEV commented 1 year ago

you have a manifest which blocks getting the segger repo

Where can I check that?

nordicjm commented 1 year ago
cmake -GNinja -DBOARD=nrf52833dk_nrf52833 ..
...
ninja
...
[200/200] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      117920 B       512 KB     22.49%
             RAM:       37528 B       128 KB     28.63%
        IDT_LIST:          0 GB         2 KB      0.00%

grep -r "_RTT" zephyr/.config 
CONFIG_HAS_SEGGER_RTT=y
CONFIG_USE_SEGGER_RTT=y
# CONFIG_SEGGER_RTT_CUSTOM_LOCKING is not set
CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS=3
CONFIG_SEGGER_RTT_MAX_NUM_DOWN_BUFFERS=3
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=1024
CONFIG_SEGGER_RTT_BUFFER_SIZE_DOWN=16
CONFIG_SEGGER_RTT_PRINTF_BUFFER_SIZE=64
CONFIG_SEGGER_RTT_MODE_NO_BLOCK_SKIP=y
# CONFIG_SEGGER_RTT_MODE_NO_BLOCK_TRIM is not set
# CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL is not set
CONFIG_SEGGER_RTT_MODE=0
# CONFIG_SEGGER_RTT_MEMCPY_USE_BYTELOOP is not set
CONFIG_SEGGER_RTT_SECTION_NONE=y
# CONFIG_SEGGER_RTT_SECTION_DTCM is not set
# CONFIG_BT_DEBUG_MONITOR_RTT is not set

git log --oneline
48f70eba2b (HEAD -> main, origin/main, origin/HEAD) Bluetooth: Controller: Fix clang warning on ull
nordicjm commented 1 year ago

you have a manifest which blocks getting the segger repo

Where can I check that?

Are you using a custom manifest or west init && west update directly?

KlemenDEV commented 1 year ago

Ok, I see what you mean, I use https://github.com/zephyrproject-rtos/example-application for the base of the workspace.

Strange that it worked before.

What do I need to add in west.yml for this to work?

KlemenDEV commented 1 year ago

Okay got it, sorry for the confusion.

For anyone having a similar problem, one needs to either remove name-allowlist or add segger to it if using https://github.com/zephyrproject-rtos/example-application

Thank you @nordicjm for your assistance!