|
如题:测试代码也是跑在双片flash中的,几个关键函数在itcm中,90MB/s读取的速度.我的flash是w25q64jv,按理双片合计16M,结尾地址应该是0x91000000-1,但是访问
最后几个字节mcu崩了,设置成0x90fffff0测试通过.
- __attribute__((section(".itcm_rom")))
- void test(void)
- {
- volatile uint32_t *const sptr = (uint32_t *)0x90000000UL;
- volatile uint32_t *const eptr = (uint32_t *)0x90fffff0UL;
- volatile uint32_t *ptr;
- uint32_t sum = 0;
- uint32_t st;
- uint32_t et;
-
- printf("test(0x%p) \r\n", test);
- printf("sptr(0x%p) \r\n", sptr);
- printf("eptr(0x%p) \r\n", eptr);
- st = HAL_GetTick();
- printf("Start check(%d) \r\n", st);
- #if 1
- for (int i = 0; i < 100; i++)
- {
- ptr = sptr;
- while (ptr < eptr)
- {
- sum += *ptr++;
- }
- }
- #endif
- et = HAL_GetTick();
- printf("End check(%d) \r\n", et);
- printf("%.2f(MB/s) \r\n", (1600 / ((et - st) / 1000.0)));
- printf("sum = %u \r\n", sum);
- }
复制代码
|
评分
-
查看全部评分
|