EmbeddedRelated.com
Forums

how to read the data from code flash/RAM location and print it on hyperterminal using serial communication

Started by vidyadhar dodamani July 31, 2007
hello sir/madam,
i am working for an stand-alone voice mail system application using
rabbit3000.it consists of a 512kb code flash, a 512kb RAM a rabbit3000
processor and a DSP processor for speech recording...
whenever the system is reset the memory map which is flash is copied from
flash to RAM and whenever the system is programmed by admin or a user
leaves a message the memory map pertaining to it is copied from RAM to
flash. i mean the latest updated map is every time written to the flash and
on powerup it is copied from flash to RAM.

*now my problem is whenever the system is updated the map is copied to
flash. to know whether it is copied to flash or not i need to print that map
data from flash to hyperterminal using serial communication.*
*also on power the map is copied from flash to RAM and also i need to print
this data also from RAM and make a comparision of the two*.

the RAM map location starts from location 0x82800 and flash map location
starts from 0x70000 to 0x7FFFF...

here below is the code snippet of copy to flash function where 6000bytes(in
hex ) is copied from RAM to flash.
void copy_to_flash()// takes flash backup of RAM contents every time it is
updated

{
auto uchar i;
auto ulong from,to;

from=0x82800;//RAM location
to=0x70000;//flash location
for(i=0;i<0x30;i++)
{
xmem2root(review_array,from,0x200);
WriteFlash(to,review_array,0x200);
from+=0x200;
to+=0x200;
}
}

.please help me how to read the data from code flash/RAM location and print
it on hyperterminal using serial communication

With Regards

Vidyadhar
HI vidyadhar
You can send data on serial port by using serXwrite. So you can store your
flash memory data into an array and directly send on serial port.

Reg
Nidhi
On 7/31/07, vidyadhar dodamani wrote:
>
> hello sir/madam,
> i am working for an stand-alone voice mail system application using
> rabbit3000.it consists of a 512kb code flash, a 512kb RAM a rabbit3000
> processor and a DSP processor for speech recording...
> whenever the system is reset the memory map which is flash is copied from
> flash to RAM and whenever the system is programmed by admin or a user
> leaves a message the memory map pertaining to it is copied from RAM to
> flash. i mean the latest updated map is every time written to the flash and
> on powerup it is copied from flash to RAM.
>
> *now my problem is whenever the system is updated the map is copied to
> flash. to know whether it is copied to flash or not i need to print that map
> data from flash to hyperterminal using serial communication. *
> *also on power the map is copied from flash to RAM and also i need to
> print this data also from RAM and make a comparision of the two*.
>
> the RAM map location starts from location 0x82800 and flash map location
> starts from 0x70000 to 0x7FFFF...
>
> here below is the code snippet of copy to flash function where
> 6000bytes(in hex ) is copied from RAM to flash.
> void copy_to_flash()// takes flash backup of RAM contents every time it is
> updated
>
> {
> auto uchar i;
> auto ulong from,to;
>
> from=0x82800;//RAM location
> to=0x70000;//flash location
> for(i=0;i<0x30;i++)
> {
> xmem2root(review_array,from,0x200);
> WriteFlash(to,review_array,0x200);
> from+=0x200;
> to+=0x200;
> }
> }
>
> .please help me how to read the data from code flash/RAM location and
> print it on hyperterminal using serial communication
>
> With Regards
>
> Vidyadhar
>
hello madam,
thanks for your kind reply...
as per your saying it worked but only 5 to 6 characters got printed on
hyperterminal..
i will tell you what all i have done, hope by this you can help me to
perform the desired thing..

/* below is the code snippet from where i am using to send data serially and
get it printed on hyperterminal*/
/* i have opened the hyperterminal at 19200 baudrate with 8databits,
1stopbit and no parity bits*/
void copy_to_flash()// takes flash backup of RAM contents
{
auto uchar i;
auto ulong from,to;
uint times;

from=0x82800;//starting RAM location
to=0x70000;//starting flash location i.e code flash
serDopen(19200);//by vrd
for(i=0;i<0x30;i++)
{
xmem2root(review_array,from,0x200);// review_array[0x200] it is of type
uchar and it is declared globally

for (times=0;times<0x200;times++)// loop used to print 0x200 bytes on
hyperterminal one by one
serDwrite(review_array[times],1);// this is used to send 1 byte each time
serially and get printed on hyperterminal

WriteFlash(to,review_array,0x200);
from+=0x200;
to+=0x200;
}
serDclose();//by vrd
}

please tell me is it correct the code what i have written?,

if not tell me what change i need to do...

await for your reply..

Regards

Vidyadhar

On 8/1/07, Nidhi Purnapatre wrote:
>
> HI vidyadhar
> You can send data on serial port by using serXwrite. So you can store your
> flash memory data into an array and directly send on serial port.
>
> Reg
> Nidhi
> On 7/31/07, vidyadhar dodamani wrote:
> >
> > hello sir/madam,
> > i am working for an stand-alone voice mail system application using
> > rabbit3000.it consists of a 512kb code flash, a 512kb RAM a rabbit3000
> > processor and a DSP processor for speech recording...
> > whenever the system is reset the memory map which is flash is copied
> > from flash to RAM and whenever the system is programmed by admin or a user
> > leaves a message the memory map pertaining to it is copied from RAM to
> > flash. i mean the latest updated map is every time written to the flash and
> > on powerup it is copied from flash to RAM.
> >
> > *now my problem is whenever the system is updated the map is copied to
> > flash. to know whether it is copied to flash or not i need to print that map
> > data from flash to hyperterminal using serial communication. *
> > *also on power the map is copied from flash to RAM and also i need to
> > print this data also from RAM and make a comparision of the two*.
> >
> > the RAM map location starts from location 0x82800 and flash map
> > location starts from 0x70000 to 0x7FFFF...
> >
> > here below is the code snippet of copy to flash function where
> > 6000bytes(in hex ) is copied from RAM to flash.
> >
> >
> > void copy_to_flash()// takes flash backup of RAM contents every time it
> > is updated
> >
> > {
> > auto uchar i;
> > auto ulong from,to;
> >
> > from=0x82800;//RAM location
> > to=0x70000;//flash location
> > for(i=0;i<0x30;i++)
> > {
> > xmem2root(review_array,from,0x200);
> > WriteFlash(to,review_array,0x200);
> > from+=0x200;
> > to+=0x200;
> > }
> > }
> >
> > .please help me how to read the data from code flash/RAM location and
> > print it on hyperterminal using serial communication
> >
> > With Regards
> >
> > Vidyadhar
> >
> >
> >
> >
The problem with what you have done to print the data to
Hyperterminal is that you are sending the actual binary data, which
hyperterminal will try to interpret as individual ASCII characters.
Depending on the data, much of it may be unprintable ASCII characters.
If you want to read it on hyperterminal, you need to convert each
byte to two ASCII chars to represent the byte data. You can use
something like

---- at the top declare:
char prt[4]; // 2 chars, space, terminator
---- change serDwrite to:
sprintf( prt, "%02X ", review_array[times]);
serDwrite(prt,3);//

Or you could use a different program than Hyperterminal to monitor
the data. WinHexCom is a free utility that displays binary data in
Hex on the display window. I don't remember where I got it but you
can find it with Google.

Mark

--- In r..., "vidyadhar dodamani"
wrote:
>
> hello madam,
> thanks for your kind reply...
> as per your saying it worked but only 5 to 6 characters got printed
on
> hyperterminal..
> i will tell you what all i have done, hope by this you can help me
to
> perform the desired thing..
>
> /* below is the code snippet from where i am using to send data
serially and
> get it printed on hyperterminal*/
> /* i have opened the hyperterminal at 19200 baudrate with 8databits,
> 1stopbit and no parity bits*/
> void copy_to_flash()// takes flash backup of RAM contents
> {
> auto uchar i;
> auto ulong from,to;
> uint times;
>
> from=0x82800;//starting RAM location
> to=0x70000;//starting flash location i.e code flash
> serDopen(19200);//by vrd
> for(i=0;i<0x30;i++)
> {
> xmem2root(review_array,from,0x200);// review_array[0x200] it is
of type
> uchar and it is declared globally
>
> for (times=0;times<0x200;times++)// loop used to print 0x200 bytes
on
> hyperterminal one by one
> serDwrite(review_array[times],1);// this is used to send 1 byte
each time
> serially and get printed on hyperterminal
>
> WriteFlash(to,review_array,0x200);
> from+=0x200;
> to+=0x200;
> }
> serDclose();//by vrd
> }
>
> please tell me is it correct the code what i have written?,
>
> if not tell me what change i need to do...
>
> await for your reply..
>
> Regards
>
> Vidyadhar
>
> On 8/1/07, Nidhi Purnapatre wrote:
> >
> > HI vidyadhar
> > You can send data on serial port by using serXwrite. So you can
store your
> > flash memory data into an array and directly send on serial port.
> >
> > Reg
> > Nidhi
> >
> >
> > On 7/31/07, vidyadhar dodamani wrote:
> > >
> > > hello sir/madam,
> > > i am working for an stand-alone voice mail system application
using
> > > rabbit3000.it consists of a 512kb code flash, a 512kb RAM a
rabbit3000
> > > processor and a DSP processor for speech recording...
> > > whenever the system is reset the memory map which is flash is
copied
> > > from flash to RAM and whenever the system is programmed by
admin or a user
> > > leaves a message the memory map pertaining to it is copied from
RAM to
> > > flash. i mean the latest updated map is every time written to
the flash and
> > > on powerup it is copied from flash to RAM.
> > >
> > > *now my problem is whenever the system is updated the map is
copied to
> > > flash. to know whether it is copied to flash or not i need to
print that map
> > > data from flash to hyperterminal using serial communication. *
> > > *also on power the map is copied from flash to RAM and also i
need to
> > > print this data also from RAM and make a comparision of the
two*.
> > >
> > > the RAM map location starts from location 0x82800 and flash map
> > > location starts from 0x70000 to 0x7FFFF...
> > >
> > > here below is the code snippet of copy to flash function where
> > > 6000bytes(in hex ) is copied from RAM to flash.
> > >
> > >
> > > void copy_to_flash()// takes flash backup of RAM contents every
time it
> > > is updated
> > >
> > > {
> > > auto uchar i;
> > > auto ulong from,to;
> > >
> > > from=0x82800;//RAM location
> > > to=0x70000;//flash location
> > > for(i=0;i<0x30;i++)
> > > {
> > > xmem2root(review_array,from,0x200);
> > > WriteFlash(to,review_array,0x200);
> > > from+=0x200;
> > > to+=0x200;
> > > }
> > > }
> > >
> > > .please help me how to read the data from code flash/RAM
location and
> > > print it on hyperterminal using serial communication
> > >
> > > With Regards
> > >
> > > Vidyadhar
> > >
> > >
> > >
> > >
> >
>
Check that review_array really contains valid char data by watch window. If
you are getting 5/6 char on hyper then there should not be any reason for
not getting other char.
If you are sending one char at a time it is better to use serDputc
instruction.

On 8/2/07, vidyadhar dodamani wrote:
>
> hello madam,
> thanks for your kind reply...
> as per your saying it worked but only 5 to 6 characters got printed on
> hyperterminal..
> i will tell you what all i have done, hope by this you can help me to
> perform the desired thing..
>
> /* below is the code snippet from where i am using to send data serially
> and get it printed on hyperterminal*/
> /* i have opened the hyperterminal at 19200 baudrate with 8databits,
> 1stopbit and no parity bits*/
> void copy_to_flash()// takes flash backup of RAM contents
> {
> auto uchar i;
> auto ulong from,to;
> uint times;
>
> from=0x82800;//starting RAM location
> to=0x70000;//starting flash location i.e code flash
> serDopen(19200);//by vrd
> for(i=0;i<0x30;i++)
> {
> xmem2root(review_array,from,0x200);// review_array[0x200] it is of type
> uchar and it is declared globally
>
> for (times=0;times<0x200;times++)// loop used to print 0x200 bytes on
> hyperterminal one by one
> serDwrite(review_array[times],1);// this is used to send 1 byte each time
> serially and get printed on hyperterminal
>
> WriteFlash(to,review_array,0x200);
> from+=0x200;
> to+=0x200;
> }
> serDclose();//by vrd
> }
>
> please tell me is it correct the code what i have written?,
>
> if not tell me what change i need to do...
>
> await for your reply..
>
> Regards
>
> Vidyadhar
>
> On 8/1/07, Nidhi Purnapatre wrote:
> >
> > HI vidyadhar
> > You can send data on serial port by using serXwrite. So you can store
> > your flash memory data into an array and directly send on serial port.
> >
> > Reg
> > Nidhi
> >
> >
> > On 7/31/07, vidyadhar dodamani wrote:
> > >
> > > hello sir/madam,
> > > i am working for an stand-alone voice mail system application using
> > > rabbit3000.it consists of a 512kb code flash, a 512kb RAM a rabbit3000
> > > processor and a DSP processor for speech recording...
> > > whenever the system is reset the memory map which is flash is copied
> > > from flash to RAM and whenever the system is programmed by admin or a user
> > > leaves a message the memory map pertaining to it is copied from RAM to
> > > flash. i mean the latest updated map is every time written to the flash and
> > > on powerup it is copied from flash to RAM.
> > >
> > > *now my problem is whenever the system is updated the map is copied to
> > > flash. to know whether it is copied to flash or not i need to print that map
> > > data from flash to hyperterminal using serial communication. *
> > > *also on power the map is copied from flash to RAM and also i need to
> > > print this data also from RAM and make a comparision of the two*.
> > >
> > > the RAM map location starts from location 0x82800 and flash map
> > > location starts from 0x70000 to 0x7FFFF...
> > >
> > > here below is the code snippet of copy to flash function where
> > > 6000bytes(in hex ) is copied from RAM to flash.
> > >
> > >
> > > void copy_to_flash()// takes flash backup of RAM contents every time
> > > it is updated
> > >
> > > {
> > > auto uchar i;
> > > auto ulong from,to;
> > >
> > > from=0x82800;//RAM location
> > > to=0x70000;//flash location
> > > for(i=0;i<0x30;i++)
> > > {
> > > xmem2root(review_array,from,0x200);
> > > WriteFlash(to,review_array,0x200);
> > > from+=0x200;
> > > to+=0x200;
> > > }
> > > }
> > >
> > > .please help me how to read the data from code flash/RAM location and
> > > print it on hyperterminal using serial communication
> > >
> > > With Regards
> > >
> > > Vidyadhar
> > >
> > >
> > >
> > >
> >