-
Notifications
You must be signed in to change notification settings - Fork 290
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
--debug output not printingon nrf52840dk #561
Comments
Following your exact steps, I can't reproduce. The reset button for me does not disconnect RTT, and I still see all prints. I have no guess why the USB cable could be related, or why reset would disable prints. |
@jmichelp any ideas? |
Thanks for the ideas. Unfortunately on the develop branch I was unable to run the deploy script---I got a message about "fatal: No device to configure found" after the apps are written to the device. |
If you got that message, it means that you might have flashed OpenSK successfully. As the last step, we try to send a CTAP command to the board to configure it. This last step is performed over the USB port, not the debug port. There could be different reasons why OpenSK wouldn't properly work after you flashed it:
There are probably more options, but let's try those first. |
When I install the erase_storage app with the command you gave above, I get the same "no device to configure found" message---but I assume this is expected because there is no app to receive the CTAP2 command? After running this, I receive the same message when I try to flash OpenSK normally. All the switches are in the right place, and unfortunately as far as I can tell the device does not work on webauthn.io (but deploying stable does). I also periodically get messages from JLinkExe about "CTRL-AP indicates that the device is secured. For debugger connection the device needs to be unsecured. Note: Unsecuring will trigger a mass erase of the internal flash." Is this expected? I recently bought this dev kit, so I'm wondering if I have a newer hardware revision that is inconsistent in some way, and that's causing all my problems. |
Having only Could it be that you configured the device to be protected? You can use our configure script with @jmichelp Does
sound familiar? |
So, to confirm---in the develop branch, I need to have both the debug USB cable and the peripheral USB cable connected, correct? While on stable it works fine to program with only the debug USB cable attached? |
OK, I was able to get the develop branch working and somewhat fix the CTRL-AP thing. For future reference in case anyone else has the same problem, I had to download nRF command line tools and run:
I'm not sure how I got into the locked state (I think it is called APPROTECT, and I don't think I ever ran a command to lock the device), but this command writes to the registers to disable it as far as I can tell. If I run this command and then run Interestingly, though, if I then try to re-deploy with To me, this seems like OpenSK is securing the device even though I did not instruct it to, and since RST is disconnecting and reconnecting JLink, I am thinking that it doesn't take effect until then. I am also thinking along these lines because if I exit and reconnect JLinkExe after pressing reset, it tells me that I need to unsecure the device. Does this seem at all possible/is there any part of the code that sets this APPROTECT option? According to this article, it is address Edit: I found this, which definitely seems like it may explain my issues: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/working-with-the-nrf52-series-improved-approtect. It sounds like the 2022 version of the chip behaves a bit differently than older ones---In particular, the default is now that debugging is disabled, except "after an ERASEALL operation is executed via the CTRL-AP the device should be accessible to a debugger until it executes a pin, power, or brownout reset" So perhaps this explains the reset behavior. Are you aware of anyone that has developed with OpenSK on this year's version of the board? It sounds like there is some extra register than needs to be set by firmware to unlock debugging after each reset. |
Thanks for the investigation, we don't have a 2022 edition dev board, so we haven't been able to reproduce yet. But it's nice that your manual is here for other people who might stumble upon this.
You can deploy on both
Correct, we lock the device if you call the configure script with a specific set of parameters. But since you don't do that, your explanation is better :) We should update our documentation to account for 2022 edition hardware. |
I think there are some code changes necessary in order to support the 2022 boards as well in addition to documentation---in particular:
I have debug output working after a reset now with these two changes. I'm happy to try to clean up and share my code if it would be useful, but not sure if I will have time to fully production-ize it to work across revisions (especially since I don't have an older one to test on). And I'm sure there is a much nicer way to do it than what I hacked together with my very limited knowledge of Tock/OpenSK. Relatedly, most of these changes are in |
Assuming
The process is simpler if you do |
Hi,
I am hoping to do some work based on OpenSK but am having some difficulty getting the debug printouts to work. Is there something that I am missing in this process?
When I use an unmodified (non-opensk) version of tock, I am able to see the "Initialization complete. Entering main loop'" printout as well as extra printouts made by userspace apps (such as the libtock-c button-print example). Using OpenSK, when I do not have the OpenSK connected to my computer via the USB peripheral cable, I can see this message as well as an explicit print statement that I added in the main loop. When I have the USB peripheral cable connected, I cannot see any of these printouts.
edit: I am now thinking that the issue may be just that pressing the reset button (even without the peripheral usb attached) stops the console writes from showing up. Is this expected behavior?
Expected Behavior
When I start a server in one terminal with:
And a client in another with:
and then deploy opensk to my board with:
I see the Tock initialization printout and additional opensk debug output when going through an example setup flow.
Actual Behavior
There is no output in the RTT terminal beyond the following when the peripheral USB cable is connected and after pushing the reset button to connect:
When the peripheral USB cable is not connected, I can see other outputs but cannot see debug print statements (though this could be because I am not able to initiate an authentication flow without the second USB connected)
Steps to Reproduce the Problem
As above.
Specifications
stable
branch 1b70583The text was updated successfully, but these errors were encountered: