MCF5282: printf from SDRAM does not work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF5282: printf from SDRAM does not work

1,528 Views
SVC2
Contributor II

Hi,

Have a small program that runs continuously and writes a string in UART.

 

When I run the program from internal SRAM, there is no problem. I can see the messages in my HyperTerminal.

 

Nevertheless, when I run the same program from external SDRAM, only the first 2 characters are seen in the HyperTerminal.

 

If I trace the program through the uart writing functions (one character at a time), all characters are echoed in HyperTerminal.

 

Any hints?

 

Thanks,

S.

 

Labels (1)
0 Kudos
4 Replies

381 Views
admin
Specialist II
This case is the typical real-time issue.
 
UART without FIFO can simultaneously hold only two Tx and (independingly) Rx characters: in the shift register and in the buffer register. 
 
Any executable code runs significantly faster from SRAM, than from the external SDRAM. Some your function misses the Rx/Tx event because of different  speed of execution.
 
Solutions:
  - Reduce baud rate and add extra stop bit.
  - Try use printf() and scanf() functions. They have the software buffering by the default.
  - Write more fast ISR.
 
0 Kudos

381 Views
francois_boucha
Contributor III

Hi, same problem here,

Adding an extra stop bit and lowering the baud rate partially solved the problem.  

Now printf("HELLO WORLD") outputs  HHEEELLLLOOO  WWWOORRLLLDD on  the Hyper Terminal

at 2400bps, 8 bits, no par, 2 stops, no control.

FRancois.
 
0 Kudos

381 Views
admin
Specialist II
It seems, that your code doesn't erase the Rx/Tx event (interrupt request?). Thus, processing the same event is repeated until the next character replaces the old character in the UART registers.
Also verify, if local echo is disabled in HyperTerminal.
0 Kudos

381 Views
SVC2
Contributor II
printf does not work from SDRAM when cache is enabled for data as confirmed by freescale:
 
SVC
 
----- Original Message -----
From: "Freescale Support" <support@freescale.com>
Sent: Monday, January 26, 2009 10:57 AM

>
> In reply to your Service Request SR 1-539291927 (see details below):
>
> Yes, in this case printf function does not work well when cache is enabled for data.
>
 
0 Kudos