With a S32K312 processor, bootloder size 300k (P_FLASH0), do not use flash_driver way, is there another way to erase P_FLASH0 the remaining 724K space?
我和你解释很多遍了吧,为了避免同时对同一块flash block进行读写操作,我们通常会将flash的操作map到其它的内存块中,例如RAM中,制作flash driver和这个的意思是一样的。在我发送给你的第一个链接中已经和你仔细的解释了什么是flash driver,其主要目地也就是避免RWW操作以及节省内存,避免APP程序对内存的不安全修改。
“The Flash Driver(actual flash algorithm) is the hardware dependent code for performing the flash functions.In most cases, programming flash memory from flash is not possible.Therefore the Flash Driver is downloaded and executed into RAM to allow programming of the application.The advantage of downloading the flash algorithm into RAM is that updates to the flash algorithms are possible without the need to reprogram the primary bootloader. The algorithm is cleared from RAM upon completion of the download to avoid accidental calls to the flash functions while in application. In special cases the flash algorithms are kept in flash memory and copied to RAM when needed. Of course the possibility of changing the flash algorithms is no longer available when this configuration is used. Moreover, there is a risk that the flash memory will be unintentionally erased from an accidental call to these functions. A remedy to correct this would be to encrypt the corresponding program code, such as e.g an XOR or the like.”
1.第一如果你在开发bootloader,且不想使用flash drvier,这完全可以,这不是必须,但是避免RWW操作,你依然需要将操作flash的操作放在不同的内存块中。在S32K1的SDK中,默认是将FLASH的操作映射到RAM中执行的,你可以去阅读下S32K1的代码实现。
2.如果你想MAP flash操作至别的内存模块中,参考flash drvier的方法,其流程是一模一样的。先修改链接文件,指定一段空间用于存放特定的函数或者变量,其次使用attribute指令,编译后可以在工程的"x.map"文件中查看函数和变量的地址.
我看你在两天的时间你为你的同一个topic创建了很多case,我必须要提醒你请遵循社区的规则,我们会最大程度的帮助你解决你的问题,请不要重复创建!