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
Solved! Go to Solution.
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!
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!
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
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
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.
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.
#define | THROUGHPUT_TEST_ENABLE (1) |
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
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...