Part Number: MSPM0C1104
Tool/software:
Hello,
I am currently working on a project using the MSPM0C1104 (16-pin SOT) microcontroller and facing an issue during execution. I have configured and enabled the following peripherals in my project:
GPIOs: PA0, PA2, PA6 (Configured as outputs)
ADC: Configured and used in the application
UART: Configured for communication
I have attached my syscfg file for reference.
Issue Description
When executing my code, the program unexpectedly jumps to the function copy_zero_init. Through debugging, I have identified that this occurs immediately after the GPIO enable function inside SYSCFG_DL_init() is called. However, when I configure GPIO in a separate new project, it functions correctly, indicating that the issue is specific to my current setup.
Observations on copy_zero_init
After analyzing the copy_zero_init.c file, it seems responsible for initializing global/uninitialized variables to zero during startup. This suggests that my program might be encountering an issue that triggers this initialization unexpectedly.
Request for Assistance
Could you please provide guidance on:
Why the program execution jumps to copy_zero_init after enabling GPIOs in SYSCFG_DL_init()?
Any potential misconfigurations in the syscfg file that might be causing this?
Debugging steps to further isolate the root cause?
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "MSPM0C110X" --part "Default" --package "SOT-16(DYY)" --product "mspm0_sdk@2.03.00.08"
* @v2CliArgs --device "MSPM0C1104" --package "SOT-16(DYY)" --product "mspm0_sdk@2.03.00.08"
* @versions {"tool":"1.22.0+3893"}
*/
/**
* Import the modules used in this configuration.
*/
const ADC12 = scripting.addModule("/ti/driverlib/ADC12", {}, false);
const ADC121 = ADC12.addInstance();
const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false);
const TIMER1 = TIMER.addInstance();
const TIMER2 = TIMER.addInstance();
const UART = scripting.addModule("/ti/driverlib/UART", {}, false);
const UART1 = UART.addInstance();
const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig");
/**
* Write custom configuration values to the imported modules.
*/
const gate3 = system.clockTree["EXCLKGATE"];
gate3.enable = true;
const pinFunction1 = system.clockTree["CLKOUT"];
pinFunction1.enable = true;
pinFunction1.peripheral.$assign = "SYSCTL";
pinFunction1.peripheral.clkOutPin.$assign = "PA22";
ADC121.$name = "ADC12_0";
ADC121.samplingOperationMode = "sequence";
ADC121.endAdd = 1;
ADC121.sampClkSrc = "DL_ADC12_CLOCK_ULPCLK";
ADC121.adcMem0chansel = "DL_ADC12_INPUT_CHAN_1";
ADC121.adcMem1chansel = "DL_ADC12_INPUT_CHAN_5";
ADC121.resolution = "DL_ADC12_SAMP_CONV_RES_12_BIT";
ADC121.adcMem0avgen = true;
ADC121.adcMem1avgen = true;
ADC121.hwNumerator = "DL_ADC12_HW_AVG_NUM_ACC_2";
ADC121.hwDenominator = "DL_ADC12_HW_AVG_DEN_DIV_BY_2";
ADC121.repeatMode = true;
ADC121.trigSrc = "DL_ADC12_TRIG_SRC_EVENT";
ADC121.adcMem1trig = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
ADC121.sampleTime0 = "125 us";
ADC121.enabledInterrupts = ["DL_ADC12_INTERRUPT_MEM1_RESULT_LOADED"];
ADC121.subChanID = 1;
ADC121.peripheral.$assign = "ADC0";
ADC121.peripheral.adcPin1.$assign = "PA26";
ADC121.peripheral.adcPin5.$assign = "PA28";
ADC121.adcPin1Config.$name = "ti_driverlib_gpio_GPIOPinGeneric1";
ADC121.adcPin1Config.enableConfig = true;
ADC121.adcPin5Config.$name = "ti_driverlib_gpio_GPIOPinGeneric0";
ADC121.adcPin5Config.enableConfig = true;
const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
Board.peripheral.$assign = "DEBUGSS";
Board.peripheral.swclkPin.$assign = "PA20";
Board.peripheral.swdioPin.$assign = "PA19";
SYSCTL.clockTreeEn = true;
TIMER1.$name = "TIMER_0";
TIMER1.timerClkPrescale = 256;
TIMER1.timerMode = "PERIODIC";
TIMER1.timerPeriod = "1 ms";
TIMER1.interrupts = ["ZERO"];
TIMER1.peripheral.$assign = "TIMG8";
TIMER2.timerMode = "PERIODIC";
TIMER2.timerPeriod = "1 ms";
TIMER2.event1PublisherChannel = 1;
TIMER2.event1ControllerInterruptEn = ["ZERO_EVENT"];
TIMER2.$name = "TIMERA0";
TIMER2.peripheral.$assign = "TIMA0";
UART1.$name = "UART_0";
UART1.parity = "EVEN";
UART1.analogGlitchFilter = "DL_UART_PULSE_WIDTH_10_NS";
UART1.enableMajorityVoting = true;
UART1.enabledInterrupts = ["BREAK_ERROR","EOT_DONE","FRAMING_ERROR","NOISE_ERROR","OVERRUN_ERROR","PARITY_ERROR","RX"];
UART1.peripheral.$assign = "UART0";
UART1.peripheral.rxPin.$assign = "PA18";
UART1.peripheral.txPin.$assign = "PA17";
UART1.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2";
UART1.txPinConfig.enableConfig = true;
UART1.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3";
ProjectConfig.migrationCondition = true;
ProjectConfig.genLinker = false;