remote: add RESET variable#9428
Conversation
|
@kYc0o how did you test this? Which board revision and which test? On my side, |
|
I'm investigating, strangely I notice the same behaviour as you in a raspberry, but with in my OS X everything works... What happens if you try |
|
|
Which is completely normal since the serial line cannot be opened by two processes.
Yes, but this is because the target doesn't succeed to reset. In OS X succeeds as follows: snake:RIOT facosta$ BOARD=remote-revb make -C tests/pkg_tinycrypt/ flash-only test
make: Entering directory '/Users/facosta/git/RIOT-OS/RIOT/tests/pkg_tinycrypt'
/Users/facosta/git/RIOT-OS/RIOT/dist/tools/cc2538-bsl/cc2538-bsl.py -p "/dev/tty.SLAB_USBtoUART" -e -w -v -b 115200 /Users/facosta/git/RIOT-OS/RIOT/tests/pkg_tinycrypt/bin/remote-revb/tests_pkg_tinycrypt.bin
Opening port /dev/tty.SLAB_USBtoUART, baud 115200
Reading data from /Users/facosta/git/RIOT-OS/RIOT/tests/pkg_tinycrypt/bin/remote-revb/tests_pkg_tinycrypt.bin
Cannot auto-detect firmware filetype: Assuming .bin
Connecting to target...
CC2538 PG2.0: 512KB Flash, 32KB SRAM, CCFG at 0x0027FFD4
Primary IEEE Address: 00:12:4B:00:14:D5:2D:91
Erasing 524288 bytes starting at address 0x00200000
Erase done
Writing 524288 bytes starting at address 0x00200000
Write 16 bytes at 0x0027FFF0F8
Write done
Verifying by comparing CRC32 calculations.
Verified (match: 0xcac73e7a)
tests/01-run.py
/Users/facosta/git/RIOT-OS/RIOT/dist/tools/pyterm/pyterm -p "/dev/tty.SLAB_USBtoUART" -b "115200"
No handlers could be found for logger "root"
2018-06-28 13:33:38,964 - INFO # Connect to serial port /dev/tty.SLAB_USBtoUART
Welcome to pyterm!
Type '/exit' to exit.
2018-06-28 13:33:41,765 - INFO # "&��2 0x99 0xB3 0x1A 0x02 0xD7 0x3A ]
2018-06-28 13:33:41,769 - INFO #
2018-06-28 13:33:41,771 - INFO # And now decrypt the cipher again:
2018-06-28 13:33:41,773 - INFO # decrypted: [ 0x54 0x77 0x6F 0x20 0x4F 0x6E 0x65 0x20 0x4E 0x69 0x6E 0x65 0x20 0x54 0x77 0x6F ]
2018-06-28 13:33:41,774 - INFO # ASCII: Two One Nine Two
2018-06-28 13:33:41,774 - INFO #
2018-06-28 13:33:41,775 - INFO # [SUCCESS]
make: Leaving directory '/Users/facosta/git/RIOT-OS/RIOT/tests/pkg_tinycrypt' |
Did you already figure something out? |
Not yet. Tomorrow I'll have time. |
|
I've added the reset command to the script directly, it's cleaner but I don't know why the exit message still 2 and it's not what testrunner expects. I'll check further. |
|
For actual HIL testing in a fixed setup I would rather connect/wire the reset pin to a GPIO of the Raspberry Pi and trigger a reset there. |
|
@kYc0o still not working here. I don't quite understand why it is cleaner to adapt the @smlng the need for a pin-based reset for HIL shouldn't obsolete |
|
@PeterKietzmann I'm aware of the pinout and the reset pin, that's why I mentioned it - and b/c I'd rather not change the bsl script, too. However, I looked into it, and I guess there is no why of resetting the remote without either changing the bsl script or write a separate script coping parts from the bsl just for the reset command. |
|
Just in case, the original code on github has moved a bit during the last months, so modifying the bsl script will make it harder to backport it again into the RIOT code base. |
|
IMHO the script has changed a lot compared to the "original" one, which was just copied from the contiki repo. @gebart did some modifications to make it cleaner and thus, I'd say adding 3 lines of code won't make it worse to maintain, if ever there's actually a "need" to maintain it (with maintain I mean to "update" it according to the original script). |
|
Sorry, it was not @gebart who modified it, but several people. I just looked at the history. |
|
With this diff for the testrunner.py: diff --git a/dist/tools/testrunner/testrunner.py b/dist/tools/testrunner/testrunner.py
index 8678b90..51a55b1 100755
--- a/dist/tools/testrunner/testrunner.py
+++ b/dist/tools/testrunner/testrunner.py
@@ -46,11 +46,16 @@ def run(testfunc, timeout=10, echo=True, traceback=False):
child.logfile = sys.stdout
try:
- subprocess.check_output(('make', 'reset'), env=env,
+ print("resetting...")
+ out = subprocess.check_output(('make', 'reset'), env=env,
stderr=subprocess.PIPE)
- except subprocess.CalledProcessError:
+ print(out)
+
+ except subprocess.CalledProcessError as e:
# make reset yields error on some boards even if successful
+ print(e, e.output)
passIn OS X it works like a charm (python 3.6.5), but in Linux (python 3.5.2) I have the following: vagrant@vagrant:~/RIOT/tests/pkg_tinycrypt$ BOARD=remote-revb make test
tests/01-run.py
resetting...
Command '('make', 'reset')' returned non-zero exit status 2 b'/home/vagrant/RIOT/dist/tools/cc2538-bsl/cc2538-bsl.py -p "/dev/ttyUSB0" --reset\n/home/vagrant/RIOT/Makefile.include:478: recipe for target \'reset\' failed\n'
/home/vagrant/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyUSB0" -b "115200"However Any ideas? |
For CI HIL purposes a reset is needed before running the test target. The remote board didn't assign a RESET variable to perform a reset, so it wasn't possible to call `make test` correctly. By calling the flash script without arguments, a reset is performed.
|
So, modifying the cc2538-bsl.py script doesn't help at all so I removed the commit. What I think is the problem is that since the serial line is required for both reset and test, for some reason Linux is slow enough to not free the resource and thus it makes it fail, while in OS X is freed soon enough and thus succeeds. Then, the scope for this PR is just to add the reset command and not to make IMHO that should be handled either differently or by modifying testrunner. |
|
I can confirm that |
PeterKietzmann
left a comment
There was a problem hiding this comment.
Fine, let's go with this one for now. I've updated the above description because this PRdoes not fix make test but make reset
I agree. Thanks! |
Contribution description
For CI HIL purposes a reset is needed before running the test target. The remote board didn't assign a RESET variable to perform a reset,
so it wasn't possible to callmake testcorrectly.EDIT: It is still not possible to execute
make testcorrectlyBy calling the flash script without arguments, a reset is performed.
Issues/PRs references
none