SAMD51 stdio redirect : Framing error

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Created a new project from Atmel start by just having a Target_IO USART and STDIO REDIRECT.

main() initializes uart and redirect as below.

void stdio_redirect_init(void)
{

    usart_sync_enable(&TARGET_IO);
    stdio_io_init(&TARGET_IO.io);
}

 

But if i print something using printf() from main function , my serial port terminal app disconnects showing "Framing Error : 104"

Could some one help with this query ?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe a clock problem. You could attach the start project.

/Lars

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks. I tried to recreate the project from studio with just an stdio_redirection module.

This time does not seem to print anything nor there is an error. 

Both SERCOM usart config and Serial terminal on PC have identical configuration - 115200 baud/8 bit char/ 1 stop bit.

Attached my start project. Pls have a look.

Attachment(s): 

Last Edited: Sun. Oct 20, 2019 - 10:05 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You surely do not want usart_SYNC_enable() (which START foolishly defaults to...)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You mean remove usart_SYNC_enable()  or do it later. It seems to enable the SERCOM.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Recreating the project in Another version of Atmel studio seems to have fixed the problem. Ready to move on though i don't understand how or why it was fixed.

Thanks for your help.