6.2 Loading the New Target Firmware into the Host Application

Once the test_app_secure compilation is completed, repeat all the steps mentioned in the Observe the Output on the Serial Console.

Note:
  • The updated target application (.bin file) is automatically retrieved from the hex/test_app folder during the client firmware upgrade process.
  • Additionally, any new peripheral is integrated into the target firmware, and the user row configuration (Configuration Bits) for the target or client application is updated accordingly within the Host MCU.

Follow these steps to update the target firmware configuration bits.

  1. Open the application_user_configurations_in.txt in a file editor, such as Notepad or Visual Studio Code.
  2. Edit the configuration bits as per the peripheral usage in the test_app_secure project.
    Figure 6-6. Configuration Bits Modification
    Note:
    • The Host MCU stores the Client’s Configuration Bits values in the secure data memory region (0x0040_0000).
    • For additional information, refer to the NVM Configuration Rows section in the Memories chapter on the Device Data Sheet.
  3. Open the command prompt and run the Python script (btl_dev_cfg_gen.py) to create the application_user_configurations_out.txt configuration file. The btl_host.py script will use this file to update the configuration bits while programming the target or client application.
    python <harmony3_path>/bootloader/tools/btl_dev_cfg_gen.py -v -f  <downloaded path>/ pic32cm_ls60_secure_firmware_upgrade/scripts/application_user_configurations_in.txt -o  <downloaded path>/ pic32cm_ls60_secure_firmware_upgrade/scripts/application_user_configurations_out.txt
    Figure 6-7. User Row Configuration File Generation