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.

[参考译文] MSPM0G3107:standby0 模式下的睡眠唤醒序列实现。

Guru**** 2465890 points
Other Parts Discussed in Thread: MSPM0G3107, MSPM0G3507, SYSCONFIG

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1550285/mspm0g3107-sleep-wakeup-sequence-implementation-in-standby0-mode

器件型号:MSPM0G3107
Thread 中讨论的其他器件: MSPM0G3507SysConfig

工具/软件:

您好:

我们有使用 MSPM0G3107 开发的定制电路板。
我已在代码中实现了 RTC 从 Standby0 唤醒功能。 我在调试模式下运行代码时可以工作、但在刷写代码并对电路板进行下电上电时则不起作用。
我已经使用了 “RTC_PERIOCY_ALARM_lfosc_STANDBY_LP_MSPM0G3507_nortos_ticlang"</s>“ 演示代码作为 Standby0 的参考。

/**
 * 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 "MSPM0G350X" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.04.00.06"
 * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.04.00.06"
 * @versions {"tool":"1.22.0+3893"}
 */

/**
 * Import the modules used in this configuration.
 */
const Board         = scripting.addModule("/ti/driverlib/Board");
const GPIO          = scripting.addModule("/ti/driverlib/GPIO", {}, false);
const GPIO1         = GPIO.addInstance();
const I2C           = scripting.addModule("/ti/driverlib/I2C", {}, false);
const I2C1          = I2C.addInstance();
const MCAN          = scripting.addModule("/ti/driverlib/MCAN", {}, false);
const MCAN1         = MCAN.addInstance();
const RTC           = scripting.addModule("/ti/driverlib/RTC");
const SYSCTL        = scripting.addModule("/ti/driverlib/SYSCTL");
const SYSTICK       = scripting.addModule("/ti/driverlib/SYSTICK");
const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig");

/**
 * Write custom configuration values to the imported modules.
 */
const mux4       = system.clockTree["EXHFMUX"];
mux4.inputSelect = "EXHFMUX_XTAL";

const pinFunction3     = system.clockTree["HFCLKEXT"];
pinFunction3.inputFreq = 40;

const pinFunction4                        = system.clockTree["HFXT"];
pinFunction4.enable                       = true;
pinFunction4.HFXTStartup                  = 10;
pinFunction4.HFCLKMonitor                 = true;
pinFunction4.inputFreq                    = 40;
pinFunction4.peripheral.$assign           = "SYSCTL";
pinFunction4.peripheral.hfxInPin.$assign  = "PA5";
pinFunction4.peripheral.hfxOutPin.$assign = "PA6";

Board.peripheral.$assign          = "DEBUGSS";
Board.peripheral.swclkPin.$assign = "PA20";
Board.peripheral.swdioPin.$assign = "PA19";

GPIO1.$name                              = "IG_WAKEUP";
GPIO1.port                               = "PORTA";
GPIO1.portSegment                        = "Lower";
GPIO1.associatedPins[0].$name            = "PIN_0";
GPIO1.associatedPins[0].direction        = "INPUT";
GPIO1.associatedPins[0].ioStructure      = "SD";
GPIO1.associatedPins[0].internalResistor = "PULL_UP";
GPIO1.associatedPins[0].fastWakeEn       = true;

I2C1.basicEnableController             = true;
I2C1.basicControllerStandardBusSpeed   = "Fast";
I2C1.advAnalogGlitchFilter             = "DISABLED";
I2C1.advControllerTXFIFOTRIG           = "BYTES_1";
I2C1.intController                     = ["ARBITRATION_LOST","NACK","RXFIFO_TRIGGER","RX_DONE","TX_DONE"];
I2C1.$name                             = "I2C";
I2C1.peripheral.$assign                = "I2C0";
I2C1.peripheral.sdaPin.$assign         = "PA0";
I2C1.peripheral.sclPin.$assign         = "PA1";
I2C1.sdaPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric0";
I2C1.sdaPinConfig.hideOutputInversion  = scripting.forceWrite(false);
I2C1.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
I2C1.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
I2C1.sclPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric1";
I2C1.sclPinConfig.hideOutputInversion  = scripting.forceWrite(false);
I2C1.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
I2C1.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");

MCAN1.$name                    = "MCAN0";
MCAN1.wkupReqEnable            = true;
MCAN1.autoWkupEnable           = true;
MCAN1.emulationEnable          = true;
MCAN1.tdcEnable                = true;
MCAN1.additionalCoreConfig     = true;
MCAN1.rrfe                     = true;
MCAN1.rrfs                     = true;
MCAN1.txEventFIFOWaterMark     = 0;
MCAN1.interruptLine            = ["DL_MCAN_INTR_LINE_NUM_1"];
MCAN1.interruptLine1Flag       = ["DL_MCAN_INTR_MASK_ALL"];
MCAN1.m0interrupts             = ["DL_MCAN_MSP_INTERRUPT_LINE1"];
MCAN1.overrideRetention        = true;
MCAN1.rxFIFO0waterMark         = 0;
MCAN1.txFIFOSize               = 10;
MCAN1.enableInterrupt          = true;
MCAN1.spPercent                = 80;
MCAN1.rxFIFO0startAddr         = 8;
MCAN1.rxFIFO0size              = 5;
MCAN1.rxFIFO1startAddr         = 368;
MCAN1.rxFIFO1size              = 5;
MCAN1.rxBufStartAddr           = 600;
MCAN1.rxFIFO1ElemSize          = "DL_MCAN_ELEM_SIZE_8BYTES";
MCAN1.fdMode                   = false;
MCAN1.desiredDataRate          = 0;
MCAN1.flesa                    = 4;
MCAN1.extFiltType              = "10";
MCAN1.extFiltID1               = 270929954;
MCAN1.rxFIFO1OpMode            = "1";
MCAN1.interruptFlags           = ["DL_MCAN_INTERRUPT_RF0F","DL_MCAN_INTERRUPT_RF0L","DL_MCAN_INTERRUPT_RF0N","DL_MCAN_INTERRUPT_RF0W","DL_MCAN_INTERRUPT_RF1F","DL_MCAN_INTERRUPT_RF1L","DL_MCAN_INTERRUPT_RF1N","DL_MCAN_INTERRUPT_RF1W"];
MCAN1.stdFiltElem              = "001";
MCAN1.stdFiltType              = "00";
MCAN1.stdFiltID2               = 1803;
MCAN1.stdFiltID1               = 16;
MCAN1.extFiltElem              = "001";
MCAN1.txBufMode                = "1";
MCAN1.peripheral.$assign       = "CANFD0";
MCAN1.peripheral.rxPin.$assign = "PA27";
MCAN1.peripheral.txPin.$assign = "PA26";
MCAN1.txPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric2";
MCAN1.rxPinConfig.$name        = "ti_driverlib_gpio_GPIOPinGeneric3";

RTC.calMonth           = "8";
RTC.calYear            = 2025;
RTC.calDOW             = "5";
RTC.calHour            = 12;
RTC.calMin             = 10;
RTC.calSec             = 30;
RTC.perAlarm1Divider   = "DIVIDE_128";
RTC.enabledInterrupts  = ["INTERVAL_ALARM"];
RTC.enIntervalAlarm    = true;
RTC.peripheral.$assign = "RTC";

SYSCTL.HFCLKSource                = "HFXT";
SYSCTL.HFCLK_Freq                 = 48000000;
SYSCTL.HFCLKMonitor               = true;
SYSCTL.SYSPLL_CLK2XEn             = true;
SYSCTL.SYSPLL_CLK2XDiv            = 3;
SYSCTL.forceDefaultClkConfig      = true;
SYSCTL.MCLKSource                 = "HSCLK";
SYSCTL.CANCLKSource               = "SYSPLLCLK1";
SYSCTL.SYSPLL_Pdiv                = 1;
SYSCTL.SYSPLL_Qdiv                = 5;
SYSCTL.SYSPLL_CLK1En              = true;
SYSCTL.SYSPLL_CLK1Div             = 1;
SYSCTL.enableSYSOSCFCL            = true;
SYSCTL.enableROSC                 = true;
SYSCTL.validateClkStatus          = true;
SYSCTL.SYSPLL_CLK0Div             = 1;
SYSCTL.HSCLKSource                = "SYSPLLCLK2X";
SYSCTL.powerPolicy                = "STANDBY0";
SYSCTL.peripheral.$assign         = "SYSCTL";
SYSCTL.peripheral.roscPin.$assign = "PA2";

SYSTICK.interruptEnable = true;
SYSTICK.periodEnable    = true;
SYSTICK.systickEnable   = true;
SYSTICK.period          = 160000;

ProjectConfig.genLinker          = false;
ProjectConfig.genStartup         = false;
ProjectConfig.migrationCondition = true;

/**
 * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
 * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
 * re-solve from scratch.
 */
GPIO1.associatedPins[0].pin.$suggestSolution = "PA15";


这是我的 SysConfig 文件。
应届毕业生、

Abhijeet D.

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

    您好、

    让我先检查一下、稍后再回复您。

    此致、
    彼得