Atmel START example: printf not working

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

Hi all -

 

I've recently begun working with an Xplained Pro evaluation board, and an Atmel example project (LwIP Example). A call in main() to  printf() is hanging. Evidently, the routine:

 

static int32_t usart_sync_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length)

is hanging on this line:

	while (!_usart_sync_is_transmit_done(&descr->device))
		;

looking down into the HRI, I find this:

	return (((Sercom *)hw)->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) >> SERCOM_USART_INTFLAG_TXC_Pos;

evidently is never returning true.

 

The stock LwIP example works (printf() is fine), but my (slightly modified) version does not. The changes I've made are based on enabling DHCP and sockets.

 

Backing out my changes is a little messy, as I've had to make quite a few modifications here and there to get the program to build, so I was hoping that someone here could offer a more heuristic approach to figuring out what I've done wrong.

 

Thanks...

 

M. Zimmers

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

Put a breakpoint in there before the while and compare the working vs. not working versions, i.e., compare the SERCOM registers (and clock setup).

/Lars

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

Thanks, Lars. I'm looking at the I/O window, filtering on SERCOM and looking at SERCOM2. I don't seem to be able to invoke multiple instances of AV7, so do you have any recommendations on how to go about comparing these registers? It's a rather overwhelming amount of information on display.

M. Zimmers

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

Comparing can be a problem, I sometimes end up taking screen dumps of the I/O window.

/Lars

 

 

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

They seem to be the same, at least where this information is concerned:

USART register settings

M. Zimmers