Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EBlink as a terminal?
#1
Hi, embitz,

I have two questions about EBlink.
1. Is it possible to redirect the printf out to a file?
2. Is it possible to use the EBlink as a standalone application (terminal)?

Great thanks,

vdaniel
Reply
#2
Hi,

1) Yes, you could use the ">" output redirection at your EBlink invocation. This is more a OS feature to be honest.
    If you need to read a particular memory location and write this to file, use the verbose level 0, this will omit all the info text and will give you only the memory value(s).
                 
Code:
EBlink -v0 -Istlink -Sauto -Fread=4@0x8000004 > outfile.txt

Remember, the output is an hex array (memory dump) of bytes because you can read any length of memory. So if you need to read an unsigned 32 you have to rebuild it by endianness your self. 


P.s. If you used the EBlink installer then you can invoke EBlink in any directory.  Just open a terminal in the directory where your file should be written and use the above command.


2) Depends what you mean with terminal application. You can from CLI:
    - start/stop/reset the core
    - read memory locations even from running target without stopping it
    - write flash locations even from running target without stopping it
Reply
#3
(18-01-2021, 08:14 AM)embitz Wrote: Hi,

1) Yes, you could use the ">" output redirection at your EBlink invocation. This is more a OS feature to be honest.
    If you need to read a particular memory location and write this to file, use the verbose level 0, this will omit all the info text and will give you only the memory value(s).
                 
Code:
EBlink -v0 -Istlink -Sauto -Fread=4@0x8000004 > outfile.txt

Remember, the output is an hex array (memory dump) of bytes because you can read any length of memory. So if you need to read an unsigned 32 you have to rebuild it by endianness your self. 


P.s. If you used the EBlink installer then you can invoke EBlink in any directory.  Just open a terminal in the directory where your file should be written and use the above command.


2) Depends what you mean with terminal application. You can from CLI:
    - start/stop/reset the core
    - read memory locations even from running target without stopping it
    - write flash locations even from running target without stopping it

Hi,

Thank you very much.

But I am not so advanced user.  I will try to describe my problem in detail.

I have written in EMbitz a program for STM32G031.  It works fine from the
EMbitz IDE.  I can access the EBlink in its window both for the  Debug and
Release targets.
And now my questions.
1. How from inside if the EMbitz IDE redirect EBlink to a file?

2. Is it possible to run the EBlink as a standalone terminal, not from
the EMbitz IDE?  When I try your suggested command:
Code:
EBlink -v0 -Istlink -Sauto -Fread=4@0x8000004 > outfile.txt

it returns an error message: Can't find MSC base address

Please, can you write a more detailed answer as instructions step by step?
I am sure, that it will be very useful for other users as well.

Great thanks,

vdaniel
Reply
#4
1) I still don't get what you want. What kind of info should EBlink write to a file from inside EmBitz? 

2) Are you using the latest versions (also the latest scripts)? Somehow you are using the silabs-auto.script.

Otherwise try

EBlink -v0 -Istlink -Sstm32-auto -Fread=4@0x08000004 >  resetvector.txt

P.s. I wrongly suggested that you could write flash even on running target, that's wrong. Version 3.9 will make it possible to write ram location at running targets. 3.8 can  read from ram&flash (also running) but only can write to flash (it will reset before flashing)
Reply
#5
Hi, embitz,

Thank you very much for your quick reply.
1. My code is
for (i = 0; i < MaxCount; i++)
   printf("0x%X, ", Parameters[i]);
printf("0x%X\n", Parameters[i]);
fflush(stdout);


It prints in EBlink window a line with comma-separated parameters.
I need to redirect this line to a text file.

2. I was using the version of 26 December 2020 EBlinkInstaller3.8(57).exe
I just now again installed it by running the EBlinkInstaller3.8(59).exe,
but again received a message:
Incompatible EBlink version 3.7 Please update

vdaniel
Reply
#6
Ah, ok.
You are talking about EBmonitor and not EBlink.

If you want to write it to a file on the remote host (your pc) then semihosting is the way to go. Or, select all the text in EBmon info pane and copy it.

2) I don't have a clue what is going wrong there. It looks like other scripts are used than the installed on. Perhaps wrong environment variables??

Update:
Do you have a "script" subfolder where the eblink.exe is?  If so, you should remove it if you use it with EBlinkInstaller or via github.
Reply
#7
Hi,

Thank you very much.

Removing scripts directory helped.

But generally, is it possible to make a fully functional
standalone terminal (with input and output),
using the EBmonitor with the STlink, connected to SWDIO
and SWCLK of the STM32 microcontroller, programmed to
support EBmonitor? 
It would be a great tool.

vdaniel
Reply
#8
EBmonitor depends on gnu GDB and EBlink so it also needs the applications ELF file with debug info.
So a standalone terminal would not be practical.

It's much easier to use a MCU Uart i.c.w. Hyperterminal.
Reply
#9
(18-01-2021, 01:37 PM)vdaniel Wrote: It is certainly possible to make a fully functional terminal (command line interface) using just the STLink and EBMonitor, I do it all the time.
I documented how to do it on my blog: https://www.dalbert.net/?p=921

The only issue is that if you want to support *both* UART (for non-developer use) *and* EBMonitor (for developer use), you need to unhook _write() for your debug builds since EBMonitor must hook it to do its thing.  I add a define for USE_EBMONITOR to my Debug build options (Compiler Settings->#defines) and then wrap the _write() implementation for uart I/O in an #ifndef USE_EBMONITOR

I'll add some detail on this to my blog page soon, but maybe Gerard has a better idea for how to do this?
Reply
#10
(13-02-2021, 12:23 PM)dalbert Wrote:
(18-01-2021, 01:37 PM)vdaniel Wrote: It is certainly possible to make a fully functional terminal (command line interface) using just the STLink and EBMonitor, I do it all the time.
I documented how to do it on my blog: https://www.dalbert.net/?p=921

The only issue is that if you want to support *both* UART (for non-developer use) *and* EBMonitor (for developer use), you need to unhook _write() for your debug builds since EBMonitor must hook it to do its thing.  I add a define for USE_EBMONITOR to my Debug build options (Compiler Settings->#defines) and then wrap the _write() implementation for uart I/O in an #ifndef USE_EBMONITOR

I'll add some detail on this to my blog page soon, but maybe Gerard has a better idea for how to do this?

Hi, dalbert,

Thank you very much.
I know your post of 7 December 2020.  With your recommrndations I
successfully made a project and even a geheric embitz project, which I placed
in this forum.
But I need a possibility to redirect the EB monitor printf results to a file.
And maybe, it is possible to have a standalone monitor (not from embitz IDE).

vdaniel

A
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)