I think you can find all the answers to your questions from Figure 5-6 Protocol Sequence for WriteMemory Command in kboot RM v2.0.0.
Let me answer your questions one by one:
1). When you issue write-memory command, You must first specify startAddress and dataLength in the WriteMemory command packet, so device should know the total data bytes to write before receiving any data packet, then device will count the received data bytes while receiving data packet, when the amount of received data is matched with the total num, then device will stop receiving data. so the max num of data packet depends on the actual bytes in each data packet.
For example: if you want to flash 100 byte by WriteMemory command, and you put 10 byte data in every data packet, then you need to provide 10 data packets. but if you put 25 bytes data in every data packet, then you just need to provide 4 data packets.
2). The max num of data bytes in single data packet is 32, because device bootloader only offer a 32 byte memory space to buffer received data. this restriction is just for ROM-resident bootloader, if you are playing with flash-resident bootloader, then you can customize the max num of data bytes.
3). When your specified memory is SRAM, the answer is yes. When the specified memory is FLASH, the answer is not necessarily, because there are two methods for bootloader to program flash memory, Kinetis FTFx memory module provides two basic Program command (ProgramWord(4 or 8 bytes) or ProgramSection (1K bytes)), bootloader implements both methods in source code, but each time we can only use one method, the default method may be different in different device, you need to check BL_FEATURE_ENABLE_FLASH_PROGRAM_SECTION in bootloader_config.h file.
if this macro is set to 0, then bootloader will progam data immediately before sending the ACK to host.
If this macro is set to 1, then bootloader will buffer received data to 1K bytes, at this time, the ACK sending from bootloader just means that the data has been received properly.
4). When bootloader gets a packet from host, if the CRC16 verification is passed, then bootloader will just give a ACK packet to host, but if it fails, then bootloader will give a generic responce packet to host which indicates error code.
5) / 6). See chapter 2.7 Application integrity check in kboot RM v2.0.0.
Best Regards,
Jay