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.

MSPM0G3507: secondary BSL - change invoke pin/deactivate GPIO invoke / change to software invoke / boot_config.c/.h

Part Number: MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Heyho!

I'm working on secondary BSL (secondary_bsl_uart_LP_MSPM0G3507_nortos_ticlang) because I want to change UART-BSL-Pins from default UART0 to UART1.

This works with my modifications in "ti_msp_dl_config.h".

Now I want to change the invoke pin/deactivate GPIO invoke / change to software invoke.

The only place where I found code to modify is the boot_config.h. (L. 63-74)

/* Defines for BSL UART and I2C interface pins */   // Werte werden im Typedef Struct BSL_Config BSLConfig gesetzt
#define DEF_UART_RXD_PAD                                                 (0x16)     // PINCM22
#define DEF_UART_RXD_MUX                                                  (0x2)     // PIN FUNCTION UART0_RX
#define DEF_UART_TXD_PAD                                                 (0x15)     // PINCM21
#define DEF_UART_TXD_MUX                                                  (0x2)     // PIN FUNCTION UART0_TX
#define DEF_I2C_SDA_PAD                                                   (0x1)
#define DEF_I2C_SDA_MUX                                                   (0x3)
#define DEF_I2C_SCL_PAD                                                   (0x2)
#define DEF_I2C_SCL_MUX                                                   (0x3)

#define DEFAULT_BSL_PIN_INVOCATION_DATA0                       ((uint8_t) 0xa8)     // 1010 1000 - BSLIVK_LVL = HIGH - BSLIVK_PAD_NUM = 40 (IOMUX PINCM register Wert)
#define DEFAULT_BSL_PIN_INVOCATION_DATA1                       ((uint8_t) 0x12)     // 0001 0010 - BSLIVK_GPIOPORT = Port A - BSLIVK_GPIOPIN = 18 -> PA18

But this is all about the default Configs.. can I nonetheless change these defines or is there any other file or location where I should do my secondary BSL invoke configurations?

And on the other side. Every time that I build my project the files "boot_config.c/.h" get re-generated in "Debug"-Folder and all my changes are lost.

How can I prevent this from happening?

Thanks a lot in advance!

Matze

  • And isn't this code in boot_config.c (Lines 80-83):

        .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,
    the same configuration like the one that I make in ti_msp_dl_config.h (Lines 49 - 56)
    #define BSL_GPIO_UART_TX_PIN (22U)      // PB6          // PINCM23      Übergangs-Config
    #define BSL_GPIO_UART_RX_PIN (23U)      // PB7          // PINCM24
    #define BSL_GPIO_UART_TX (2U)
    #define BSL_GPIO_UART_RX (2U)
    /* Definitions for UART */
    #define BSL_UART (UART1)
    #define BSL_UART_INTERRUPT_NUM (UART1_INT_IRQn)
    For me it looks like I make the same configs in two files...

  • Hi Matze,

    1. To change  UART-BSL-Pins, it is necessary to change the configuration in Flash NOMAIN region. It is recommended to adjust UART pins in sysconfig. 

    2. boot_config.c and boot_config.h file are generated by sysconfig. It is recommended to configure their content based on sysconfig. Otherwise, you may need to redefine corresponding parameters in main.c file.

    3. The content in boot_config.c/h corresponds to configuration of Flash NONMAIN, which determines what BSL interface will be chose default. The content in ti_msp_dl_config.h/c corresponds to specific peripheral configuration.

    4. For further details about BSL, refer to MSPM0 Bootloader User's Guide (ti.com)

    Regards,

    Pengfei

  • Hi Pengfei,

    and thank you for your answer!

    1. sysconfig would be my first choice to change this configuration. But sysconfig won't let me select the Pin that I need because my configuration needs UART1-pins for BSL and thus makes secondary BSL unavoidable. Furthermore the sysconfig-file generation is deactivated in this example project (secondary_bsl_uart_LP_MSPM0G3507_nortos_ticlang) as far as I know. I think by this code line in secondary_bsl.syscfg: "ProjectConfig.genDisable = true;"
    2. I was expecting that the generation of boot_config.c & .h is disabled by the above mentioned codeline: "ProjectConfig.genDisable = true;"
      1. how can I prevent these files from being overwritten/regenerated every time that I build my project?
      2. Or is there any possibility to generate these files from sysconfig with secondary bsl Pin Configuration and without overwriting all the other secondary BSL configurations?
      3. What do you mean by "redefine corresponding parameters in main.c file" ?
    3. Just to make sure I understand you correctly:
      1. You recommend to make all changes concerning secondary BSL Config in boot_config.c & .h?
      2. I was recommended to change the BSL UART settings in "ti_msp_dl_config.h" by Luke Ledbetter in my previous support request MSPM0G3507: BSL, LIN, UART0 - overlapping pin selections where he writes:
        1. "In ti_msp_dl_config.h change lines 48-59 to be for your UART configuration."
      3. So which solution should I chose?
      4. Or do I have to make my configuration changes in both files?
    4. Thanks, I already know this document and found many useful pieces of information in it. But it seems like the in-depth special features are not completely covered by this document. Which is okay because you, the TI-Supporters, are very helpful and supportive Slight smile

    Thanks and regards

    Matze

  • Hi Matze,

    1,2. For disable the generation of boot_config.c/h files, follow the instruction below. If the generation of these files is enabled, CCS will delete the original file firstly and generate new file according to configuration. 

    3. If  UART0 is work for you, you could just modify boot_config.c/h only to choose you desired pin. If you want to use UART1/2 as interface, a secondary boot is necessary for you to change UART interface configuration. The configuration about UART in boot_config.c/h is not valid because the invocation of secondary BSL routine. And the interface will be configured in ti_msp_dl_config.c/h file. 

    So according to your requirement, you need to change ti_msp_dl_config.c/h file only for UART configuration.

    Hope it will be helpful to you!

    Best regards,

    Pengfei

  • Hi and thanks Pengfei,

    1.,2.: Ah, okay.. I thought this would have no effect because sysconfig generation is disabled anyway.

    3. Yes I need UART1 for BSL because UART0 is needed for LIN. But how can I get the bsl invoke pin configuration away from PA18 respectively fully deactivate GPIO bsl invoke and exclusively activate/use software bsl invoke? I need PA18 for my BSL UART1_RX but it is occupied by default GPIO bsl invoke pin function.

    Thanks a lot for your help and the background information about why to use/modify "ti_msp_dl_config.c/h" instead of "boot_config.c/h".

    Regards,

    Matze

  • Hi Matze,

    1. Not really. The sentence "ProjectConfig.genDisable = true;" seems only have impact on the startup and linker file generation. And this will prevent us from checking the box below. But the boot_config.c & h will still be generated every time you built the project. The way to disable their generation is shown in my last reply.

    2. Is software bsl invoke necessary to you? Or you just want to disable the invoke function of PA18 because of  UART1_RX occupied. Actually if you just want to use PA18 for other function, you could choose another GPIO invoke pin by:

    Regards,

    Pengfei

  • Hi and thanks Pengfei,

    1. okay, noted, thanks!
    2. Yes my device is only connected to the bsl host by 3 wires - UART RX, TX, GND. So I can't use GPIO bsl invoke for my firmware-update from host to target.
    3. As I don't use SysConfig generation because it is deactivated - how and in which sourcefile can I change to another GPIO bsl invoke pin respetively deactivate GPIO bsl invoke and activate/use software bsl invoke?

    Thanks and regards,

    Matze

  • Hi Matze,

    1. Disable GPIO BSL invoke:

    To disable GPIO BSL invoke, you need to change BSL_PIN_INVOKE filed in BOOTCFG1 register of NONMAIN. In source file aspect, it is line 52 of boot_config.c file (secondary_bsl_uart_LP_MSPM0G3507_nortos_ticlang example). And attention, CRC need to be calculated according to the register value above. 

    2. Change GPIO BSL pin:

    Remain GPIO BSL invoke enabled, and change line 73-74 of boot_config.h file. Attention, CRC in boot_config.c need to be calculated according to the change of BSL invoke pin. 

    Because any modification of NONMAIN need to re-calculate the CRC register value, and if the value is not correct, it will generate ERROR and even make MCU to be lock. So we recommend you to generate boot_config.c & h by sysconfig firstly. And if you want to adjust these two file later, you could then close the generation bottom. 

    3. Software/application request BSL invoke:

    You could refer to bsl_software_invoke_app_demo_uart_LP_MSPM0G3507_nortos_ticlang example. And read the README.md file for software BSL progress. As PA18 is reused for other function in you situation, you need to disable GPIO invoke function (according to step 1) firstly.

    Regards,

    Pengfei

  • Hi Matze,

    Is there any other problem of this thread? I will close this thread firstly and you could restart it if you have any other questions.

    Regards,

    Pengfei