This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0L2228: BSL Software Entry

Part Number: MSPM0L2228
Other Parts Discussed in Thread: SYSCONFIG, MSPM0L1306

Tool/software:

I have trouble entering BSL mode from software on the MSPM0L2228.

I call

DL_SYSCTL_resetDevice(DL_SYSCTL_RESET_BOOTLOADER_ENTRY);

The device always resets but then just reloads the application code.

The TRM mentions:

"BSL is started (if the device security policy has the BSL configured to be enabled)"

I'm not certain what that means, I looked for a BSL device security policy in sysconfig and did not find anything with that name.  I have BSL enabled, but the Invoke Pin is disabled.

I am making a few changes in sysconfig to use different pins for the BSL.  Here are the sysconfig lines generated by the GUI:

NONMAIN.nonmainWarning    = true;
NONMAIN.bslInvokePinCheck = false;
NONMAIN.uartTXPin         = "PA0";
NONMAIN.uartRXPin         = "PA1";
NONMAIN.i2cSCLPin         = "PB17";
NONMAIN.i2cSDAPin         = "PB18";

I need the UART pins on PA0 and PA1, I reassigned the I2C pins to get them off of PA0 and PA1.

Anything else I can try to get it to enter BSL?

I am only trying to use the ROM BSL.  I don't think I need any secondary BSL modifications.

When I clear the main flash and power cycle the device, I can see it enters BSL mode and I can execute BSL commands with a UART  on PA0/PA1.

Thanks

  • It seems like some of this might be related to the bslInvokePinCheck setting.  When enabled, if the bsl enable pin is high, it will enter bsl and stay there.  This is inconvenient for our hardware implementation.  It would be much better if I could enter bsl mode from software and stay there without checking the pin.

    Is there some configuration element missing from the sysconfig tool?

  • Hi Barry,

    Can you try using the example in the SDK for the UART BSL, disable the "Enable BSL Invoke Pin Check" and see if the error persists?

    Best Regards,

    Diego Abad

  • Yes, if I check "Enable BSL Invoke Pin Check" AND the selected BSL pin is in the correct state, then the processor enters the bsl mode and the UART is functional.

    Unfortunately this requires the selected BSL pin to be in the proper state.

    The User Guide said the BSL pin is not required for software entry.

  • Hi Barry,
    I meant to ask for you to make uncheck the BSL invoke Pin Check option from the UART BSL SDK Example project, invoke it through software, and see if it still won't start BSL.

    Best Regards,

    Diego Abad

  • I have not seen a suitable example project for the 2228.  

    I used the bsl_software_invoke_app_demo_uart_LP_MSPM0L1306_nortos_ticlang project as a reference.

    I am trying to migrate that project to the 2228, but I have concerns.  There is a startup_mspm0l130x_ticlang.c source file that seems pretty specific.  I'm not sure it will work.

    Also, in sysconfig "Linker File Generation" is not selected, and sysconfig warns migration may not work automatically.  Possibly this is related to the file above.

  • Hi Barry,
    I recommend modifying an already existing project for the L2228 with the changes from the project you want to use (bsl_software_invoke_app_demo_uart_LP_MSPM0L1306_nortos_ticlang)
    Best Regards,
    Diego Abad

  • That is exactly what I did and it is not working.

  • Hi Barry,

    Would you mind sharing the boot_5F00_config.c & boot_5F00_config.h files SYSCONFIG generates?

    Best Regards,

    Diego Abad

  • Happy to share them, but I can not find them.  I searched the entire workspace.  Could they be named something else, or do I need to select a CCS option to generate them?

  • Hi Barry,

    I meant the boot_config.c/.h files.

    Best Regards,

    Diego Abad

  • #include "boot_config.h"
    #include "ti_msp_dl_config.h"
    
    /* Bootcode configuration */
    
    PLACE_IN_MEMORY(".BCRConfig")
    const BCR_Config BCRConfig =
    {
        .bcrConfigID          = 0x1000002,
        .debugAccess          = BCR_CFG_DEBUG_ACCESS_EN,
        .swdpMode             = BCR_CFG_SWDP_EN,
        .tifaMode             = BCR_CFG_TIFA_EN,
        .bslPinInvokeEnable   = BCR_CFG_BSL_PIN_INVOKE_EN,
        .staticWriteProtectionMainLow  = CFG_DEFAULT_VALUE,
        .staticWriteProtectionMainHigh = CFG_DEFAULT_VALUE,
        .staticWriteProtectionNonMain  = BCR_CFG_NON_MAIN_STATIC_PROT_DIS,
        .debugHold            = BCR_CFG_DEBUG_HOLD_DIS,
        .CSCexist             = BCR_CFG_CSC_NOT_EXIST,
        .flashBankSwapPolicy  = BCR_CFG_FLASH_BS_DIS,
        .fastBootMode         = BCR_CFG_FAST_BOOT_DIS,
        .bootloaderMode       = BCR_CFG_BOOTLOADER_MODE_EN,
        .massEraseMode        = BCR_CFG_MASS_ERASE_EN,
        .factoryResetMode     = BCR_CFG_FACTORY_RESET_EN,
        .passwordMassErase    = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE},
        .passwordFactoryReset = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE},
        .passwordDebugLock    = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE,
            CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE},
        .bc_reserved_0 = 0xFFFF,
        .secureBootMode                = BCR_CFG_SECURE_BOOT_DIS,
        .userSecureAppStartAddr        = CFG_DEFAULT_VALUE,
        .userSecureAppLength           = CFG_DEFAULT_VALUE,
        .userSecureAppHash = {CFG_DEFAULT_VALUE,CFG_DEFAULT_VALUE,CFG_DEFAULT_VALUE,CFG_DEFAULT_VALUE,
        CFG_DEFAULT_VALUE,CFG_DEFAULT_VALUE,CFG_DEFAULT_VALUE,CFG_DEFAULT_VALUE},
        .bc_reserved_1 = 0xFFFFFFFFU,
        .userCfgCRC                    = 0x3f6920b2,
    };
    
    
    /* Bootloader configuration */
    
    PLACE_IN_MEMORY(".BSLConfig")
    const BSL_Config BSLConfig =
    {
        .configID                          = 0x1,
        .interfacePins.UART_RXD_pad_num    = DEF_UART_RXD_PAD,
        .interfacePins.UART_RXD_PF_mux_sel = DEF_UART_RXD_MUX,
        .interfacePins.UART_TXD_pad_num    = DEF_UART_TXD_PAD,
        .interfacePins.UART_TXD_PF_mux_sel = DEF_UART_TXD_MUX,
        .interfacePins.I2C_SDA_pad_num     = DEF_I2C_SDA_PAD,
        .interfacePins.I2C_SDA_PF_mux_sel  = DEF_I2C_SDA_MUX,
        .interfacePins.I2C_SCL_pad_num     = DEF_I2C_SCL_PAD,
        .interfacePins.I2C_SCL_PF_mux_sel  = DEF_I2C_SCL_MUX,
        .pin.pinData0                      = DEFAULT_BSL_PIN_INVOCATION_DATA0,
        .pin.pinData1                      = DEFAULT_BSL_PIN_INVOCATION_DATA1,
        .memoryRead         = BSL_CFG_MEMORY_READOUT_DISABLE,
        .password           = {0x761396af, 0x5f63720f,
            0x5a4ab4bd, 0x9fc3630a, 0xf930af12,
            0x5ceea650, 0x88e11b97, 0x51409ce8},
        .pluginType         = BSL_CFG_PLUGIN_TYPE_ANY,
        .flashPluginEnable  = BSL_CFG_PLUGIN_FLASH_NOT_EXIST,
        .pluginSramSize     = 0xff,
        .pluginHook[0]      = CFG_DEFAULT_VALUE,
        .pluginHook[1]      = CFG_DEFAULT_VALUE,
        .pluginHook[2]      = CFG_DEFAULT_VALUE,
        .pluginHook[3]      = CFG_DEFAULT_VALUE,
        .BSLAlternateConfig = BSL_CFG_FLASH_BSL_NOT_EXIST,
        .reserved           = 0xFFFF,
        .BSLAlternateAddr   = CFG_DEFAULT_VALUE,
        .appRev             = (uint32_t *) CFG_DEFAULT_VALUE,
        .securityAlert      = BSL_CFG_SECURITY_IGNORE,
        .i2cSlaveAddress    = 0x48,
        .userCfgCRC         = 0x3caea8b6,
    };
    
    /* Added for secondary_bsl to build */
    /* 'main' function will never get called */
    #if defined(__ti_version__) || defined(__TI_COMPILER_VERSION__)
    __attribute__((weak)) int main(void)
    {
        return (0);
    }
    #elif defined(__IAR_SYSTEMS_ICC__)
    __weak int main(void);
    #elif (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined(__GNUC__)
    __attribute__((weak)) int main(void);
    #else
    #error "Non-Main table currently not supported for this compiler"
    #endif
    

    #ifndef boot_config_h
    #define boot_config_h
    
    #include "ti_msp_dl_config.h"
    
    /* clang-format off */
    
    /* General defines */
    #define PASSWORD_WORD_LEN                                                  (8U)
    
    /*! The default value used in the BCR and BSL Config structures */
    #define CFG_DEFAULT_VALUE                                         (0xFFFFFFFFU)
    
    #if defined(__ti_version__) || defined(__TI_COMPILER_VERSION__)
    #define PLACE_IN_MEMORY(x) __attribute__((section(x))) __attribute__((retain))
    #elif defined(__GNUC__) || defined(__clang__)
    #define PLACE_IN_MEMORY(x) __attribute__((section(x))) __attribute__((used))
    #elif defined(__IAR_SYSTEMS_ICC__)
    #define STRINGIFY(a) #a
    #define PLACE_IN_MEMORY(x) _Pragma(STRINGIFY(location = x)) __root
    #else
    #error "Non-Main table currently not supported for this compiler"
    #endif
    
    /* Defines for BSL UART and I2C interface pins */
    #define DEF_UART_RXD_PAD                                                  (0x2)
    #define DEF_UART_RXD_MUX                                                  (0x2)
    #define DEF_UART_TXD_PAD                                                  (0x1)
    #define DEF_UART_TXD_MUX                                                  (0x2)
    #define DEF_I2C_SDA_PAD                                                  (0x36)
    #define DEF_I2C_SDA_MUX                                                   (0x4)
    #define DEF_I2C_SCL_PAD                                                  (0x35)
    #define DEF_I2C_SCL_MUX                                                   (0x4)
    
    #define DEFAULT_BSL_PIN_INVOCATION_DATA0                       ((uint8_t) 0x4a)
    #define DEFAULT_BSL_PIN_INVOCATION_DATA1                       ((uint8_t) 0x1b)
    
    /**
     * @brief Possible values used for BCR configuration struct
     */
    
    /*! @enum BCR_CFG_DEBUG_ACCESS */
    typedef enum {
        /*! AHB-AP, ET-AP, PWR-AP are enabled */
        BCR_CFG_DEBUG_ACCESS_EN = 0xAABBU,
        /*! AHB-AP, ET-AP, PWR-AP are enabled with password through DSSM */
        BCR_CFG_DEBUG_ACCESS_EN_PW = 0xCCDDU,
        /*! AHB-AP, ET-AP, PWR-AP are disabled */
        BCR_CFG_DEBUG_ACCESS_DIS = 0xFFFFU,
    } BCR_CFG_DEBUG_ACCESS;
    
    /*! @enum BCR_CFG_SWDP_MODE */
    typedef enum {
        /*! SWD port access is enabled */
        BCR_CFG_SWDP_EN = 0xAABBU,
        /*! SWD port access is disabled */
        BCR_CFG_SWDP_DIS = 0xFFFFU,
    } BCR_CFG_SWDP_MODE;
    
    /*! @enum BCR_CFG_TIFA_MODE */
    typedef enum {
        /*! If enabled, re-test request through DSSM is serviced */
        BCR_CFG_TIFA_EN = 0xAABBU,
        /*! Re-test request through DSSM is not serviced */
        BCR_CFG_TIFA_DIS = 0xFFFFU,
    } BCR_CFG_TIFA_MODE;
    
    /*! @enum BCR_CFG_BSL_PIN_INVOKE */
    typedef enum {
        /*! GPIO based BSL invocation check will be executed */
        BCR_CFG_BSL_PIN_INVOKE_EN = 0xAABBU,
        /*! GPIO based BSL invocation check will not be executed */
        BCR_CFG_BSL_PIN_INVOKE_DIS = 0xFFFFU,
    } BCR_CFG_BSL_PIN_INVOKE;
    
    /*! @enum BCR_CFG_DEBUG_HOLD_MODE */
    typedef enum {
        /*! Controls the release of debug access until INITDONE is issued */
        BCR_CFG_DEBUG_HOLD_EN = 0xFFFFU,
        /*! Does not control the release of debug access until INITDONE is issued */
        BCR_CFG_DEBUG_HOLD_DIS = 0xAABBU,
    } BCR_CFG_DEBUG_HOLD_MODE;
    
    /*! @enum BCR_CFG_CSC_MODE */
    typedef enum {
        /*! Enable the CSC policy in SYSCTL */
        BCR_CFG_CSC_EXIST = 0xFFFFU,
        /*! Disable the CSC policy in SYSCTL */
        BCR_CFG_CSC_NOT_EXIST = 0xAABBU,
    } BCR_CFG_CSC_MODE;
    
    /*! @enum BCR_CFG_FLASH_BS_MODE */
    typedef enum {
        /*! Enable the Flash Bank Swap Policy in SYSCTL */
        BCR_CFG_FLASH_BS_EN = 0xFFFFU,
        /*! Disable the Flash Bank Swap Policy in SYSCTL */
        BCR_CFG_FLASH_BS_DIS = 0xAABBU,
    } BCR_CFG_FLASH_BS_MODE;
    
    /*! @enum BCR_CFG_FAST_BOOT */
    typedef enum {
        /*! If enabled, checks only the register invoke condition and skips other
         *  BSL invoke conditions */
        BCR_CFG_FAST_BOOT_EN = 0xAABBU,
        /*! If disabled, all enabled BSL invoke conditions are evaluated */
        BCR_CFG_FAST_BOOT_DIS = 0xFFFFU,
    } BCR_CFG_FAST_BOOT;
    
    /*! @enum BCR_CFG_BOOTLOADER_MODE */
    typedef enum {
        /*! Enable Bootloader mode */
        BCR_CFG_BOOTLOADER_MODE_EN = 0xAABBU,
        /*! Disable Bootloader mode */
        BCR_CFG_BOOTLOADER_MODE_DIS = 0xFFFFU,
    } BCR_CFG_BOOTLOADER_MODE;
    
    /*! @enum BCR_CFG_MASS_ERASE */
    typedef enum {
        /*! Enable Mass Erase without password */
        BCR_CFG_MASS_ERASE_EN = 0xAABBU,
        /*! Enable Mass Erase with password */
        BCR_CFG_MASS_ERASE_EN_PW = 0xCCDDU,
        /*! Disable Mass Erase */
        BCR_CFG_MASS_ERASE_DIS = 0xFFFFU,
    } BCR_CFG_MASS_ERASE;
    
    /*! @enum BCR_CFG_FACTORY_RESET */
    typedef enum {
        /*! Enable Factory Reset without password */
        BCR_CFG_FACTORY_RESET_EN = 0xAABBU,
        /*! Enable Factory Reset with password */
        BCR_CFG_FACTORY_RESET_EN_PW = 0xCCDDU,
        /*! Disable Factory Reset */
        BCR_CFG_FACTORY_RESET_DIS = 0xFFFFU,
    } BCR_CFG_FACTORY_RESET;
    
    /*! @enum BCR_CFG_NON_MAIN_STATIC_PROT */
    typedef enum {
        /*! Enable static write protection for non-main memory */
        BCR_CFG_NON_MAIN_STATIC_PROT_EN = 0xFFFFU,
        /*! Disable static write protection for non-main memory */
        BCR_CFG_NON_MAIN_STATIC_PROT_DIS = 0xAABBU,
    } BCR_CFG_NON_MAIN_STATIC_PROT;
    
    /*! @enum BCR_CFG_SECURE_BOOT */
    typedef enum {
        /*! Enable CRC check part of application */
        BCR_CFG_SECURE_BOOT_EN = 0xAABBU,
        /*! Enable Hash check part of application */
        BCR_CFG_SECURE_BOOT_HASH_EN = 0xCCDDU,
        /*! Disable application check */
        BCR_CFG_SECURE_BOOT_DIS = 0xFFFFU,
    } BCR_CFG_SECURE_BOOT;
    
    
    /* Bootcode user configuration structure */
    typedef struct
    {
        /*! Configuration signature */
        uint32_t bcrConfigID;
        /*! Enable/disable AHB-AP, ET-AP, PWR-AP.
         * One of @ref BCR_CFG_DEBUG_ACCESS */
        BCR_CFG_DEBUG_ACCESS debugAccess;
        /*! Enable/disable SWD port access. One of @ref BCR_CFG_SWDP_MODE */
        BCR_CFG_SWDP_MODE swdpMode;
        /*! Enable/disable servicing re-test request through DSSM.
         * One of @ref BCR_CFG_TIFA_MODE */
        BCR_CFG_TIFA_MODE tifaMode;
        /*! Enable/disable BSL pin invocation.
        * One of @ref BCR_CFG_BSL_PIN_INVOKE */
        BCR_CFG_BSL_PIN_INVOKE bslPinInvokeEnable;
        /*! Programs static write protection of first 32K bytes.
         * One bit corresponds to one sector, LSB is Sector 0. Setting a bit
         * to 0 disables write, setting a bit to 1 enables write Possible values:
         *    - 0x0 to 0xFFFFFFFF */
        uint32_t staticWriteProtectionMainLow;
        /*! Programs static write protection of first 32K bytes.
         * One bit corresponds to eight sectors. Setting a bit
         * to 0 disables write, setting a bit to 1 enables write Possible values:
         *    - 0x0 to 0xFFFFFFF0 */
        uint32_t staticWriteProtectionMainHigh;
        /*! Non Main Flash Static Write Protection.
         * One of @ref BCR_CFG_NON_MAIN_STATIC_PROT */
        BCR_CFG_NON_MAIN_STATIC_PROT staticWriteProtectionNonMain;
        /*! debugHold*/
        uint16_t  debugHold;
        /*! CSCexist*/
        uint16_t CSCexist;
        /*! flashBankSwapPolicy*/
        uint16_t flashBankSwapPolicy;
        /*! The fast boot mode. One of @ref BCR_CFG_FAST_BOOT*/
        BCR_CFG_FAST_BOOT fastBootMode;
        /*! The bootloader mode. One of @ref BCR_CFG_BOOTLOADER_MODE */
        BCR_CFG_BOOTLOADER_MODE bootloaderMode;
        /*! The mass erase mode. One of @ref BCR_CFG_MASS_ERASE */
        BCR_CFG_MASS_ERASE massEraseMode;
        /*! The factory reset mode. One of @ref BCR_CFG_FACTORY_RESET */
        BCR_CFG_FACTORY_RESET factoryResetMode;
        /*! DSSM_BC_MASS_ERASE_REQUEST, DSSM_DATA_EXCHANGE */
        uint32_t passwordMassErase [PASSWORD_WORD_LEN];
        /*! DSSM_BC_FACTORY_RESET_REQUEST, DSSM_DATA_EXCHANGE */
        uint32_t passwordFactoryReset [PASSWORD_WORD_LEN];
        /*! Used with Command DSSM_BC_PW_AUTH_REQUEST */
        uint32_t passwordDebugLock [PASSWORD_WORD_LEN];
        /*! bc_reserved_0*/
        uint16_t bc_reserved_0;
        /*! CRC check part of the application. One of @ref BCR_CFG_SECURE_BOOT */
        BCR_CFG_SECURE_BOOT secureBootMode;
        /*! The Starting address from where CRC has to be calculated for the application */
        uint32_t userSecureAppStartAddr;
        /*! The Length of the application for which CRC is calculated */
        uint32_t userSecureAppLength;
        /*! userSecureAppHash*/
        uint32_t userSecureAppHash [PASSWORD_WORD_LEN];
        /*! Reserved */
        uint32_t bc_reserved_1;
        /*! CRC-32 of this structure*/
        uint32_t userCfgCRC;
    } BCR_Config;
    
    /* Structure to store the Bootloader UART and I2C Pin details. */
    typedef struct
    {
        uint8_t UART_RXD_pad_num;
        uint8_t UART_RXD_PF_mux_sel;
        uint8_t UART_TXD_pad_num;
        uint8_t UART_TXD_PF_mux_sel;
        uint8_t I2C_SDA_pad_num;
        uint8_t I2C_SDA_PF_mux_sel;
        uint8_t I2C_SCL_pad_num;
        uint8_t I2C_SCL_PF_mux_sel;
    } BSLInterfacePins;
    
    /* Structure to store the Bootloader invocation Pin details.
     * This structure is followed in TRIM memory where default BSL invocation
     * pin details are stored and also in Bootloader configuration memory.
     *
     * Pin_data_0
     * BIT [0-5]  :pincmIndex   -> IOMUX_SECCFG_PINCM index for the pin (0 to 63)
     * BIT [7]    :pinLevel     -> Pin state High(1)/ Low(0) which should be
     *                             considered as BSL invocation condition
     * Pin_data_1
     * BIT [0-4]  :gpioNum      -> GPIO Pin number (0 to 31)
     * BIT [5]    :gpioBase     -> GPIO Instance number or GPIO Base Index (0 or 1)
     */
    typedef struct
    {
        uint8_t pinData0;
        uint8_t pinData1;
    } BSLInvokePin;
    
    /**
     * @brief Possible values used for BSL configuration struct
     */
    
    /*! Mask for BSLInvokePin.pinData0 to get IOMUX_PINCM */
    #define BSL_CFG_INVOKE_PIN_PINCM_INDEX_MASK                             (0x7FU)
    #define BSL_CFG_INVOKE_PIN_PINCM_INDEX_POS                                 (0U)
    
    /*! Mask for BSLInvokePin.pinData0 to get the pin state, which determines the
     * Bootloader invocation condition) */
    #define BSL_CFG_INVOKE_PIN_LEVEL_MASK                                   (0x80U)
    #define BSL_CFG_INVOKE_PIN_LEVEL_POS                                       (7U)
    
    /*! Mask for BSLInvokePin.pinData1 to get GPIO pin number */
    #define BSL_CFG_INVOKE_PIN_GPIO_PIN_NUM_MASK                            (0x1FU)
    #define BSL_CFG_INVOKE_PIN_GPIO_PIN_NUM_POS                                (0U)
    
    /*! Mask for BSLInvokePin.pinData1 to get GPIO Base Index */
    #define BSL_CFG_INVOKE_PIN_GPIO_PORT_NUM_MASK                           (0x60U)
    #define BSL_CFG_INVOKE_PIN_GPIO_PORT_NUM_POS                               (5U)
    
    /*! @enum BSL_CFG_MEMORY_READOUT */
    typedef enum {
        /*! Memory readout is enabled */
        BSL_CFG_MEMORY_READOUT_ENABLE = 0xAABBU,
        /*! Memory readout is disabled */
        BSL_CFG_MEMORY_READOUT_DISABLE = 0xFFFFU,
    } BSL_CFG_MEMORY_READOUT;
    
    /*! @enum BSL_CFG_NRST */
    typedef enum {
        /*! NRST is disabled during bootloader execution */
        BSL_CFG_NRST_DISABLE = 0xAABBU,
        /*! NRST is enabled during bootloader execution */
        BSL_CFG_NRST_ENABLE = 0xFFFFU,
    } BSL_CFG_NRST;
    
    /*! @enum BSL_CFG_PLUGIN_TYPE */
    typedef enum {
        /*! Plugin type in Flash is UART */
        BSL_CFG_PLUGIN_TYPE_UART = 0x1000U,
        /*! Plugin type in Flash is I2C */
        BSL_CFG_PLUGIN_TYPE_I2C = 0x2000U,
        /*! Any other interface with valid hooks will be added to the plugin
         * list */
        BSL_CFG_PLUGIN_TYPE_ANY = 0xFFFFU,
    } BSL_CFG_PLUGIN_TYPE;
    
    /*! @enum BSL_CFG_PLUGIN_FLASH */
    typedef enum {
        /*! Flash plugin will be used */
        BSL_CFG_PLUGIN_FLASH_EXIST = 0xBBU,
        /*! Only ROM plugins will be used */
        BSL_CFG_PLUGIN_FLASH_NOT_EXIST = 0xFFU,
    } BSL_CFG_PLUGIN_FLASH;
    
    /*! @enum BSL_CFG_FLASH_BSL */
    typedef enum {
        /*! Secondary BSL does exist */
        BSL_CFG_FLASH_BSL_EXIST = 0xAABBU,
        /*! Secondary BSL does not exist */
        BSL_CFG_FLASH_BSL_NOT_EXIST = 0xFFFFU,
    } BSL_CFG_FLASH_BSL;
    
    /*! @enum BSL_CFG_SECURITY */
    typedef enum {
        /*! Factory reset performed on security alert */
        BSL_CFG_SECURITY_FACTORY_RESET = 0xAABBU,
        /*! BSL disabled on security alert */
        BSL_CFG_SECURITY_DISABLE_BSL = 0xCCDDU,
        /*! Ignore security alert */
        BSL_CFG_SECURITY_IGNORE = 0xFFFFU,
    } BSL_CFG_SECURITY;
    
    /**
     * @brief Bootstrap loader (BSL) configuration structure values.
     * See BSL_CFG defines for possible values.
     */
    typedef struct
    {
        /*! Predetermined config signature magic ID */
        uint32_t configID;
        /*! BSL interface pins. Static Default BSL invocation Pin details are
         * as per TRIM open AREA default. */
        BSLInterfacePins interfacePins;
        /*! BSL pin invocation. Static Default BSL invocation Pin details are
         * as per TRIM open Area default. */
        BSLInvokePin pin;
        /*! Enable/disable memory readout. One of @ref BSL_CFG_MEMORY_READOUT */
        BSL_CFG_MEMORY_READOUT memoryRead;
        /*! Bootloader 64-byte password */
        uint32_t password[8];
        /*! Plugin type. One of @ref BSL_CFG_PLUGIN_TYPE */
        BSL_CFG_PLUGIN_TYPE pluginType;
        /*! Enable use of Flash plugin or ROM plugin.
         * One of @ref BSL_CFG_PLUGIN_FLASH */
        BSL_CFG_PLUGIN_FLASH flashPluginEnable;
        /*! SRAM memory consumed by the Flash Plugin. Range from 0x00 to 0xFF*/
        uint8_t pluginSramSize;
        /*! Function pointers for Flash Plugins.
         *   - Byte [3-0] : Init
         *   - Byte [7-4] : Receive
         *   - Byte [11-8] : Send
         *   - Byte [15-12] : Deinit */
        uint32_t pluginHook[4];
        /*! ID field to enable invocation of an alternate BSL.
         * One of @ref BSL_CFG_FLASH_BSL */
        BSL_CFG_FLASH_BSL  BSLAlternateConfig;
        /*! Reserved */
        uint16_t reserved;
        /*! Address of the alternate BSL */
        uint32_t  BSLAlternateAddr;
        /*! Pointer to the version information in MAIN flash. Possible values:
         *    - Valid Flash Address
         *    - All other values: Address will not be accessed */
        uint32_t* appRev;
        /*! Security alert configuration. One of @ref BSL_CFG_SECURITY */
        BSL_CFG_SECURITY securityAlert;
        /* I2C slave address to be used for BSL I2C communication. Any 7-bit value */
        uint16_t i2cSlaveAddress;
        /*! CRC of this BSL_Config structure */
        uint32_t userCfgCRC;
    } BSL_Config;
    
    /* Added for secondary_bsl to build */
    extern const BSL_Config BSLConfig;
    extern const BCR_Config BCRConfig;
    
    /* clang-format on */
    
    #endif /* boot_config_h */
    

  • I'll be out of pocket for the next several hours.

  • Those files have the BSL pin enabled. That is how I am testing the boot loader right now. I can recompile without the BSL pin enable later this afternoon. 

  • Hi Barry,
    I'll evaluate this files with our expert. I'll let you know if there is something wrong with them.

    Best Regards,

    Diego Abad

  • Hi Barry,
    After looking at the boot_config.c file, the only thing I notice is the lack of NRST. Nevertheless, here's the expert's comments on this:

    1. You'll need to set the RESETLEVEL register to 0x2

    2. Then, you'll need to set RESETCMD to 0xE4000001

    By doing this, you should be able to enter BSL. However, there is a chance this method won't work (currently there is an issue with this method where there is a chance it doesn't invoke BSL.) If that's the case, there isn't other thing to try. We'll be working in fixing this issue/finding a workaround.

    Best Regards,

    Diego Abad