Stair-Stepping

Does your terminal output look like this ?

ok.
     ok.
          ok.
               ok.
                  reset Mecrisp-Stellaris RA 2.4.6 with M0 core for STM32F051 by Matthias Koch
                                                                                                ok.
                                                                                                     ok.
                                                                                                          ok.
                                                                                                               ok.
                                                                                                                    ok.
                                                                                                                         ok.
                                                                                                                              ok.

If it does, then you’re sufferring from ‘stair stepping”.

This happens when a Serial Terminal refuses to return the “Carriage” (Cursor) after a “New Line” NL (also known as a Line Feed LF) is received, as is the Unix standard. In the ‘picture’ above (taken from my system) all that’s happening after I hit the Carriage Return key, is a New Line.

DOS requires a “Carrage Return” CR and a “New Line” NL before it will return the carriage, and many serial terminals even Unix ones seem to require the DOS method.

Mecrisp-Stellaris is following the Unix Standard, it’s not at fault.

The Solution ?

There are numerous solutions to this issue.

Use a Terminal that is configurable for it

Picocom is given as a example, but other serial terminals have options regardingf CR/LF also. Some like E4thcom (linux only) deal with this by design.

Picocom

Picocom has a command line syntax that solves the problem

picocom -b 115200 /dev/cuaU0 --imap lfcrlf,crcrlf --omap delbs,crlf --send-cmd "ascii-xfr -s -l200"

Modify your Mecrisp-Stellaris Kernel

Change a few commands in the Mecrisp-Stellaris source file “datastackandmacros.s”

Change occurances of:

"\Meldung\n"

to

"\Meldung\r\n"

And rebuild the distribution by running “release” in the root directory.

Add some code to your program

This “hook” tells Mecrisp Stellaris to add a CR to the LF’s.

: emit-crlf ( c -- ) dup 10 = if 13 serial-emit then serial-emit ;
' emit-crlf hook-emit !



Mecrisp-Stellaris RA 2.4.6 with M0 core for STM32F051 by Matthias Koch
                                                                       ok.
                                                                            ok.
                                                                                 ok.
                                                                                    : emit-crlf ( c -- ) dup 10 = if 13 serial-emit then serial-emit ;  ok.
                                                                                                                                                             ok.
   ok.
      ' emit-crlf hook-emit !  ok.
 ok.
 ok.
 ok.

Table Of Contents

Previous topic

Special Chip?

Next topic

STM32 Book List

This Page