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.

[参考译文] MSPM0C1104:MSPM0C1104问题–程序跳转到 COPY_ZERO_INIT

Guru**** 2460850 points
Other Parts Discussed in Thread: MSPM0C1104

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1483515/mspm0c1104-issue-with-mspm0c1104-program-jumps-to-copy_zero_init

器件型号:MSPM0C1104

工具与软件:

您好!

我目前正在使用 MSPM0C1104 (16引脚 SOT)微控制器开发一个项目、在执行过程中遇到问题。 我已经在我的项目中配置并启用了以下外设:

GPIO:PA0、PA2、PA6 (配置为输出)
ADC:已在应用中配置和使用
UART:配置用于通信
我已附加我的 syscfg 文件以供参考。

问题描述
执行代码时、程序意外跳转到函数 copy_zero_init。 通过调试,我发现在调用 SYSCFG_DL_init ()内的 GPIO 启用功能后立即发生这种情况。 不过、当我在单独的新工程中配置 GPIO 时、它会正常工作、这表明这个问题特定于我的当前设置。

对 copy_zero_init 的观察结果
在分析 copy_zero_init.c 文件后、它似乎负责在启动期间将全局/未初始化变量初始化为零。 这表明我的程序可能会遇到意外触发此初始化的问题。

请求协助
您能否就以下方面提供指导:

为什么在 SYSCFG_DL_init ()中启用 GPIO 后,程序执行跳转到 COPY_ZERO_INIT ?
syscfg 文件中是否存在可能导致此问题的任何潜在错误配置?
如何执行调试步骤来进一步找出根本原因?

/**
 * 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;

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    根据您的回溯、另一种描述这种情况的方法是"意外重置"。  

    在你的.syscfg 中有非常多的东西、我可能无法重建。 如果您可以单步执行  SYSCFG_DL_init ()来查看哪个函数触发该事件,这将是很有用的信息。 尝试在_c_int00_noargs 中设置断点、这将保留更多的上下文。