-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTT with FTDI board using OpenOCD #28
Comments
Well, I've managed to get it to work it seems. It appears that the SDK places the RTT control block randomly in the heap (unless specified otherwise). I was then further able to expose a TCP server on port So, all's well that ends well ;) |
Hey @ThisIsntTheWay. Thanks for sharing! I'm really interested in giving OpenOCD a go and I feel encouraged after reading your comments. Would you mind sharing how you flashed the softdevice & firmware as well? Btw, did you manage to find the original issue with the board? |
Hey @rbaron, I was indeed able to fix my issues with the board! Thanks to some googling I found some hints to overwrite the following definitions in #define NRF_SDH_CLOCK_LF_SRC 0
#define NRF_SDH_CLOCK_LF_RC_CTIV 16
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
#define NRF_SDH_CLOCK_LF_ACCURACY 1 This instructs the board to use the internal quartz. Interestingly enough, these definition values were already present in the code, but commented out. As for OpenOCD, I don't know how familiar you are with this tool already. Anyhow, I was able to program the nRF with the following commands:
Of course I did these commands in succession, that is first the soft device and then the b-parasite binary. To open an RTT session: Obviously the use of configuration script(s) (Parameter The One other tidbit about OpenOCD is that it cannot be interacted with in the terminal it was started in. Thus, to use it interactively, you must connect to I know this is kinda much information, but these are things I wish I knew when I started using OpenOCD. |
Hi @ThisIsntTheWay. Thanks for the fantastic and thoughtful writeup! It's incredibly helpful to me and for sure for other contributors. I will make sure to link your answer on the wiki. Tks! As for the original issue, both nRF52840 and nrF52833 have, in addition to the high frequency CPU clock (noted as HFCLK in the datasheet), a low frequency clock (LFCLK) that powers the real-time counter (RTC) to keep track of time using very little power. The LFCLK can be sourced in different ways (
I indeed experimented with the internal RC (the one that fixed your problem). While it works okay, I remember seeing spikes in current which I attributed to the periodic calibration. It's not the end of the world, but something to be aware of. We don't need precise sleep/wakeup timing, so it would also be interesting to see if we can optimize the RC source power consumption. If you have access to an oscilloscope, you should be able to probe the terminals of the crystal and check if there's anything wrong with it. |
Hi @rbaron, no problem and thanks for your insightful feedback! Yeah I figured that there was a reason for the external crystal. I indeed have access to an oscilloscope, albeit a cheap USB one. |
Alright, turns the XTAL does work and I just did a poor soldering job of the nRF module. Anyway, the board no longer locks up on |
This question is less about the p-parasite and more about OpenOCD.
As I lack access to a J-Link debugger to program the nRF SoC, I've had to resort to an FTDI-based programmer with OpenOCD.
However, I suspect that my b-parasite doesn't quite work right and wish to investigate the logs it generates.
(It never blinks the LED nor broadcasts any BLE packets and I think that it gets stuck at
power_management_init()
)Now I've been wondering how to make use of the RTT functionality with OpenOCD, because I can't seem to get that to work either.
As I understand, one has to setup RTT in OCD before being able to 'use' it.
(Syntax:
rtt setup <address> <size> <id>
)Unfortunately, if I try to do that with the example values as provided in the OCD docs, I am met with this message:
Both
NRF_LOG_ENABLED
andNRF_LOG_BACKEND_RTT_ENABLED
are set to1
insdk_config.h
.Perhaps I am using the wrong address or control block ID?
My knowledge about RTT is admittedly quite limited.
For reference, I am using a
nrf52833
.The text was updated successfully, but these errors were encountered: