Commit ae78100f authored by Reto Da Forno's avatar Reto Da Forno
Browse files

deepsleep example for msp432 added

parent 7e1549fe
<?xml version="1.0" encoding="UTF-8" ?>
<?ccsproject version="1.0"?>
<projectOptions>
<deviceVariant value="MSP432P401R"/>
<deviceFamily value="MSP432"/>
<deviceEndianness value="little"/>
<codegenToolVersion value="5.2.6"/>
<isElfFormat value="true"/>
<connection value="common/targetdb/connections/segger_j-link_connection.xml"/>
<linkerCommandFile value="msp432p401r.cmd"/>
<rts value="libc.a"/>
<createSlaveProjects value=""/>
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate_msp432,"/>
<isTargetManual value="false"/>
<origin value="/media/rdaforno/Data/svn/DualProcessorPlatform/code/application_processor/MSP432/dpp_deepsleep"/>
</projectOptions>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging">
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES./home/rdaforno/git/dpp/software/application_platforms/msp432/examples/deepsleep/targetConfigs/MSP432P401R.ccxml.SEGGER J-Link Emulator_0/CORTEX_M4_0" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot; ?&gt;&#10;&lt;PropertyValues&gt;&#10;&#10; &lt;property id=&quot;ConnectOnStartup&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;EnableInstalledBreakpoint&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;IgnoreSoftLaunchFailures&quot;&gt;&#10; &lt;curValue&gt;0&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10;&lt;/PropertyValues&gt;&#10;"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM./home/rdaforno/git/dpp/software/application_platforms/msp432/examples/deepsleep/targetConfigs/MSP432P401R.ccxml.SEGGER J-Link Emulator_0/CORTEX_M4_0" value="${build_artifact:MSP432_deepsleep}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT./home/rdaforno/git/dpp/software/application_platforms/msp432/examples/deepsleep/targetConfigs/MSP432P401R.ccxml.SEGGER J-Link Emulator_0/CORTEX_M4_0" value="MSP432_deepsleep"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:MSP432_deepsleep}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM./home/rdaforno/git/dpp/software/application_platforms/msp432/examples/deepsleep/targetConfigs/MSP432P401R.ccxml.SEGGER J-Link Emulator_0/CORTEX_M4_0" value="/home/rdaforno/git/dpp/software/application_platforms/msp432/examples/deepsleep/Debug/MSP432_deepsleep.out"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/MSP432_deepsleep"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;sourceLookupDirector&gt;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;default/&amp;gt;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#10;&amp;lt;cpuSpecificContainer cpuName=&amp;quot;SEGGER J-Link Emulator_0/CORTEX_M4_0&amp;quot;&amp;gt;&amp;#10;&amp;lt;childContainerEntry childMemento=&amp;quot;&amp;amp;lt;?xml version=&amp;amp;quot;1.0&amp;amp;quot; encoding=&amp;amp;quot;UTF-8&amp;amp;quot; standalone=&amp;amp;quot;no&amp;amp;quot;?&amp;amp;gt;&amp;amp;#10;&amp;amp;lt;project name=&amp;amp;quot;MSP432_deepsleep&amp;amp;quot; referencedProjects=&amp;amp;quot;true&amp;amp;quot;/&amp;amp;gt;&amp;amp;#10;&amp;quot; childType=&amp;quot;org.eclipse.debug.core.containerType.project&amp;quot;/&amp;gt;&amp;#10;&amp;lt;childContainerEntry childMemento=&amp;quot;&amp;amp;lt;?xml version=&amp;amp;quot;1.0&amp;amp;quot; encoding=&amp;amp;quot;UTF-8&amp;amp;quot; standalone=&amp;amp;quot;no&amp;amp;quot;?&amp;amp;gt;&amp;amp;#10;&amp;amp;lt;default/&amp;amp;gt;&amp;amp;#10;&amp;quot; childType=&amp;quot;org.eclipse.debug.core.containerType.default&amp;quot;/&amp;gt;&amp;#10;&amp;lt;childContainerEntry childMemento=&amp;quot;&amp;amp;lt;?xml version=&amp;amp;quot;1.0&amp;amp;quot; encoding=&amp;amp;quot;UTF-8&amp;amp;quot; standalone=&amp;amp;quot;no&amp;amp;quot;?&amp;amp;gt;&amp;amp;#10;&amp;amp;lt;productsSource/&amp;amp;gt;&amp;amp;#10;&amp;quot; childType=&amp;quot;com.ti.ccstudio.debug.containerType.products.source&amp;quot;/&amp;gt;&amp;#10;&amp;lt;childContainerEntry childMemento=&amp;quot;&amp;amp;lt;?xml version=&amp;amp;quot;1.0&amp;amp;quot; encoding=&amp;amp;quot;UTF-8&amp;amp;quot; standalone=&amp;amp;quot;no&amp;amp;quot;?&amp;amp;gt;&amp;amp;#10;&amp;amp;lt;deviceLibrarySource/&amp;amp;gt;&amp;amp;#10;&amp;quot; childType=&amp;quot;com.ti.ccstudio.debug.containerType.device.library.source&amp;quot;/&amp;gt;&amp;#10;&amp;lt;childContainerEntry childMemento=&amp;quot;&amp;amp;lt;?xml version=&amp;amp;quot;1.0&amp;amp;quot; encoding=&amp;amp;quot;UTF-8&amp;amp;quot; standalone=&amp;amp;quot;no&amp;amp;quot;?&amp;amp;gt;&amp;amp;#10;&amp;amp;lt;librarySource/&amp;amp;gt;&amp;amp;#10;&amp;quot; childType=&amp;quot;com.ti.ccstudio.debug.containerType.library.source&amp;quot;/&amp;gt;&amp;#10;&amp;lt;/cpuSpecificContainer&amp;gt;&amp;#10;&quot; typeId=&quot;com.ti.ccstudio.debug.containerType.cpu.specific&quot;/&gt;&#10;&lt;/sourceContainers&gt;&#10;&lt;/sourceLookupDirector&gt;&#10;"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MSP432_deepsleep</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.ti.ccstudio.core.ccsNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
inEditor=false
onBuild=false
eclipse.preferences.version=1
environment/project/com.ti.ccstudio.buildDefinitions.MSP432.Debug.1360460583/append=true
environment/project/com.ti.ccstudio.buildDefinitions.MSP432.Debug.1360460583/appendContributed=true
eclipse.preferences.version=1
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
eclipse.preferences.version=1
encoding//Debug/driverlib/MSP432P4xx/ccs/subdir_rules.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/ccs/subdir_vars.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/ewarm/subdir_rules.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/ewarm/subdir_vars.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/gcc/subdir_rules.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/gcc/subdir_vars.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/keil/subdir_rules.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/keil/subdir_vars.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/subdir_rules.mk=UTF-8
encoding//Debug/driverlib/MSP432P4xx/subdir_vars.mk=UTF-8
encoding//Debug/makefile=UTF-8
encoding//Debug/objects.mk=UTF-8
encoding//Debug/sources.mk=UTF-8
encoding//Debug/subdir_rules.mk=UTF-8
encoding//Debug/subdir_vars.mk=UTF-8
:2000000000000120750500007B0500007D0500009505000095050000950500000000000075
:20002000000000000000000000000000950500009505000000000000950500009505000058
:200040009505000095050000950500009505000095050000950500009505000095050000D0
:200060009505000095050000950500009505000095050000950500009505000095050000B0
:20008000950500009505000095050000950500009505000095050000950500009505000090
:2000A000950500009505000095050000950500009505000095050000950500009505000070
:2000C000950500009505000095050000950500009505000095050000950500009505000050
:2000E000950500009505000095050000950500009505000095050000950500009505000030
:2001000095050000950500009505000095050000950500009505000095050000950500000F
:200120009505000095050000950500009505000095050000950500009505000095050000EF
:200140005449087840F0FF0008705349002008705249087840F0FF000870514900200870B3
:200160005049087840F0FF0008704F49002008704E49087840F0FF0008704D4900200870A3
:200180004C49087840F0FF0008704B49002008704A49087840F0FF00087049490020087093
:2001A0004849087840F0FF0008704749002008704649087840F0FF00087045490020087083
:2001C0004449087840F0FF0008704349002008704249087840F0FF00087041490020087073
:2001E0004049088840F00C0008803F49002008803E49088840F0F30008802649087820F031
:20020000020008703549087820F0020008702149087820F0040008702149087840F010003C
:20022000087048F23420C0F20000401EFDD100BF00BF1B49087820F010000870704708B56C
:200240002B494FF4B5400880FFF77AFF2949086820F003000860284946F65A1008602749AF
:200260000A6840F20110104308602349002008602349086840F00400086022482249214A62
:2002800003684FF60F7018400143116030BF00BFFEE7C046044C0040024C0040054C0040DA
:2002A000034C0040244C0040224C0040254C0040234C0040444C0040424C0040454C004082
:2002C000434C0040644C0040624C0040654C0040634C0040844C0040824C0040854C004062
:2002E000834C0040244D0040224D0040264D00400C4800400400014000080140040801406D
:2003000010ED00E000000140C0005A69002A4AD05FEA000C8B071CD1830722D1102A08D392
:2003200070B4103A78C978C0103AFBD270BC103238D0042A2CD3082A05D30C2A24BF08C928
:2003400008C008C908C008C908C092072AD0920F22E00B780370491C401C521E22D08B07C2
:20036000F7D1C30714D18307D8D0121F12D308C903801B0C4380001D121FF8D20AE008C9AD
:2003800003701B0A43701B0A83701B0AC370001D121FF4D2121D05D00B780370491C401CD3
:2003A000521EF9D1604670471448B0B5B0F1FF3F01D000F0B9F8124D1248A84210D01248B7
:2003C000124CA0420CD0001B083CC71054F8080F017855F821206168401C90477F1EF5D102
:2003E00000F0FCF80A4D0B4CA54205D002E054F8040B8047A542FAD1B0BDC046FFFFFFFF8A
:20040000F4050000FC05000004060000FC0500000000000000000000F8B5844640F6FF74B7
:200420001CF8013B002210E0481B401E10F8015B7F1E01F8015BF9D103E01CF8010B01F87D
:20044000010B521C5B08082AEADA5808F5D21CF8010B1CF8015B05F00F07FF1CC5F303151C
:20046000122F45EA001508D11CF8016B300A24BF1CF8010B60F3DF16F719AC42D4D1F8BDC1
:200480004EF68851CEF2000108684FF0F00340EA034008600C4885460C4885446F460720EF
:2004A0008743BD460A486F46076000F096F800F092F8002801D0FFF777FF00F06FF801202C
:2004C00000F00EF8FEE7C04600FE0020000200001400002000BF704708B5FFF7FBFFFEE7DF
:2004E00038B50D4C0546A06820B10C48B0F1FF3F00D080470A4800688047606810B1014677
:2005000028468847206800B18047064800688047FFF7E2FF38BDC04600000020FFFFFFFF33
:200520000C00002010000020F8B506460F4D104F7388002417E0A00000EBC4003218516843
:200540009068D26852B9AF420BD00A7855F822200346491C08461946904701E0FFF7D6FEA4
:200560007388641CA4B2A342E5DCF8BDF4050000FC050000FFF784BF7047FEE706490878B1
:2005800080F00100087042F62A40C0F20A00401EFDD1F3E7FEE7C046024C00400449B1F1A6
:2005A000FF3F07BF0021081C0868091DFFF747BEFFFFFFFF0349086070470249091F08601F
:2005C0007047704710000020D0F80320C31D08461946FFF79BBE0120704770477047000070
:2005E0000035000004010080C3050033013100FFF000000019040000C9050000E005000055
:0406000000000020D6
:00000001FF
:2000000000000120510500005705000059050000710500007105000071050000000000004D
:200020000000000000000000000000007105000071050000000000007105000071050000E8
:200040007105000071050000710500007105000071050000710500007105000071050000F0
:200060007105000071050000710500007105000071050000710500007105000071050000D0
:200080007105000071050000710500007105000071050000710500007105000071050000B0
:2000A000710500007105000071050000710500007105000071050000710500007105000090
:2000C000710500007105000071050000710500007105000071050000710500007105000070
:2000E000710500007105000071050000710500007105000071050000710500007105000050
:2001000071050000710500007105000071050000710500007105000071050000710500002F
:2001200071050000710500007105000071050000710500007105000071050000710500000F
:200140004C490A786FF00C00104308704A49002008704A49087840F0FF00087048490020BC
:2001600008704849087840F0FF00087046490020087046490A786FF0180010430870444948
:200180000020087043490A786FF02000104308704149002008704149087840F0C0000870DB
:2001A0003F49002008703F49087840F0FF0008703D49002008703D490A786FF00300104395
:2001C00008703B49002008703A49087840F0FF0008703949002008703849087840F0FF0097
:2001E000087037490020087036490A886FF03000104308803449002008802149087840F0B5
:200200000100087048F23420C0F20000401EFDD100BF00BF1A49087820F001000870704758
:2002200008B52A494FF4B5400880FFF789FF2849086820F003000860264946F65A10086077
:2002400025490A6840F20110104308602149002008602249086840F0040008602048214985
:200260001F4A03684FF60F7018400143116030BF00BFFEE7044C0040024C0040054C004097
:20028000034C0040244C0040224C0040254C0040234C0040444C0040424C0040454C0040A2
:2002A000434C0040644C0040624C0040654C0040634C0040844C0040824C0040854C004082
:2002C000834C0040244D0040224D00400C48004004000140000801400408014010ED00E063
:2002E00000000140C0005A69002A4AD05FEA000C8B071CD1830722D1102A08D370B4103A22
:2003000078C978C0103AFBD270BC103238D0042A2CD3082A05D30C2A24BF08C908C008C91D
:2003200008C008C908C092072AD0920F22E00B780370491C401C521E22D08B07F7D1C307E9
:2003400014D18307D8D0121F12D308C903801B0C4380001D121FF8D20AE008C903701B0AC7
:2003600043701B0A83701B0AC370001D121FF4D2121D05D00B780370491C401C521EF9D151
:20038000604670471448B0B5B0F1FF3F01D000F0B9F8124D1248A84210D01248124CA042D1
:2003A0000CD0001B083CC71054F8080F017855F821206168401C90477F1EF5D100F0FCF87E
:2003C0000A4D0B4CA54205D002E054F8040B8047A542FAD1B0BDC046FFFFFFFFD4050000B5
:2003E000DC050000E4050000DC0500000000000000000000F8B5844640F6FF741CF8013BE2
:20040000002210E0481B401E10F8015B7F1E01F8015BF9D103E01CF8010B01F8010B521C73
:200420005B08082AEADA5808F5D21CF8010B1CF8015B05F00F07FF1CC5F30315122F45EA46
:20044000001508D11CF8016B300A24BF1CF8010B60F3DF16F719AC42D4D1F8BD4EF6885134
:20046000CEF2000108684FF0F00340EA034008600C4885460C4885446F4607208743BD465F
:200480000A486F46076000F096F800F092F8002801D0FFF777FF00F06FF8012000F00EF823
:2004A000FEE7C04600FE0020000200001400002000BF704708B5FFF7FBFFFEE738B50D4CAF
:2004C0000546A06820B10C48B0F1FF3F00D080470A4800688047606810B1014628468847A0
:2004E000206800B18047064800688047FFF7E2FF38BDC04600000020FFFFFFFF0C00002065
:2005000010000020F8B506460F4D104F7388002417E0A00000EBC400321851689068D2685D
:2005200052B9AF420BD00A7855F822200346491C08461946904701E0FFF7D6FE7388641C7B
:20054000A4B2A342E5DCF8BDD4050000DC050000FFF784BF7047FEE70649087880F001001B
:20056000087042F62A40C0F20A00401EFDD1F3E7FEE7C046024C00400449B1F1FF3F07BF33
:200580000021081C0868091DFFF74ABEFFFFFFFF0349086070470249091F086070477047D2
:1C05A00010000020D0F80320C31D08461946FFF79BBE0120704770477047000002
:2005C00000350000040100809F050033013100FFF0000000F5030000A5050000C005000002
:0405E00000000020F7
:00000001FF
/*
* Copyright (c) 2016, Swiss Federal Institute of Technology (ETH Zurich).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Author: Reto Da Forno
*/
/*
* puts the MSP432 on the DPP in a state of minimal power dissipation
* (less than 100nA)
*/
#include <msp.h>
//#define DPP_REV1
void gpio_init(void)
{
#ifdef DPP_REV1
// set all GPIOs as outputs (low)
P1DIR |= 0xFF; P1OUT = 0;
P2DIR |= 0xFF; P2OUT = 0;
P3DIR |= 0xFF; P3OUT = 0;
P4DIR |= 0xFF; P4OUT = 0;
P5DIR |= 0xFF; P5OUT = 0;
P6DIR |= 0xFF; P6OUT = 0;
P7DIR |= 0xFF; P7OUT = 0;
P8DIR |= 0xFF; P8OUT = 0;
P9DIR |= 0xFF; P9OUT = 0;
P10DIR |= 0xFF; P10OUT = 0;
PJDIR |= (BIT2 | BIT3); PJOUT = 0;
PJREN |= (BIT0 | BIT1 | BIT4 | BIT5 | BIT6 | BIT7); // pulldown for the other pins
P1DIR &= ~BIT1; // P1.1 and P10.1 must be inputs (BOLT IND lines)
P10DIR &= ~BIT1;
P1DIR &= ~BIT2; // P1.2 must be an input (UART RXD) or output high!
// let LED blink once
P2OUT |= BIT4;
__delay_cycles(100000);
P2OUT &= ~BIT4;
#else /* DPP_REV1 */
// set all GPIOs as outputs (low)
P1DIR |= ~(BIT2 | BIT3); P1OUT = 0; // UART RXD/TXD
P2DIR |= 0xFF; P2OUT = 0;
P3DIR |= 0xFF; P3OUT = 0;
P4DIR |= ~(BIT4 | BIT3); P4OUT = 0; // BOLT IND lines
P5DIR |= ~BIT5; P5OUT = 0;
P6DIR |= (BIT6 | BIT7); P6OUT = 0;
P7DIR |= 0xFF; P7OUT = 0;
P8DIR |= ~(BIT0 | BIT1); P8OUT = 0;
P9DIR |= 0xFF; P9OUT = 0;
P10DIR |= 0xFF; P10OUT = 0;
PJDIR |= ~(BIT4 | BIT5); PJOUT = 0;
// let LED blink once
P2OUT |= BIT0;
__delay_cycles(100000);
P2OUT &= ~BIT0;
#endif /* DPP_REV1 */
}
void main(void)
{
WDTCTL = WDTPW | WDTHOLD;
gpio_init();
// clear LPM bit to unlock GPIO config
PCM->CTL1 &= ~(PCM_CTL1_LOCKLPM5 | PCM_CTL1_LOCKBKUP);
// disable SVS low and high side
PSS->KEY = PSS_KEY_KEY_VAL;
PSS->CTL0 |= BIT0 | BIT8;
PSS->KEY = 0;
// go to lpm4.5
SCB->SCR |= (1 << 2);
PCM->CTL0 = (0x695A0000 | PCM_CTL0_LPMR_12 |
(PCM->CTL0 & ~(PCM_CTL0_KEY_MASK | PCM_CTL0_LPMR_MASK)));
__asm(" wfi\n");
__no_operation();
while (1);
}
//*****************************************************************************
//
// Copyright (C) 2012 - 2015 Texas Instruments Incorporated - http://www.ti.com/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// MSP432 Family Interrupt Vector Table for CGT
//
//****************************************************************************
#include <stdint.h>
/* Forward declaration of the default fault handlers. */
static void resetISR(void);
static void nmiISR(void);
static void faultISR(void);
static void defaultISR(void);
/* External declaration for the reset handler that is to be called when the */
/* processor is started */
extern void _c_int00(void);
/* Linker variable that marks the top of the stack. */
extern unsigned long __STACK_END;
/* External declarations for the interrupt handlers used by the application. */
/* To be added by user */
/* Interrupt vector table. Note that the proper constructs must be placed on this to */
/* ensure that it ends up at physical address 0x0000.0000 or at the start of */
/* the program if located at a start address other than 0. */
#pragma RETAIN(interruptVectors)
#pragma DATA_SECTION(interruptVectors, ".intvecs")
void (* const interruptVectors[])(void) =
{
(void (*)(void))((uint32_t)&__STACK_END),
/* The initial stack pointer */
resetISR, /* The reset handler */
nmiISR, /* The NMI handler */
faultISR, /* The hard fault handler */
defaultISR, /* The MPU fault handler */
defaultISR, /* The bus fault handler */
defaultISR, /* The usage fault handler */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */
defaultISR, /* SVCall handler */
defaultISR, /* Debug monitor handler */
0, /* Reserved */
defaultISR, /* The PendSV handler */
defaultISR, /* The SysTick handler */
defaultISR, /* PSS ISR */
defaultISR, /* CS ISR */
defaultISR, /* PCM ISR */
defaultISR, /* WDT ISR */
defaultISR, /* FPU ISR */
defaultISR, /* FLCTL ISR */
defaultISR, /* COMP0 ISR */
defaultISR, /* COMP1 ISR */
defaultISR, /* TA0_0 ISR */
defaultISR, /* TA0_N ISR */
defaultISR, /* TA1_0 ISR */
defaultISR, /* TA1_N ISR */
defaultISR, /* TA2_0 ISR */
defaultISR, /* TA2_N ISR */
defaultISR, /* TA3_0 ISR */
defaultISR, /* TA3_N ISR */
defaultISR, /* EUSCIA0 ISR */
defaultISR, /* EUSCIA1 ISR */
defaultISR, /* EUSCIA2 ISR */
defaultISR, /* EUSCIA3 ISR */
defaultISR, /* EUSCIB0 ISR */
defaultISR, /* EUSCIB1 ISR */
defaultISR, /* EUSCIB2 ISR */
defaultISR, /* EUSCIB3 ISR */
defaultISR, /* ADC14 ISR */
defaultISR, /* T32_INT1 ISR */
defaultISR, /* T32_INT2 ISR */
defaultISR, /* T32_INTC ISR */
defaultISR, /* AES ISR */
defaultISR, /* RTC ISR */
defaultISR, /* DMA_ERR ISR */
defaultISR, /* DMA_INT3 ISR */
defaultISR, /* DMA_INT2 ISR */
defaultISR, /* DMA_INT1 ISR */
defaultISR, /* DMA_INT0 ISR */
defaultISR, /* PORT1 ISR */
defaultISR, /* PORT2 ISR */
defaultISR, /* PORT3 ISR */
defaultISR, /* PORT4 ISR */
defaultISR, /* PORT5 ISR */
defaultISR, /* PORT6 ISR */
defaultISR, /* Reserved 41 */
defaultISR, /* Reserved 42 */
defaultISR, /* Reserved 43 */
defaultISR, /* Reserved 44 */
defaultISR, /* Reserved 45 */
defaultISR, /* Reserved 46 */
defaultISR, /* Reserved 47 */
defaultISR, /* Reserved 48 */
defaultISR, /* Reserved 49 */
defaultISR, /* Reserved 50 */
defaultISR, /* Reserved 51 */
defaultISR, /* Reserved 52 */
defaultISR, /* Reserved 53 */
defaultISR, /* Reserved 54 */
defaultISR, /* Reserved 55 */
defaultISR, /* Reserved 56 */
defaultISR, /* Reserved 57 */
defaultISR, /* Reserved 58 */
defaultISR, /* Reserved 59 */
defaultISR, /* Reserved 60 */
defaultISR, /* Reserved 61 */
defaultISR, /* Reserved 62 */
defaultISR /* Reserved 63 */
};
/* This is the code that gets called when the processor first starts execution */
/* following a reset event. Only the absolutely necessary set is performed, */
/* after which the application supplied entry() routine is called. Any fancy */
/* actions (such as making decisions based on the reset cause register, and */
/* resetting the bits in that register) are left solely in the hands of the */
/* application. */
void resetISR(void)
{
/* Jump to the CCS C Initialization Routine. */
__asm(" .global _c_int00\n"
" b.w _c_int00");
}
/* This is the code that gets called when the processor receives a NMI. This */
/* simply enters an infinite loop, preserving the system state for examination */
/* by a debugger. */
static void nmiISR(void)
{
/* Fault trap exempt from ULP advisor */
#pragma diag_push
#pragma CHECK_ULP("-2.1")
/* Enter an infinite loop. */
while(1)
{
}
#pragma diag_pop
}
/* This is the code that gets called when the processor receives a fault */
/* interrupt. This simply enters an infinite loop, preserving the system state */
/* for examination by a debugger. */
static void faultISR(void)
{
/* Fault trap exempt from ULP advisor */
#pragma diag_push
#pragma CHECK_ULP("-2.1")
/* Enter an infinite loop. */
while(1)
{
(*((volatile uint8_t *)(0x40004C02))) ^= 1; // enable LED
__delay_cycles(2000000);
}
#pragma diag_pop
}
/* This is the code that gets called when the processor receives an unexpected */
/* interrupt. This simply enters an infinite loop, preserving the system state */
/* for examination by a debugger. */
static void defaultISR(void)
{
/* Fault trap exempt from ULP advisor */
#pragma diag_push
#pragma CHECK_ULP("-2.1")
/* Enter an infinite loop. */
while(1)
{
}
#pragma diag_pop
}
/******************************************************************************
*
* Copyright (C) 2012 - 2015 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Default linker command file for Texas Instruments MSP432P401R
*
* File creation date: 2015-09-03
*
*****************************************************************************/
--retain=flashMailbox
MEMORY
{
MAIN (RX) : origin = 0x00000000, length = 0x00040000
INFO (RX) : origin = 0x00200000, length = 0x00004000
SRAM_CODE (RWX): origin = 0x01000000, length = 0x00010000
SRAM_DATA (RW) : origin = 0x20000000, length = 0x00010000
}
/* The following command line options are set as part of the CCS project. */
/* If you are building using the command line, or for some reason want to */
/* define them here, you can uncomment and modify these lines as needed. */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone. */
/* */
/* A heap size of 1024 bytes is recommended when you plan to use printf() */
/* for debug output to the console window. */
/* */
/* --heap_size=1024 */