Re: Serial driver




>> if ((c = (*str >> 8) & 0xFF) != '\0') {
>> port->UTXD =((*str>>8) & 0xFF);
>> }

Oh I see, your OEMWriteDebugString() it is adopted to
print both multibyte and wide strings. However you may
catch endless loop with the odd length strings ...

Anyway it is not the case with the EdbgOutputDebugString(),
which is expecting multibyte strings only.


OEMWriteDebugString(L"Some Text\r\n")

but

EdbgOutputDebugString("Some Text\r\n")


Why don't you just step in with your ice debugger into
the EdbgOutputDebugString() function and see where exactly
it hangs?


Chitra wrote:
Thank you for your reply.

I changed as u said, but I still have the same problem.
The problem is Whenever I reset my board it just prints only first
debug message which is in OEMWriteDebugString(); where as
EdbgOutputDebugString() doesn't print any debug messages. But when I do
step by step debugging using Multi Ice It prints the debug message from
OEMWriteDebugString(); only but not from EdbgOutputDebugString(). My
code hangs when I call EdbgOutputDebugString(). Has anybody faced this
problem. Please reply.

Thanks & Regards,
Chitra
voidcoder wrote:
You are trying to print multibyte string while OEMWriteDebugString()
is expecting wide (unicode) strings. Simply use L"Your text here"
or TEXT("Your text here") for string constants:

OEMWriteDebugString(L"Bootloader main INIT\r\n");



Chitra wrote:
Hi Steve,
Thanks for your reply. I got BSP for I.MX21 from Freescale
website and I am using this code as reference for UART. I am setting my
baud rate to 38400, 8 bits as my word size & UART1 for debugging. Here
is my code for printing the string.
void OEMWriteDebugString(unsigned short* str)
{

while((c = *str & 0XFF) != '\0')
{

while (!(port->USR2 & UART_USR2_TXFE_MASK));
port->UTXD = (*str & 0XFF);
if ((c = (*str >> 8) & 0xFF) != '\0') {
port->UTXD =((*str>>8) & 0xFF);
}
str++;
}
My first debug string is as follows:
OEMWriteDebugString((unsigned short *)"Bootloader main INIT\r\n");
OEMWriteDebugString((unsigned short *)"Bootloader main INIT_2\r\n");


After writing bootloader to flash and once I restart the board on
hyperterminal it
just displays the first string
Bootloader main INIT
During
& the rest of the messages are not being displayed. But when I do step
by step debugging using MultiIce it displays the 2nd string also only
if I give some time between the above two statements. I am not able
locate the problem.
Only OEMWriteDebugString() works where as EdbgOutputDebugString()
doesnot display any message. Please reply


Steve Maillet (eMVP) wrote:
I am developing BSP for MC9328MXL Litekit.
I have a problem in my serial driver. The debug messages are not being
displayed properly. I have followed i.mx21 code but still It is not
working properly. Whenever I reset, I just get only first debug
message, the rest are not displayed, but when I do single stepping
using MultiIce, It works but not perfectly. As anybody faced such a
problem.
Hard to say based on what you've posted so far. There are a lot of little
subtleties about the i.MXL serial UARTs and some differences from the
i.MX21. If you posted more details it might help, you also might want to
consider using EmbeddedFusion to help with your design. We have a small CPU
module that includes the i.MXL, FLASH, RAM and an OS image ready to run.
Contact me directly for more information.

--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com

.



Relevant Pages

  • Re: Serial driver
    ... step by step debugging using Multi Ice It prints the debug message from ... only but not from EdbgOutputDebugString(). ... is my code for printing the string. ... doesnot display any message. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: quick print type debugging
    ... back to text (and put it in the debug message). ... I know I could make the block be a string of the code instead to solve the problem, but that would be uglier and less efficient when we have debugging off. ... I think I'd go with the string solution, use Binding.of_caller to put it into the right context and alias it to a method that does nothing when $DEBUG isn't set. ...
    (comp.lang.ruby)
  • Re: Serial driver
    ... You are trying to print multibyte string while OEMWriteDebugString() ... doesnot display any message. ... I just get only first debug ...
    (microsoft.public.windowsce.platbuilder)