I loaded the bootloader into my PIC18F2458 and it works well!
Now I would like to add the information of the firmware loaded into the PIC to the Bootloader info record in the config.c file.
I would like to replace the "DEVICE_NAME" everytime I upload a new firmware using the bootloader.
Can someone explain me how to do that?
Thank you very much in advance, it's been 5 days now and I'm not able to succede in this
Code: Select all
#define DEVICE_NAME "NO NAME"
// Bootloader start address equasion:
const unsigned long BOOTLOADER_START = ((__FLASH_SIZE-BOOTLOADER_SIZE)/_FLASH_ERASE)*_FLASH_ERASE;
const unsigned char RESET_VECTOR_SIZE = 4; // MCU reset vector size in bytes.
// Bootloader info record.
// It is used by PC application tool to identify device and get device
// specific information.
const TBootInfo BootInfo = { sizeof(TBootInfo), // This record's size in bytes.
{bifMCUTYPE, MCU_TYPE}, // MCU family.
{bifMCUSIZE, __FLASH_SIZE}, // MCU flash size.
{bifERASEBLOCK, _FLASH_ERASE}, // MCU Flash erase block size in bytes.
{bifWRITEBLOCK, _FLASH_WRITE_LATCH}, // MCU Flash write block size in bytes.
{bifBOOTREV, BOOTLOADER_REVISION}, // Version of bootlaoder firmware.
{bifBOOTSTART, BOOTLOADER_START}, // Bootloader code start address.
{bifDEVDSC, DEVICE_NAME} // Name of this device.
};