This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Command Line Interface Text Alignment problem

Hello Nordic,

I recently setup the Command Line application for our device, using USB CDC ACM. I started experimenting in the example cli project. After everything was working there I migrated to our main project file. Here everything also works, except for the text alignment. Even after 'resize'.  See the attached picture.  I suspect a wrong newline character is used. 

I use the correct Putty settings (the example project displays fine). After comparing configurations in the two projects I can't figure out what causes the problem. So here I am. How do I get the text to display properly?

Thanks, 

Gijs

Parents
  • Line endings: \r\n versus \n. \n is "new line" while \r is "carriage return" (returns cursor to 1st column).

    Note that different terminals have different ideas about "correct" end of line characters, and this is configurable in putty.

  • So after some more searching & head-scratching, I found out that NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED needed to be set to 1 in order to display correctly in the CLI. However, now my output window in SES doesn't display the logs correctly. I tried searching where above flag is used in the code so I can hardcode it in certain places, but I wasn't able to locate any occurrences. Is it possible to display text correctly in the SES output window as well as in the CLI?

    Otherwise the only option would be to only set the flag in production code & not being able to debug via ses.

Reply
  • So after some more searching & head-scratching, I found out that NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED needed to be set to 1 in order to display correctly in the CLI. However, now my output window in SES doesn't display the logs correctly. I tried searching where above flag is used in the code so I can hardcode it in certain places, but I wasn't able to locate any occurrences. Is it possible to display text correctly in the SES output window as well as in the CLI?

    Otherwise the only option would be to only set the flag in production code & not being able to debug via ses.

Children
No Data
Related