如題,從官網(wǎng)EVT壓縮包中的IAP例程只有跳轉(zhuǎn)到boot的isp下載,不是IAP區(qū)的自定義燒錄,另外也有看過ch559的IAP例程,是通過跳轉(zhuǎn)至IAP區(qū)然后上位機燒錄,但個人能力有限,移植至554上使用難度不小,希望大大可以給一份可以在554上用的IAP例程以及上位機例程。
論壇搜了一圈發(fā)現(xiàn)有CH552的IAP例程,我去試試移植,有問題再求助大大們!
The problem is the bootloader in the CH554 devices. For loader version >= 2.31 the IAP call does not exist anymore. I just found that call in V1.1.?
Actuall devices of CH554 (CH552) are delivered with V2.5.
For CH559 its a bit different: In V2.31 there is still the IAP call suported. I dont know if there are newer versions of the bootloader for CH559 exit. I know of V2.0 and V2.31.
I guess IAP will not work with new versions of the bootloader because of security reasons. Bootloaders with IAP support all have included the keil libfunction _ICALL. More infos on my Gid pages or (in German) here?
https://www.mikrocontroller.net/topic/462538?goto=new#6820478
@TECH29?大大,這個例程我這邊有一些不太明白的地方:
1、codeflash地址預(yù)留0x0000~0x0078是有什么具體作用,我看沒有程序燒錄到這個地址,ch554這部分是否也有作用?
2、IAP工程地址起始從0x6000開始,APP地址從0x104開始,那么燒錄后上電是如何進入APP或者IAP區(qū)?我理解上電后復(fù)位后boot從0x0000開始執(zhí)行。
3、IAP工程中,USB初始化中開啟了中斷,然后主函數(shù)中又通過while判斷標(biāo)志輪詢中斷函數(shù),這是否有必要?
4、IAP工程中的flash擦除流程,從554頭文件看沒有擦除命令定義,這部分是否就不適用ch554了?
I describe what I have done in the past:
I created a simple USB device just with control EP no other EPs. for flashing I used a vendor request
wIndex= adrress wValue=16 bit flashcontend no datastage. I linked that code to 0x3000 with modified startup.a51 (keil). For crccheck i used a second request wIndex = usr code size wValue = expected CRC.?
If for any reason the crc fails I flash LMP 0x3000 + NOP at address 0x0000 so the IAP is reactivated again.
The same LMP 0x3000 + NOP is additionally linked a small asm module to the IAP code
? ? ?CSEG at 0
? ? ?LJMP 0x3000
? ? NOP
? ? end
This ensures that after Flashing the IAP code with WCHIspTool IAP starts automatically.
- CH552/554 dont need a erase.?
- IAP code can not use any interrupt?
- usercode can be at max from 0x0000 to 0x2FFF
@OJZ?
1,因為前面有四個字節(jié)的跳轉(zhuǎn)信息是一定不能被擦除修改的,而flash是頁編程,因此直接跳過前面一頁
2,? 0地址的跳轉(zhuǎn)信息做到
3,因為IAP中不能出現(xiàn)中斷,中斷向量表留給APP用
4,554可以直接編程不需要擦