-
Notifications
You must be signed in to change notification settings - Fork 92
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
Target is reset twice. #77
Comments
A few commits ago edbg changed its behavior and now it resets the board twice. This makes some tests fail, as the start on the first reset, but shortly after the board is reset again. See: ataradov/edbg#77 This comments out RESET and RESET_FLAGS in the edbg tool setting. Reset will now be done via OpenOCD, which is available and used anyways because it is needed for `make debug`.
It is probably safe to switch to "dap_reset_target_hw(0);" CM4v2 at this point does a reset with extension in the target_select() code anyway. The next problem would be that target_deselect() does a software reset, which would be followed by the hardware reset. This is done to ensure operation without a reset pin. I have no problem with the first change, in fact I think the whole reset may be removed from here and moved to individual targets select procedure. I will do that later today after some testing. But the second one will be remain as is, so if this is still a problem, removing the first reset will not help much. It is possible that target_deselect() and dap_reset_target_hw(1) happen fast enough that MCU does not have time to run any useful code, of course. |
I've moved the initial reset into the target specific code. This should fix your issue. |
I can confirm that the issue is solved. Thanks for the prompt response! |
The lastest version of edbg solves a double-reset issue that was hindering testing (see RIOT-OS#11125 and ataradov/edbg#77) It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU port.
The lastest version of edbg solves a double-reset issue that was hindering testing (see RIOT-OS#11125 and ataradov/edbg#77) It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU port.
The lastest version of edbg solves a double-reset issue that was hindering testing (see RIOT-OS#11125 and ataradov/edbg#77) It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU port.
The lastest version of edbg solves a double-reset issue that was hindering testing (see RIOT-OS#11125 and ataradov/edbg#77) It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU port.
The lastest version of edbg solves a double-reset issue that was hindering testing (see RIOT-OS#11125 and ataradov/edbg#77) It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU port.
The lastest version of edbg solves a double-reset issue that was hindering testing (see RIOT-OS#11125 and ataradov/edbg#77) It also adds support for SAMR34 and SAMR35, needed by @dylad for MCU port.
Description
This change (b65dc24#diff-00259a9e325566089cd936bcc3e75e50R564) caused targets to be reset twice. This is relevant when one just wants to reset (using, e.g.,
edbg -t atmel_cm0p
)The first reset:
edbg/edbg.c
Line 564 in b65dc24
The second reset:
edbg/edbg.c
Line 680 in b65dc24
Why is it relevant
In the RIOT OS test suite we reset the boards at the beginning of each test. The test script waits for a known string to start the test. With the current edbg behaviour the test starts and shortly afterwards the board is reset, causing it to fail. Since this is happening only with atmel boards using edbg, I'd like to avoid having to add a specific kludge to handle it in the test infrastructure if I can avoid it.
Steps to reproduce
Load an program that does something immediately after boot, for example output a string over the UART. In my case I'm running the RIOT OS test suite, and listening on the serial connection.
Reset the board with
edbg -t <target type>
(in my caseatmel_cm0p
.)Expected result
Board is reset once thus the message is sent once.
Actual result
Board is reset twice in a short span thus the message is sent twice.
The text was updated successfully, but these errors were encountered: