K210 IAP在线升级



  • hello!APP跳转的时候奔溃 ,
    [INFO] Booting From 0x80000000

        [INFO] Wait For 0.3 second for ISP to Boot
        
        [INFO] Boot to Flashmode Successfully
        
        [INFO] Selected Baudrate:  200000
        
        [INFO] Selected Flash:  On-Board
        
        [INFO] Extracting KFPKG ...
        
        [INFO] Writing boot.bin into 0x00000000
        
        Downloading: |██████████████████████████████████████████████████| 100.0% Complete
        
        [INFO] Writing app.bin into 0x00200000
        
        Downloading: |██████████████████████████████████████████████████| 100.0% Complete
        
        [INFO] Rebooting...
        
        --- forcing DTR inactive
        
        --- forcing RTS inactive
        
        --- Miniterm on /dev/ttyACM0  115200,8,N,1 ---
        
        --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
        
        bootload start:
        
        jump app {1} :
        
        core dump: fault load
        
        Cause 0x0000000000000005, EPC 0x000000008000054c
        
        reg[00](zero ) = 0x41d73eed80000000, reg[01](ra   ) = 0x0000000080000482
        
        reg[02](sp   ) = 0x0000000080018590, reg[03](gp   ) = 0x000000008000ff08
        
        reg[04](tp   ) = 0x00000000800107c0, reg[05](t0   ) = 0x0000000000000000


  • 也在研究IAP,我认为应该同时完成2个应用开发,唯一不同的是link的.ld文件必须修改为不同的FLASH地址,能否试试看?



  • 1,flash 固件地址
    [root@desktop-fpnun8v build]# cat kfpkg/mykf/flash-list.json
    {
    "version": "0.1.0",
    "files": [
    {
    "address": 0x00,
    "bin": "charging_Pile_boot.bin",
    "sha256Prefix": true
    },
    {
    "address": 0x00200000,
    "bin": "charging_Pile_Project.bin",
    "sha256Prefix": true
    }
    ]
    }
    如果sha256 为true的时候 烧录到flash的地址前会多5个字节
    2,flash 地址分区
    9 #define FLASH_LOADER_BASE ((uint32_t)0x0000000)
    10 #define FLASH_LOADER_SIZE (1 * 1024 * 1024) //bootload 1M size
    11 #define FLASH_APP_BASE (FLASH_LOADER_BASE+FLASH_LOADER_SIZE)
    12 #define FLASH_APP_SIZE (2 * 1024 * 1024) //APP 2M size
    13 #define FLASH_OTA_SECTOR_BASE (FLASH_APP_BASE + FLASH_APP_SIZE)
    14 #define FLASH_OTA_SECTOR_SIZE (2 * 1024 * 1024) //升级固件存放区
    3,程序跳转
    129 void jumpapp(uint64_t addr)
    130 {
    131 uint64_t JumpAddress;
    132 JumpAddress = (uint64_t)(addr);
    133 Jump_To_Application = (pFunction)JumpAddress;
    134 Jump_To_Application();
    135 }

    jumpapp(FLASH_APP_BASE);
    我在其它单片机都用过这种方式做远程升级,除了一点不同就是k210无法设置中断向量表



  • This post is deleted!