How to use DFlash in MQX4.1?My hardware platform is TWR-K20D72M DEMO V1.0! Flashx drive contains only the PFalsh with FlexRAM, I added a block address DFlash inside,and changes the ftfl_flash_erase_sector and ftfl_flash_write_sector function in command_array [1] = (uint8_t) (write_addr >> 16) | (uint8_t) (((write_addr >> 21) & 0x00000080)); but now the situation is that to read and write is no problem, but it does not erase Falsh sector !MyPlase help me!
For allow FlashX write into D-Flash you should:
Attached files with modifications are for twrk40d100. You can take it as inspiration.
Note: unused command “#define __FLASHX_START_ADDR ((void *)Image$$USEDFLASH_END$$Base)” is special “magic” command which will cause that __FLASHX_START_ADDR will be filed by address where your code ends = FlashX region will be placed just behind you code. In our case we want place FlashX region to FlexNVM therefore we define __FLASHX_START_ADDR directly.
thanks!
Thanks for your code, Have you tested program & erase operation?
I agree with wangpengcheng that flash_ftfl.c should be changed, to make address meet FTFL's requirement. I don't see it in your code.
write_addr = (_mem_size) from_ptr;
if(write_addr & 0x10000000)
write_addr |= 0x00800000;
看你名字应该也认识中文,谢谢你啦,我搞定了,呵呵,你说的那个很实用!