FX3SRAID0

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello,

I programmed FX3S FPGA DEV BOARD REV-C by FX3SRAID0 code and some issues happened.

The issues: 1)sometimes when I write a few files to memory, the data of final file are zeros(NULL in ASCII)!

                        2) sometimes  when I write a few files to memory, one of files is written incorrectly(first 4KB are correctly and                                       second 4KB are incorrectly and so on)!

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hi,

I tested the firmware shared by you on FX3S DVK Rev D and I am not able to reproduce th issue when copying the files (exFAT) format. I checked the hxD dump and couldn't see any problems

Please find the attached Wireshark traces, snippets from hxD.

Following was the procedure I follwed

- Connected FX3S DVK to PC (with 2 SD cards 512 MB each inserted - as hot plug is not supported by the firmware )

- Programmed the device with the image file provided by you.

- Formatted the drive with following settings

format_settings.png

- Copied TEST.txt files 3-4 times

I opened every file copied and it works fine.

 

Regards,
Rashi

View solution in original post

0 Likes
23 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please confirm if you are using the default RAID0 example from the SDK. If yes, please confirm that the issue is not because of the following reason  Data sent from Host over USB is not Committed to G... - Infineon Developer Community  Solved: FX3 emmc unreachable after format in manual Part 2 - Infineon Developer Community  i.e. please confirm that the amount of bytes written doesn't fall in this criteria  

For instance, if OUT transfer needs to be made with X bytes, then: If X > 4 KB, then let Y = (X % 4 KB). Now:

If Y < 4 KB (DMA buffer size in raid 0 example) and (X % 1024) == 0

If this is the case then then on completion of X bytes, a zero-length packet must be sent so that the buffer in the device gets committed to storage port

 

Regards,
Rashi
0 Likes
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello,

 

Please confirm if you are using the default RAID0 example from the SDK.  (yes)

please confirm that the issue is not because of the following reason  Data sent from Host over USB is not Committed to G... - Infineon Developer Community  . (The issues happen with all cases) 

Solved: FX3 emmc unreachable after format in manual Part 2 - Infineon Developer Community  .(No)

 

The issues happen with exFAT format, while NTFS format is working good.

0 Likes

Hello,

Please share UART debug prints for the working and non working case. Please confirm that CyU3PSibReadWriteRequest API doesn't fail when the issue is seen

Regards,
Rashi
0 Likes
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello,

The UART isn't activated in the default RAID0. You want from me to activate the UART and print status of CyU3PSibReadWriteRequest API. Right?

 

Regards,

Sulaiman

0 Likes

Hello,

The UART isn't activated in the default RAID0. You want from me to activate the UART and print status of CyU3PSibReadWriteRequest API. Right?

>> Yes, please share the UART debug prints when the issue is seen

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello,

The attached files include the working and non working case. I printed status of CyU3PSibReadWriteRequest  and CyU3PDmaMultiChannelSetXfer and they are same in two cases.

 

Regards,

Sulaiman

0 Likes

Hello,

Thank you for the logs.

Please let me know if the issue is seen on multiple storage cards or if this is an issue seen with one card. Also, please confirm if you are using File System APIs (as done in FATfs example of FX3 SDK)  or reading/writing in RAW format to the cards

Regards,
Rashi
0 Likes
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello,

Please let me know if the issue is seen on multiple storage cards or if this is an issue seen with one card.

The issue is seen on multiple storage cards and on multiple boards(DEV board and custom board).

 

confirm if you are using File System APIs (as done in FATfs example of FX3 SDK)  or reading/writing in RAW format to the cards.

I am using File System APIs.

 

Regards,

Sulaiman

0 Likes

Hello,

The issue is seen on multiple storage cards and on multiple boards(DEV board and custom board).

>> From this information it can be said that the issue could be from the firmware side.

Please let me know if you can test with the default firmware(in SDK i.e. writing/reading RAW data) and let me know if the issue is seen. This will help us to understand the issue is in which part of the firmware. Or if possible please share the firmware for us to check

Regards,
Rashi
0 Likes
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello,

I am using the default RAID0 example from the SDK without any change.

You mean by raw data is the data from the PC without processing in FX3s? I think the default RAID0 example is writing/reading raw data.

Please contact with me in email to send you the firmware.

 

Regards, 

Sulaiman                                                                                                                                                                                                  

0 Likes
lock attach
Attachments are accessible only for community members.
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello, 

The attached file is the firmware that I'm using.

while I'm searching in windows commands, there is a 'Copy' and 'Robocopy'. I tasted both of them and the issue happened only when using the 'copy' command, with exFAT format. 

 

Regards, 

Sulaiman  

0 Likes

Hello,

Please let me know what is the size of the files that you are copying using the exFAT COPY command

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

Thank you for the firmware.

I am summarizing the issue here. Please confirm if my understanding is correct.

- The issue (data not proper) happens for exFAT format only. NTFS works fine.

- The issue is seen when "copy" command of exFAT and not with Robocopy

Is my understanding correct?

If yes, please track the CY_FX_MSC_DATASENT_EVENT_FLAG and CY_FX_MSC_CBW_EVENT_FLAG using a global variable and printing the variables in MscAppThread_Entry in the event handling.

Also, capture the USB traces (using Wireshark) when robocopy (working case) and copy (not working case) is done

Please share USB traces, UART debug prints and HxD snippet  for the below cases

Case1: Copy test.txt using robocopy command (working case)

Case2: Copy test.txt using copy command (non working case)

Kindly do the above test (test.txt) with the file shared 

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.
Hello,
 
 
"I am summarizing the issue here. Please confirm if my understanding is correct.
- The issue (data not proper) happens for exFAT format only. NTFS works fine. 
- The issue is seen when "copy" command of exFAT and not with Robocopy
This is in Windows OS but also happen with other OS.
Is my understanding correct?"

Yes, your understanding is correct. 

 
 
 
CY_FX_MSC_DATASENT_EVENT_FLAG = 16.
CY_FX_MSC_CBW_EVENT_FLAG  = 8;
They are same in working case and non working case.
 
 
The attached files are  wireshark capture, HxD snippet and test.txt for working case and non working case.
 
 
 
Regards,
Sulaiman
0 Likes

Hi Sulaiman,

From the Wireshark traces for the working and non working case the change that is seen when the test.txt file is sent to FX3S over USB is as folllows:

Working case:

LBA (Logical Block Address) is 0

LBA_0.PNG

Non-working case:

LBA: 529 (0x211)

LBA_529.PNG

So, as the address is 0x211 as per the raid0 firmware, the data will be written to storage  port 1 

if (numBlks == 1)
                    {
                        /* Only one SD card is to be touched in case of a single block write. */
                        port    = startAddr & 0x01;             /* LSB of address only specifies port. */
                        sibAddr = (startAddr >> 1) * CY_FX_RAID_SECTOR_MULTIPLIER;
                        sibBlks = CY_FX_RAID_SECTOR_MULTIPLIER;

                        glRaidOpPending = (1 << port);

                        status = CyU3PSibReadWriteRequest (CY_FX_SIB_WRITE, port,
                                glLunUnit, sibBlks, sibAddr, glRaidWriteSocket[port]);
                    }

Please check the appropriate port and the address location and let me know if the data is written to it

Regards,
Rashi
0 Likes

Hi Rashi,

 

"From the Wireshark traces for the working and non working case the change that is seen when the test.txt file is sent to FX3S over USB is as follows:

Working case: LBA (Logical Block Address) is 0

I think the LBA is 0x210 .

Non-working case: LBA: 529 (0x211)"

 

I tried to read the data which is written to LBA(0x211) by the following change in  CY_FX_MSC_SCSI_READ_10 case but I can't:

if (numBlks == 1)
{
/* Only one SD card is to be touched in case of a single block read. */
if (startAddr==0x210){
port = 0x01;
}
else{
port = startAddr & 0x01;
}
/* LSB of address only specifies port. */
sibAddr = (startAddr >> 1) * CY_FX_RAID_SECTOR_MULTIPLIER;
sibBlks = CY_FX_RAID_SECTOR_MULTIPLIER;

glRaidOpPending = (1 << port);
status = CyU3PSibReadWriteRequest (CY_FX_SIB_READ, port,
glLunUnit, sibBlks, sibAddr, glRaidReadSocket[port]);
}

 

Is there a way to do it?

 

 

Regards,

Sulaiman

0 Likes

Hello Sulaiman,

I tried to read the data which is written to LBA(0x211) by the following change in  CY_FX_MSC_SCSI_READ_10 case but I can't:

>> Please share the Wireshark traces for me to evaluate. Also, please check if CyU3PSibReadWriteRequest passed and CY_U3P_SIB_EVENT_XFER_CPLT is received with status as success.

You can also check if CY_U3P_SIB_EVENT_XFER_CPLT received with status as success when write_10 is done on port 1

Also, please confirm if read writes to port 1 are working i.e.  the addresses are not write protected 

Regards,
Rashi
0 Likes

Hello,

 

When I added the following change, the device didn't work:

 

if (numBlks == 1)
{
/* Only one SD card is to be touched in case of a single block read. */
if (startAddr==0x210){
port = 0x01;
}
else{
port = startAddr & 0x01;
}
/* LSB of address only specifies port. */
sibAddr = (startAddr >> 1) * CY_FX_RAID_SECTOR_MULTIPLIER;
sibBlks = CY_FX_RAID_SECTOR_MULTIPLIER;

glRaidOpPending = (1 << port);
status = CyU3PSibReadWriteRequest (CY_FX_SIB_READ, port,
glLunUnit, sibBlks, sibAddr, glRaidReadSocket[port]);
}

 

 

Regards,

Sulaiman

0 Likes

Hello,

Please help us with the previously requested information to debug this issue :

"Please share the Wireshark traces for me to evaluate. Also, please check if CyU3PSibReadWriteRequest passed and CY_U3P_SIB_EVENT_XFER_CPLT is received with status as success.

You can also check if CY_U3P_SIB_EVENT_XFER_CPLT received with status as success when write_10 is done on port 1

Also, please confirm if read writes to port 1 are working i.e.  the addresses are not write protected "

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

Sorry for the delay.

I tested the device with USB analyzer and when I open the corrupted file, the read command doesn't appear in USB analyzer. The following pictures show write and read commands.

 

Regards, 

Sulaiman

0 Likes
lock attach
Attachments are accessible only for community members.
SulaimanY
Level 1
Level 1
10 sign-ins 10 replies posted 5 sign-ins

Hello,

 

Sorry for the delay.

The attached file show the size of the written files.

 

Regards, 

Sulaiman 

0 Likes
prophetcosty
Level 1
Level 1
First reply posted Welcome!

The issue is seen on multiple storage cards and on multiple boards(DEV board and custom board).

hellodear.in

tea tv apk

0 Likes
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hi,

I tested the firmware shared by you on FX3S DVK Rev D and I am not able to reproduce th issue when copying the files (exFAT) format. I checked the hxD dump and couldn't see any problems

Please find the attached Wireshark traces, snippets from hxD.

Following was the procedure I follwed

- Connected FX3S DVK to PC (with 2 SD cards 512 MB each inserted - as hot plug is not supported by the firmware )

- Programmed the device with the image file provided by you.

- Formatted the drive with following settings

format_settings.png

- Copied TEST.txt files 3-4 times

I opened every file copied and it works fine.

 

Regards,
Rashi
0 Likes