Trying the throughput test with the host_msd_fatfs_frdmk22f_mqx_frdmk22f

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

Trying the throughput test with the host_msd_fatfs_frdmk22f_mqx_frdmk22f

Jump to solution
1,465 Views
davepfaltzgraff
Senior Contributor I

When I set THROUGHPUT_TEST_ENABLE to (1) and build, I get linker errors:

  - section `.bss' will not fit in region `m_data'

  - region `m_data' overflowed by 9900 bytes

Is there an easy fix?

Thanks

Labels (2)
1 Solution
943 Views
davepfaltzgraff
Senior Contributor I

By changing the value of EACH_TRANSFER_SECTORS from 128 down to 64, I reduced the size of the 'test_buffer' to the point where it would fit in the .bss section. This allowed me to run the test and get the following output:

====

USB file system test

Waiting for USB mass storage to be attached...

----- Attach Event -----

State = 0  Interface Number = 0  Alternate Setting = 0  Class = 8  SubClass = 6

Protocol = 80

Mass Storage Device Attached

----- Interface opened Event -----

vol 0 mount success

******************************************************************************

*             vol 0 file.dat for write and read speed                        *

******************************************************************************

***************************1 write 100M test**********************************

write test results: time = 170894ms  speed = 599K/s

***************************1 read 100M test***********************************

read test results: time = 166586ms  speed = 614K/s

***************************2 write 100M test**********************************

write test results: time = 171861ms  speed = 595K/s

***************************2 read 100M test***********************************

read test results: time = 166754ms  speed = 614K/s

******************************************************************************

*                          vol 0 TEST DONE                                   *

******************************************************************************

====

Not too shabby!

View solution in original post

6 Replies
944 Views
davepfaltzgraff
Senior Contributor I

By changing the value of EACH_TRANSFER_SECTORS from 128 down to 64, I reduced the size of the 'test_buffer' to the point where it would fit in the .bss section. This allowed me to run the test and get the following output:

====

USB file system test

Waiting for USB mass storage to be attached...

----- Attach Event -----

State = 0  Interface Number = 0  Alternate Setting = 0  Class = 8  SubClass = 6

Protocol = 80

Mass Storage Device Attached

----- Interface opened Event -----

vol 0 mount success

******************************************************************************

*             vol 0 file.dat for write and read speed                        *

******************************************************************************

***************************1 write 100M test**********************************

write test results: time = 170894ms  speed = 599K/s

***************************1 read 100M test***********************************

read test results: time = 166586ms  speed = 614K/s

***************************2 write 100M test**********************************

write test results: time = 171861ms  speed = 595K/s

***************************2 read 100M test***********************************

read test results: time = 166754ms  speed = 614K/s

******************************************************************************

*                          vol 0 TEST DONE                                   *

******************************************************************************

====

Not too shabby!

943 Views
DavidS
NXP Employee
NXP Employee

Hi David,

That is awesome.

Thank you for sharing your solution for frdm-k22f.

I will be sure to pass along to our KSDK team.

Regards,

David

0 Kudos
943 Views
DavidS
NXP Employee
NXP Employee

Hi David,

Short answer is the K22F is running out of available SRAM for the image generated when THROUGHPUT_TEST_ENABLE is (1).

I tried this test on the frdm-k64f and it too generated the error.

When I modified the linker file to:

  /* Uninitialized data section */

  .bss :

  {

    /* This is used by the startup in order to initialize the .bss section */

    . = ALIGN(4);

    __START_BSS = .;

    __bss_start__ = .;

    *(.bss)

    *(.bss*)

    *(COMMON)

    . = ALIGN(4);

    __bss_end__ = .;

    __END_BSS = .;

  } > m_data_2     <--THIS WAS m_data

It compiled and ran with following results (again on frdm-k64f):

USB file system test

Waiting for USB mass storage to be attached...

----- Attach Event -----

State = 0  Interface Number = 0  Alternate Setting = 0  Class = 8  SubClass = 6  Protocol = 80

Mass Storage Device Attached

----- Interface opened Event -----

vol 0 mount success

******************************************************************************

*             vol 0 file.dat for write and read speed                        *

******************************************************************************

***************************1 write 100M test**********************************

write test results: time = 190248ms  speed = 538K/s

***************************1 read 100M test***********************************

read test results: time = 165232ms  speed = 619K/s

***************************2 write 100M test**********************************

write test results: time = 189899ms  speed = 539K/s

***************************2 read 100M test***********************************

read test results: time = 165233ms  speed = 619K/s

******************************************************************************

*                          vol 0 TEST DONE                                   *

******************************************************************************

I'll have to ask around if this test is "just too big" for K22.

FYI - I did try compiling for "Release" target but still image was too big.

Regards,

David

943 Views
davepfaltzgraff
Senior Contributor I

Hi Dave,

I tried the change you suggested, but it simply returned that there was not room in m_data_2. The heap and stack are assigned to m_data_2. Since the total area is 64K, I'd think there should be some way around this.

I looked at the code to run the test and noted that there are two large arrays, raw_size_arr[] and test_buffer[] that would cause this. Since I only need about 10K, how would I "tell" the compiler linker that one of these variables should be allocated to m_data_2 instead of the default .bss (m_data)?

Thanks.

0 Kudos
943 Views
soledad
NXP Employee
NXP Employee

Hello David,

Are you using KDS??

If you want to test throughput, you should set THROUGHPUT_TEST_ENABLE as (1) in file mfs_usb.h for mqx, file msd_diskio.h for sdk.

For MQX, please add the below line in the  mfs_usb.h file and recompile the library.

#defineTHROUGHPUT_TEST_ENABLE (1)

pastedImage_0.png


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
943 Views
davepfaltzgraff
Senior Contributor I

Hi Soledad,

Yes, I should have mentioned that I'm working in KDS. As it turns out, I was trying to do this with just the SDK so that the adapter_cfg.h had

#define OS_ADAPTER_ACTIVE_OS OS_ADAPTER_SDK

In msd_diskio.h I had changed THROUGHPUT_TEST_ENABLE to (1) as you suggested. It was under those conditions that I got the linker error message. SO, that was my original question.

When I go back to adapter_cfg.h and change the OP_ADAPTER_ACTIVE_OS to OS_ADAPTER_MQX, I get a different error that will requires separate investigation.

It appears to be more complex...

0 Kudos