TMS320F2800157: Clarification on using Serial Flash Programmer with a permanent custom bootloader

Part Number: TMS320F2800157

Hi TI Team,

I am developing a custom bootloader for the TMS320F2800157 and would like to clarify whether I can reuse the existing Serial Flash Programmer PC application with my architecture.

My planned architecture is as follows:

PC Tool
    
USB-to-RS485
    
RS485 Transceiver
    
SCI
    
Custom Bootloader (stored permanently in Flash)
    
Copy TI F021 Flash API routines to RAM
    
Erase / Program / Verify Application Flash

Unlike the TI reference flow, I will not download the Flash Kernel into RAM through the SCI Boot ROM. Instead, the bootloader will already reside in Flash and will execute after reset (or after the application requests bootloader mode). The bootloader will receive firmware packets over SCI/RS485 and use the TI F021 Flash API from RAM to program the application.

While studying the Serial Flash Programmer source code, I noticed that there is a compile-time macro:

#define kernal

and many sections are conditionally compiled using:

#ifdef kernel

 f021_DownloadKernel(...);

 #endif

From my understanding, if this macro is removed/commented out, the PC tool skips the kernel download stage but still proceeds with the remaining communication and application download sequence.

My understanding is that this build mode is intended for a target where a compatible bootloader/kernel is already running.

Could you please confirm whether my understanding is correct?

Specifically:

If I disable the kernal macro, can the Serial Flash Programmer be used as the basis for communicating with my permanent bootloader?
Apart from modifying the packet protocol (if required), is the existing image download flow (f021_DownloadImage) intended to work with a bootloader that is already resident in Flash?
Is there any additional initialization or protocol expected by the PC tool that is normally performed by the downloaded Flash Kernel?

My goal is to reuse as much of the existing Serial Flash Programmer as possible rather than developing a new PC application from scratch.

Thank you for your guidance.

Best regards,
MD kamarudheen