Posts by hotbrix
-
-
Hi
I have the following:
SEGGER_RTT_printf(0, "midnight_tick: last: %u, now: %u\r\n", last, now);
SEGGER_RTT_printf(0, "midnight_tick: now: %u, last: %u\r\n", now, last);This prints:
midnight_tick: last: 10957, now: 0
midnight_tick: now: 10957, last: 0Note that the second argument is always printed as 0 but none of the args is 0. There is no concurrency involved, the arguments last and now dont change between the two calls.
Sorry, if I am missing something trivial ...
Kind regards
Peter -
Thanks Fabian
This is exactly what I meant with "simpler way", sorry for the roundabout nature of my question.
I didn't realize that you can continue to do loadbin ... without a prior connect.Kind regards
Peter -
Hi Fabian
I apologize if my wording is not precise, I am new to this field.
Yes, with "uploading the firmware" I mean programming the device.And I am using JLinkExe on Linux to do this with a JLink plus compact.
What I am doing is a kind of unit testing:- compile and build the test ( I use platform.io and VSCode)
- upload the binary with the following commands:===================
> /usr/bin/JLinkExe -NoGui 1 -CommandFile ./upload.jlink> cat ./upload.jlink
device ATSAMD21G18A
si SWD
speed 4000
connect
exec SetVerifyDownload = 0
loadbin .pio/build/target_test_wm_min/firmware.bin, 0x2000
r
h
q
===================Note that I quit (q) the connection at the end to be able to do this over and over again.
After the upload, I run the unit tests:
- connect to the telnet server with a telnet client
- interact with the target via RTT.
- reset the target
- next test ....All this works very well and fast, and I am very pleased. Embedded programming starts to look like Java desktop.
BUT: As I understand it, for this to work, I need to open _another_ connection (lets call it perma-connection) to the target that I keep open indefinitely ( until I stop work on the project)
========================================
> JLinkExe -NoGui 1 -CommandFile ./connect.jlink
> cat ./connect.jlink
device ATSAMD21G18A
si SWD
speed 4000
connect
==============================================Note that there is no q at the end.
So during target programming I have to parallel connections, during unit testing with the telnet client I use only the perma-connection to maintain the telnet socket.
Sorry if this sounds contrived.
As far I understand you, there is no way around this. I need the perma connection to stay open in order to be able to connect to the server.
Kind regards
Peter -
Thank you Fabian
Yes, this answers my question, great !
Kind regards
Peter -
Hi Alex
The optimal way for me would me:
- upload the firmware
- while doing so, start the telnet server
- disconnect from the target, but keep the telnet server open
- let me connect to the telnet server to interact with the target (testing)
- let me upload firmware again, without stopping the telnet server.maybe this is something that could be achieved with your SDK ?
Kind regards
Peter -
Hi
Following up on a previous thread with the same title, I have the following scenario:I have a telnet client in order to collect RTT output for unit testing.
In order to open the JLink telnet server, as I understand it, I first need to create the server, for example by connecting to the target first:
JLinkExe -NoGui 1 -CommandFile ./connect.jlink
This connecdts to target and keeps the connection open.I then run commands likes this:
JLinkExe -NoGui 1 -CommandFile ./test_rgb.jlink
Code> cat test_rgb.jlink device ATSAMD21G18A si SWD speed 4000 connect exec SetCompareMode = 0 loadbin .pio/build/test_rgb/firmware.bin, 0x2000 r q
This works, but I wonder if this is supposed to be the way to use third-party applications to interact with RTT.
There must be a simpler way ?Kind regards
Peter -
Hi , I have the following script:
Codecat ./myupload.jlink device ATSAMD21G18A si SWD speed 4000 connect exec SetCompareMode = 0 loadbin .pio/build/mkrwifi1010/firmware.bin, 0x2000 r q
which I run like so:
JLinkExe -NoGui 1 -CommandFile ./myupload.jlink
As you can see, I disabled the compare step, and I would like now to disable also the erase step ( to speed up the operation).
How can this be done ?Kind regards
Peter -
Hi Frank
Thanks for the info, that makes sense. I guess my requirements are less severe than yours.
Anyway, good to to know how it's done by the experts.Thanks a lot
Kind regards
Peter -
Hi Frank
Thanks for the suggestions. In fact, yes, I am aware that dual target testing is not fully feasible with basic tools.
However, the platform.io ecosystem uses the https://github.com/ThrowTheSwitch/Unity testing framework that allows me to switch between a host and a target configuration.
This is simple but nice. Maybe, the SEGGER IDE is not meant to be used in this way ...Kind regards
Peter -
Hi
I would like to run unit tests for my native linux apps in the SEGGER Linux IDE.
For example with googletests or https://github.com/ThrowTheSwitch/Unity .
The latter , when used in platform.io produces colored output like this:Processing test_host in native environment
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Building...
Testing...
test/test_host/test_h_statefct.cpp:113: test_single [PASSED] <== GREEN
test/test_host/test_h_statefct.cpp:114: test_clear [PASSED]
test/test_host/test_h_statefct.cpp:115: test_add_one [PASSED]
test/test_host/test_h_statefct.cpp:116: test_systick [PASSED]
test/test_host/test_h_statefct.cpp:117: test_program [PASSED]-----------------------
5 Tests 0 Failures 0 Ignored
OKHow I can get this in the SEGGER IDE. In fact , for the moment , I have no output at all, after I build the app, nothing seems to happen. However, an executable has been produced that I can run from a linux terminal.
Kind regards
Peter