Que tal Thulsa Doom,
Le he dado una leída rápida a la información disponible en el link que has proporcionado para este bootloader en particular, y según esta documentación, el bootloader usa el algoritmo de XTEA para la encriptación del firmware. El password que este requiere no se guarda en la memoria EEPROM del microconcontrolador, sino en la memoria FLASH de programa, por lo que ahí en primera instancia no necesitas que el micro a usar contenga memoria EEPROM de datos.
XTEA encryption algorithm protects user mode application from unauthorized copying. The encryption password together with the bootloader is burned into microcontroller flash memory during device production. To update the user mode application, you can send the encrypted file to customer. This application will only work fine on the devices containing the same bootloader with the same password. Any attempt to install this program into device with another password will result in complete inoperability. Bootloader itself and the password is protected by internal microcontroller configuration bits. Nobody can read it from the microcontroller.
Ahora bien, siguiendo leyendo en la documentación, en la sección de Bootloader configuration es donde se menciona el uso de la memoria EEPROM, pero eso es para definir el modo de operación. Pero en esa misma sección se menciona que para ingresar al modo de Firmware tienes dos opciones:
1) Por un marker en la memoria eeprom, que está asignado a la dirección 0x00, pero este puede ser habilitado o deshabiltiado mediante un #define en el código fuente.
EEPROM Mark configuration
EEPROM mark is used to guarantee fail-safe user mode application update. Bootloader sets mark in EEPROM memory at receiving of the first command from host and removes it during reset command (after the programming is completed). At the moment of user application programming the mark is always set. If any errors occur (e.g., power drop or off), EEPROM mark remains. At the next switch-on bootloader sees the EEPROM mark and enters the programming mode automatically. User application can be reprogrammed. Only in case host completes application upload and sends BOOT_RESET command, bootloader will clear EEPROM mark and run user application.
EEPROM mark can also be used for soft entry into the programming mode. All user-mode application has to do is to jump to 0x0016 address:
goto 0x0016
Bootloader will set EEPROM mark and reset the microcontroller to enter the programming mode.
EEPROM mark use is configured in boot.inc file with USE_EEPROM_MARK macro.
To use EEPROM mark macros value must be set to 1.
#define USE_EEPROM_MARK 1
If EEPROM mark is not used macros value must be set to 0.
#define USE_EEPROM_MARK 0
By default mark is located at address 0x00 of EEPROM memory. Bootloader enters the programming mode, if it reads 0x5A or 0xF0 at this address. 0xF0 value is used for fail-safe user mode application update. Bootloader doesn’t change this value unless it receives BOOT_RESET command from host. 0x5A value is used for soft reset. Bootloader resets this value (writes 0xFF instead of it) when it enters the programming mode.
If necessary to change mark address or values, override the following macros:
in EEPROM_MARK_ADDR macro specify EEPROM memory address to place the mark;
in EEPROM_MARK macro specify the value for fail-safe update mark;
in EEPROM_MARK_SOFT_RESET macro specify the value for soft-reset mark;
These macros are defined in boot.inc file as shown below:
After EEPROM erase all bytes values are equal to 0xFF, therefore, it is better to use other values for marks. If you use bootloader to program the microcontroller EEPROM memory, put the EEPROM mark into the image file. Otherwise if any errors occur bootloader will enter the user mode and launch the corrupted application.
2) Por medio de un jumper asignado al puerto E.0. Este también puede ser habilitado o deshabilitado mediante un #define que existe en el código fuente.
Jumper configuration
Jumper is used for hardware entry into the programming mode. It connects the corresponding microcontroller pin to ground (GND). To enter the programming mode close the jumper at the moment of device connection to USB. During initialization bootloader checks the value at the corresponding pin. If value is equal to zero, bootloader enters the programming mode.
If you want to launch user mode application after firmware update, you have to open the jumper before bootloader resets the microcontroller. Otherwise it will enter the programming mode once again.
Bootloader can also enter the programming mode with the help of EEPROM Mark.
The same pin can be used both for the jumper and for LED. First Bootloader verifies the value at this pin. At zero value (when the jumper is closed), it enters the programming mode, configures the pin as digital output, and outputs zero value there (LED is on). As an example of schematic solution see PIC USB Demo Board.
Jumper use is configured in io_cfg.inc file with USE_JP_Bootloader_EN macro. To use the jumper macros value must be set to 1.
#define USE_JP_Bootloader_EN 1
If the jumper is not used macros value must be set to 0.
#define USE_JP_Bootloader_EN 0
By default microcontroller pin E.0 is reserved for the jumper. If you need to use another pin change the following macros:
in JP_Bootloader_PORT macros specify PORT register address;
in JP_Bootloader_TRIS macros specify TRIS register address;
in JP_Bootloader_PIN macros specify the pin number.
These macros are defined in io_cfg.inc file as shown below:
#define JP_Bootloader_TRIS TRISE
#define JP_Bootloader_PORT PORTE
#define JP_Bootloader_PIN 0
Por lo tanto, basado en esa información, el bootloader se puede implementar en el microcontrolador que necesitas.
elreypic.