Tool/software:
Hi
i have come across the issue that flashing the MSPM0G3107 MCU from within the CCS Theia (v20.1.0.6__1.7.0) via the Segger JLink programmer is not always working.
This is happening to me on a somewhat regular basis now and with several (identical custom) boards. the same behavior has already been observed in some older versions of the IDE
The result looks like depicted below
so apparently the fault is somehow related to the programming of the Nonmain section (which indeed is part of the to be generated binary and which i know to be effectively all default values except for the BSL invoke pin as that at default would lead to issues in our application....)
This behavior goes hand in hand with the flashing attempt taking in the order of a minuate instead of several seconds at most.
My current workaround is to flash a known working binaryfile (with the same nonmain contents though) via the Jflash programming tool and then pave over with the IDE
(When i talk about flashing through the IDE i actually mean flash and start debug session....)
my launch config looks like this
{ "version": "0.2.0", "configurations": [ { "name": "MCUCode", "type": "ccs-debug", "request": "launch", "projectInfo": { "name": "MCUCode", "resourceId": "/MCUCode" } } ] }
my target configuration is setup like this
my working jlink configuration is setup like this (gotta be stored as a .jflash file attachment upload did not seem to work for me)
AppVersion = 79611 FileVersion = 2 [GENERAL] aATEModuleSel[24] = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ConnectMode = 0 CurrentFile = "C:\Users\pbendema\OneDrive - Clarios\Dokumente - Clarios Li-ION 12V LISB battery - LISB III\06_Product_Engineering\07_Software\Releases\Staging Releases\SW_BSample_105_23012025_1804_55c737d5.elf" DataFileSAddr = 0x00000000 GUIMode = 0 HostName = "" TargetIF = 1 USBPort = 0 USBSerialNo = 0x00000000 UseATEModuleSelection = 0 [JTAG] IRLen = 0 MultipleTargets = 0 NumDevices = 0 Speed0 = 4000 Speed1 = 4000 TAP_Number = 0 UseAdaptive0 = 0 UseAdaptive1 = 0 UseMaxSpeed0 = 0 UseMaxSpeed1 = 0 [CPU] NumInitSteps = 1 InitStep0_Action = "Reset" InitStep0_Value0 = 0x00000000 InitStep0_Value1 = 0x00000000 InitStep0_Comment = "Reset and halt target" NumExitSteps = 0 UseScriptFile = 0 ScriptFile = "" RAMAddr = 0x20200000 RAMSize = 0x00008000 CheckCoreID = 1 CoreID = 0x0BB11477 CoreIDMask = 0x0F000FFF UseAutoSpeed = 0x00000001 ClockSpeed = 0x00000000 EndianMode = 0 ChipName = "TI MSPM0G3107" [FLASH] NumBanks = 2 [FLASH0] aRangeSel[1] = 0-127 BankName = "Internal flash" BankSelMode = 1 BaseAddr = 0x00000000 [FLASH1] aRangeSel[1] = 0 BankName = "NONMAIN" BankSelMode = 1 BaseAddr = 0x41C00000 [PRODUCTION] AutoPerformsDisconnect = 1 AutoPerformsErase = 1 AutoPerformsProgram = 1 AutoPerformsSecure = 0 AutoPerformsStartApp = 1 AutoPerformsVerify = 1 EnableFixedVTref = 0 EnableTargetPower = 0 EraseType = 1 FixedVTref = 0x00000CE4 MonitorVTref = 0 MonitorVTrefMax = 0x0000157C MonitorVTrefMin = 0x000003E8 OverrideTimeouts = 0 ProgramSN = 0 SerialFile = "" SNAddr = 0x00000000 SNInc = 0x00000001 SNLen = 0x00000004 SNListFile = "" SNValue = 0x00000001 StartAppType = 0 TargetPowerDelay = 0x00000014 TimeoutErase = 0x00003A98 TimeoutProgram = 0x00002710 TimeoutVerify = 0x00002710 VerifyType = 1 [PERFORMANCE] DisableSkipBlankDataOnProgram = 0x00000000 PerfromBlankCheckPriorEraseChip = 0x00000001 PerfromBlankCheckPriorEraseSelectedSectors = 0x00000001
my configured nonmain settings are (autogenerated by sysconfig tool):
PLACE_IN_MEMORY(".BCRConfig") const BCR_Config BCRConfig = { .bcrConfigID = 0x1, .debugAccess = BCR_CFG_DEBUG_ACCESS_EN, .swdpMode = BCR_CFG_SWDP_EN, .tifaMode = BCR_CFG_TIFA_EN, .bslPinInvokeEnable = BCR_CFG_BSL_PIN_INVOKE_EN, .passwordDebugLock = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE}, .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}, .passwordFactoryReset = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE}, .staticWriteProtectionMainLow = CFG_DEFAULT_VALUE, .staticWriteProtectionMainHigh = CFG_DEFAULT_VALUE, .staticWriteProtectionNonMain = BCR_CFG_NON_MAIN_STATIC_PROT_DIS, .secureBootMode = BCR_CFG_SECURE_BOOT_DIS, .userSecureAppStartAddr = CFG_DEFAULT_VALUE, .userSecureAppLength = CFG_DEFAULT_VALUE, .userSecureAppCrc = CFG_DEFAULT_VALUE, .userCfgCRC = 0x1879dac3, }; /* 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 = {CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE, CFG_DEFAULT_VALUE}, .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 = 0xFFFFU, .BSLAlternateAddr = CFG_DEFAULT_VALUE, .appRev = (uint32_t *) CFG_DEFAULT_VALUE, .securityAlert = BSL_CFG_SECURITY_IGNORE, .i2cSlaveAddress = 0x48, .userCfgCRC = 0xc46912c7, };
i have observed this issue with both sw versions that implement MCU power save modes and sw version that do not so i can rule that out as a possibility
Hi Marc,
I also test to flash a program with nonmain by CCS v20.1.0.6__1.7.0 + JLink, and it seems work well.
I think the nonmain data should be fine since it is auto generated by sysconfig.
Could I ask what modification have you made for .jflash file?
Best Regards,
Pengfei