diff options
author | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-26 08:57:49 +0000 |
---|---|---|
committer | barthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-26 08:57:49 +0000 |
commit | 2ccbae7dc4cfc67616a86a4633eda2d0c9c9f360 (patch) | |
tree | 11ab65aad603055ac85558893466cda290804623 /testhal/STM32/STM32F4xx/FSMC_SRAM | |
parent | 6220df1090c175979f37717a4f9040770f86a098 (diff) | |
download | ChibiOS-2ccbae7dc4cfc67616a86a4633eda2d0c9c9f360.tar.gz ChibiOS-2ccbae7dc4cfc67616a86a4633eda2d0c9c9f360.tar.bz2 ChibiOS-2ccbae7dc4cfc67616a86a4633eda2d0c9c9f360.zip |
[FSMC SRAM] Fixed speed degradation in testhal application.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7198 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F4xx/FSMC_SRAM')
-rw-r--r-- | testhal/STM32/STM32F4xx/FSMC_SRAM/main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/testhal/STM32/STM32F4xx/FSMC_SRAM/main.c b/testhal/STM32/STM32F4xx/FSMC_SRAM/main.c index 74f275645..de591fbc5 100644 --- a/testhal/STM32/STM32F4xx/FSMC_SRAM/main.c +++ b/testhal/STM32/STM32F4xx/FSMC_SRAM/main.c @@ -62,7 +62,7 @@ static const size_t sram_size = 524288; * SRAM driver configuration structure. */ static const SRAMConfig sram_cfg = { - .btr = 2 << 8 | 1 + .btr = 2 << 8 }; /* benchmarking results in MiB/S */ @@ -90,7 +90,7 @@ static void sram_benchmark(void){ chTMObjectInit(&mem_tmu); chTMStartMeasurementX(&mem_tmu); memset(sram_start, 0x55, sram_size); - memset(sram_start, 0xAA, sram_size); + memset(sram_start, 0x00, sram_size); chTMStopMeasurementX(&mem_tmu); memset_speed_ext = 1 / (mem_tmu.cumulative / (double)STM32_SYSCLK); @@ -106,15 +106,16 @@ static void sram_benchmark(void){ chTMObjectInit(&mem_tmu); chTMStartMeasurementX(&mem_tmu); for (i=0; i<16; i++) - memcpy(sram_check_buf, sram_start, sizeof(sram_check_buf)); + memcpy(sram_check_buf, sram_start+ i * sizeof(sram_check_buf), sizeof(sram_check_buf)); chTMStopMeasurementX(&mem_tmu); memcpy_speed_ext2int = 1 / (mem_tmu.cumulative / (double)STM32_SYSCLK); /* memcpy int2ext */ chTMObjectInit(&mem_tmu); + memset(sram_check_buf, 0xAA, sizeof(sram_check_buf)); chTMStartMeasurementX(&mem_tmu); for (i=0; i<16; i++) - memcpy(sram_start, sram_check_buf, sizeof(sram_check_buf)); + memcpy(sram_start + i * sizeof(sram_check_buf), sram_check_buf, sizeof(sram_check_buf)); chTMStopMeasurementX(&mem_tmu); memcpy_speed_int2ext = 1 / (mem_tmu.cumulative / (double)STM32_SYSCLK); } |