AnsweredAssumed Answered

K64 Custom Bootloader

Question asked by Jared Evans on Jun 2, 2016
Latest reply on Jun 20, 2016 by Jared Evans

Hi All,


I am revisiting a bootloader built with KDS and KSDK 1.3 and processor expert, loading image files from an SD card to reprogram a custom K64 board. I am continuing a discussion from K64 Bootloader Pre-jump Checklist , where I had unresolved issues with what seemed like interference from the bootloader and application images. I needed to memset the SRAM blocks in order to have the application run, but could not figure out a reason for this (described in the above link). The bootloader is placed at address 0x0, and the image is allocated from 0x10000 to 0xFFFFF. This shares the format discussed in SD Card Bootloader :how to using SD card to update existing firmware on CodeWarriror or KDS .


The programming of the image seems to be working correctly and the program runs, but seems to be missing features added using processor expert. I recently added low power modes into the project, which work when the program is loaded directly from the debugger, but not when loaded from the bootloader due to SMC_HAL_GetProtection() returning that low power modes are not allowed. The low power mode protection was set  in the application image but not in the bootloader; however, if I modify the bootloader to also allow low power modes, then it works properly.


Could anyone provide any insight into why the main application would be using what I assume to be the "system_MK64F12.c" file from the bootloader and not the one from the application? I am unsure what I am missing that makes some settings still shared between the two, which might also explain why I need to memset the SRAM.