16,012,468 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Veerendra-13142768 (Top 37 by date)
Veerendra-13142768
2-Aug-18 3:18am
View
i want inter face my USB 2.0 which comes under universal serial Bus controller. how to interface our Device with Direct show application and also i want to enumerate device AS image Device for this what i have to do can you explain?
Veerendra-13142768
7-Jul-18 1:37am
View
still facing the same problem can any one
Veerendra-13142768
9-Oct-17 2:55am
View
thanks for your suggestion ,
you can see now edited the question
actually i know the 8bpp and 16bpp gray image to dislpay by taking a file which has bixel data in the raw format(the file name is veer.raw )
i want to display in the 24bpp so can you help me to display a raw imgage by reading a file from memory and display as image .i hope you will help me
Veerendra-13142768
23-Sep-17 1:07am
View
Hi,
In my code for the first loop of page, 256 bytes are reading from ddr memory. for the second count test address(destination address) is adding with (page_size*page_count)+testaddress....
the pointer increment is also showing, but the the data is still ths same first 256 bytes....
Don't know how to solve this.....
void FlashWrite(XQspiPs *QspiPtr, u32 Address, u32 ByteCount, u8 Command)
{
u8 WriteEnableCmd = { WRITE_ENABLE_CMD };
u8 ReadStatusCmd[] = { READ_STATUS_CMD, 0 }; /* must send 2 bytes */
u8 FlashStatus[2];
/*
* Send the write enable command to the FLASH so that it can be
* written to, this needs to be sent as a seperate transfer before
* the write
*/
XQspiPs_PolledTransfer(QspiPtr, &WriteEnableCmd, NULL,
sizeof(WriteEnableCmd));
/*
* Setup the write command with the specified address and data for the
* FLASH
*/
WriteBuffer[COMMAND_OFFSET] = Command;
WriteBuffer[ADDRESS_1_OFFSET] = (u8)((Address & 0xFF0000) >> 16);
WriteBuffer[ADDRESS_2_OFFSET] = (u8)((Address & 0xFF00) >> 8);
WriteBuffer[ADDRESS_3_OFFSET] = (u8)(Address & 0xFF);
/*
* Send the write command, address, and data to the FLASH to be
* written, no receive buffer is specified since there is nothing to
* receive
*/
XQspiPs_PolledTransfer(QspiPtr, WriteBuffer, NULL,
ByteCount + OVERHEAD_SIZE);
/*
* Wait for the write command to the FLASH to be completed, it takes
* some time for the data to be written
*/
while (1) {
/*
* Poll the status register of the FLASH to determine when it
* completes, by sending a read status command and receiving the
* status byte
*/
XQspiPs_PolledTransfer(QspiPtr, ReadStatusCmd, FlashStatus,
sizeof(ReadStatusCmd));
/*
* If the status indicates the write is done, then stop waiting,
* if a value of 0xFF in the status byte is read from the
* device and this loop never exits, the device slave select is
* possibly incorrect such that the device status is not being
* read
*/
if ((FlashStatus[1] & 0x01) == 0) {
break;
}
}
}
Veerendra-13142768
22-Sep-17 7:15am
View
Thnk you so much sir, you have done really great job...... Xilinx people are not replying for this.... so we trying outside...
Now also ddr memory writebuffer is writing 256times at a time and qspi memory is reading. after the 1st page count write in loop, in the second loop....
pointer is incrementing, testaddress is incrementing, bytecount is 256 onlt, write command is writing. but the write buffer address(ddr memory address)is still the same. may be there we are getting problem I guess.... do you know how to solve this????
Veerendra-13142768
22-Sep-17 3:41am
View
Hello sir,
yeah I understood that need to removbe for loop. I tried the way you told, but here file is only not opening. in Xilinx sdk environment I cant use I/O options, its not accepting. so for hardware code I can only restore the code while debugging...
Veerendra-13142768
21-Sep-17 4:04am
View
I'm using page_count because max_data I can write is
MAX_DATA[Page_size*Page_count]
i.e. #define MAX_DATA PAGE_COUNT * PAGE_SIZE
Number of page_count times it goes in loop... it writes 256 bytes at a time, comes out of loop, for next page count again enters loop....
Veerendra-13142768
21-Sep-17 3:29am
View
I added both headers, but result is still same I>e endup with same error.
as you told I tried to get file size using SEEK... I have written code below....
To copy to memory from buffer, what statement should I give?
char *filename="qqspi.txt";
char *source = NULL;
FILE *fptr = fopen(filename, "r");
if (fptr != NULL)
{
/* Go to the end of the file. */
if (fseek(fptr, 0L, SEEK_END) == 0)
{
/* Get the size of the file. */
long bufsize = ftell(fptr);
if (bufsize == -1)
{
xil_printf("QSPI FLASH Polled Example getting file size failed\r\n");
return XST_FAILURE;
}
/* Allocate our buffer to that size. */
source = malloc(sizeof(char) * (bufsize + 1));
/* Go back to the start of the file. */
if (fseek(fptr, 0L, SEEK_SET) != 0)
{
xil_printf("QSPI FLASH Polled Example getting back to start of file failed\r\n");
return XST_FAILURE;
}
/* Read the entire file into memory. */
size_t newLen = fread(source, sizeof(char), bufsize, fptr);
if (newLen == 0)
{
fputs("Error reading file", stderr);
}
else
{
source[++newLen] = '\0'; /* Just to be safe. */
}
}
fclose(fptr);
}
for (Page = 0; Page < PAGE_COUNT; Page++)
{
memcpy(&WriteBuffer[DATA_OFFSET], pchar_filesource + nOffset, PAGE_SIZE);
FlashWrite(QspiInstancePtr, TEST_ADDRESS + nOffset, PAGE_SIZE, WRITE_CMD);
}
free(source);
Veerendra-13142768
21-Sep-17 2:31am
View
Hi,
Thanks for your help.
I tried the following code which you gave, but I'm getting the error as undefined reference to '_stat'
char *filename="qqspi.txt";
FILE *filesource=fopen(filename,"r");
/*use stat.st_size if you have the library <sys stat.h="">*/
struct stat st;
stat(filename, &st);
long filesize_stat= st.st_size;
fseek(filesource,0,SEEK_END);
long filesize_ftell = ftell(filesource);
fseek(filesource,0,SEEK_SET);
char *pchar_filesource = malloc(filesize_stat);
fread(pchar_filesource, 1, filesize_stat, filesource);
fclose(filesource);
for (Page = 0; Page < PAGE_COUNT; Page++)
{
memcpy(&WriteBuffer[DATA_OFFSET], pchar_filesource + nOffset, PAGE_SIZE);
FlashWrite(QspiInstancePtr, TEST_ADDRESS + nOffset, PAGE_SIZE, WRITE_CMD);
}
free(pchar_filesource);
Veerendra-13142768
20-Sep-17 7:51am
View
Hi,
what all structure member here, Please describe me.
Veerendra-13142768
20-Sep-17 6:33am
View
Sorry sir,
I'm fresher and stuck in this code from 10days.... Thanks a lot for ur replies, u r really doing great job....
If I declare pSrcData here then I cant restore while debugging the program. and here I'm not able to declare file that I want to write...
Plz can u tell me how to declare that part...
Veerendra-13142768
20-Sep-17 6:12am
View
Hello,
Sorry for asking same again and again. yeah I understood that we cant write more than 1 page(256bytes) at a time, that's why we are using for loop in the code.
//for (Page = 0; Page < PAGE_COUNT; Page++)
{
FlashWrite(QspiInstancePtr, (Page * PAGE_SIZE) + TEST_ADDRESS,PAGE_SIZE, WRITE_CMD);
}
//
and u have given file pSrcData, that we are restoring completely while debugging.
And if you want hardware to test the code ,then you can come online(teamviewer) and can check on hardware....
Thank you...
Veerendra-13142768
20-Sep-17 4:38am
View
Hi,
Thanks for ur reply. I'm restoring file before executing flashwrite(), using write buffer address, I tried to change byte count to MAX_DATA also. But its not working....
Veerendra-13142768
9-Sep-17 2:28am
View
Hi,
The write capability of a QSPI is limited to a page size at a time (almost always 256 bytes).
As the SpiWriteFlash() send the write request and exit after the end of the bus transfer, it is normal only 256 byte can be written at a time.But i want to write a file size of 4Mbytes. I tried to increase the writebuffer length only....
#define PAGE_SIZE 256
#define PAGE_COUNT 16211
#define MAX_DATA PAGE_COUNT * PAGE_SIZE
u8 WriteBuffer[MAX_DATA + DATA_OFFSET];
u8 ReadBuffer[MAX_DATA + DATA_OFFSET + DUMMY_SIZE];
Veerendra-13142768
8-Sep-17 5:58am
View
I'm getting 4Mbytes of value. But its repetition of first 256 bytes, not getting what I exactly restored....
Veerendra-13142768
30-Aug-17 4:52am
View
Thanks for ur reply. I have seen ur recent reply. Here i have created own buffer with 8 bytes, i want to copy those bytes to buffer p to u(buffer_P). But that buffer is declared in structures of different file location. I cant edit structure of defined buffer there, don't know how to copy the buffer contents.
Here im attaching the file link for your reference....
Thank you...
Veerendra-13142768
30-Aug-17 2:41am
View
here im trying to call back from processor to usb.
Veerendra-13142768
15-Jun-17 5:48am
View
but the data will copy if i press stop button only. how to do without pressing stop button which function i need to use to reset buffer
.if you can mean it will helpful to me
Veerendra-13142768
14-Jun-17 4:59am
View
yup it is exceeding the limit when operation is started. so to prevent that
i want to move data from buffer if i did like that mean buffer will be free each time so it can run for long time .any suggestion to do like this if i am correct.else can u guide me little bit.
Veerendra-13142768
14-Jun-17 4:34am
View
actually exception is Occurring because of buffer can hold only byte[100*1024*1024] so i want to clear that buffer after copying to temp1 so it will receive data from fx3 continuously.
Veerendra-13142768
31-May-17 2:14am
View
yup i want to extract file1.txt to small chunks (file1.txt is around 2gb)so i want apend data from file1.txt to file2 file3 file4.... around 1mb in each
Veerendra-13142768
23-May-17 9:35am
View
ya after one timer tick it should copy the same files so same file name will be their.
Veerendra-13142768
23-May-17 9:33am
View
but it is a continuous process so every time how can we give a new path
Veerendra-13142768
15-May-17 8:19am
View
yup
Veerendra-13142768
15-May-17 8:16am
View
while copying
exception :the file name already exist like that its giving
so tats y i am trying to rename if the file is already exists
Veerendra-13142768
15-May-17 8:09am
View
i got strucked in first case only
Veerendra-13142768
15-May-17 8:08am
View
c my full case is like this
void timer_Tick(object sender, EventArgs e)
{ //executableLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
// Console.WriteLine("Total time to load {0} images: {1}ms");
switch (img_num)
{
case 1:
File.Copy(@"C:veer1.raw", @"D:veer1.raw", true);
DisplayImage16(@"C:veer1.raw");
img_num = img_num + 1;
break;
case 2:
DisplayImage16(@"C:veer2.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = img_num + 1;
break;
case 3:
DisplayImage16(@"C:veer1.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = img_num + 1;
break;
case 4:
DisplayImage16(@"C:veer2.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = img_num + 1;
break;
case 5:
DisplayImage16(@"C:veer1.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = img_num + 1;
break;
case 6:
DisplayImage16(@"C:veer2.raw");
img_num = img_num + 1;
break;
case 7:
DisplayImage16(@"C:veer1.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = img_num + 1;
break;
case 8:
DisplayImage16(@"C:veer2.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = img_num + 1;
break;
case 9:
DisplayImage16(@"C:veer1.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = img_num + 1;
break;
case 10:
DisplayImage16(@"C:veer2.raw");
// img_path = Path.Combine(executableLocation + "\\Images\\Image0004.jpg");
img_num = 1;
break;
Veerendra-13142768
15-May-17 8:06am
View
i tried already, but i am struck getting exeption
Veerendra-13142768
15-May-17 8:02am
View
actually each time some different data will appended to veer1.raw so i want write each file to different directory for backup so i want programetically rename each time so can any one
Veerendra-13142768
15-May-17 3:17am
View
and that file i want to write multiple times in the another folder in the increasing order of the names
Veerendra-13142768
15-May-17 3:15am
View
that will be in the memory named as veer1.raw/veer1.txt ,
for that purpuse only i am using read operation .
Veerendra-13142768
15-May-17 2:57am
View
yup i want copy the same content
Veerendra-13142768
15-May-17 2:49am
View
i am a fresher so how to sort i am not getting can you help me...
Veerendra-13142768
3-May-17 8:27am
View
its giving error like this
Error 1 Use of unassigned local variable 'line'
Veerendra-13142768
3-May-17 8:09am
View
i am fresher so getting confused, can you modify that code and send me back. if you help me to sort out of this problem mean its very helpful to me ,i hope you will help me....
Veerendra-13142768
3-May-17 7:58am
View
i want extract first 16 lines from text file and write it to another file can you help me
Veerendra-13142768
3-May-17 7:24am
View
actually that file is very large so i want extract part by part. so my first part size is 16 lines, each line consist of 2098 bytes of data. so can u tell how to extract 16 lines with 2098 bytes at one time
Show More