mt6701 uart_redirect

This commit is contained in:
2025-11-10 18:05:11 +08:00
commit ae9f390667
17 changed files with 1909 additions and 0 deletions

245
.gitignore vendored Normal file
View File

@@ -0,0 +1,245 @@
# 2025/9/11 15:36 更新
# ================================
# 通用 .gitignore 模板Keil 与 Renesas 工程适用)
# 适用于 Keil MDK-ARM 以及 Renesas e² studio / CS+ 工程
# 文件中部分忽略规则为自定义,可根据项目实际需求进行调整
# ================================
# ================================
# 构建目录
# ================================
# Keil 默认构建输出目录(包含中间文件)
MDK-ARM/
# 自定义目标文件目录(如有)
Objects/
# 自定义列表文件目录(如有)
Listings/
binHEBING
# VS Code Local History插件生成目录
.history/
.lh/
**.settings
*.launch
# ================================
# Keil MDK 工程专用忽略规则
# ================================
# ================================
# 工程文件与配置
# ================================
# 用户工程选项文件(包含本地调试配置,建议忽略)
*.uvoptx
# 用户界面布局文件(如窗口位置等,需忽略)
*.uvguix.*
# # 工程配置文件(建议提交时酌情考虑)
# *.uvprojx
# 备份文件(如工程文件自动备份)
*.bak
# 交叉引用文件(编译生成)
*.crf
# 依赖文件(编译生成)
*.d
# 调试配置文件
*.scvd
# Run Time Environment 生成文件
*.rte
# Vim 临时文件
*.swp
# Vim 临时文件
*.swo
#================================
# 编译输出文件
# ================================
# 目标文件(编译生成)
*.o
# 目标文件Windows 风格)
*.obj
# ELF 格式可执行文件(含调试信息)
*.axf
# HEX 烧录文件
*.hex
# 二进制镜像文件
*.bin
# 内存映射文件(链接生成)
*.map
# 汇编列表文件(编译生成)
*.lst
# GCC 生成的可执行文件
*.elf
# 通用输出文件
*.out
# 依赖文件(自动生成)
*.d
*.dep
# ================================
# 调试与临时文件
# ================================
# 调试脚本(可能包含本地硬件配置)
*.ini
# 编译日志文件
*.log
# 调试信息临时文件
*.dbg
# 调试配置数据库
*.cdb
# Trace 调试配置文件
*.tracespec
# 数据库缓存
*.db
# Batch 脚本文件(本地配置) Keil/ARMCC 自动生成的编译批处理脚本
*.BAT
# ================================
# IDE 自动生成文件
# ================================
# 多项目工作区文件(如有)
*.uvmpw
# 旧版本依赖文件
*.dep
# 编译过程日志文件
*.plg
# J-Link 调试脚本(本地配置)
*.jlink
# 其他临时文件
# 编辑器临时文件(如 Keil 自动保存)
*.~*
# 临时文件
*.tmp
# # 常见构建输出目录
build/
/EWARM/**
**/MDK/output/**
**/MDK/output/release/**
/output/
/Debug/
/dist/
# ================================
# 通用忽略规则(补充)
# ================================
# 用户工具链配置(如 VS Code 等)
*.user
# VS Code 配置目录(如使用其他编辑器)
.vscode/
# JetBrains IDE 配置目录
.idea/
# Eclipse 配置
/.settings/
# Eclipse C 项目配置
/.cproject
# Eclipse 项目文件
/.project
# macOS 系统文件
.DS_Store
# Windows 缩略图缓存
Thumbs.db
#这是 EIDE (Embedded IDE for VSCode) 自动生成的工程上下文配置文件。
.eide.usr.ctx.json
# 这是 Clang 工具链的代码格式化配置文件。
.clang-format
# 这是 Windows 自动生成的文件,主要存储文件夹显示属性(比如自定义图标、排序方式)。
desktop.ini
# ================================
# IAR Embedded Workbench 工程文件
# ================================
# IAR 工具链文件
/*.ewt
# IAR 调试配置文件
/*.ewd
# IAR 工程文件(建议提交时酌情考虑)
/*.ewp
# IAR 工作区文件
/*.eww
# IAR 编译输出
/Obj/
# IAR 汇编清单
/Lst/
# IAR 工程局部设置
/settings/
# ================================
# CMSIS Pack / 芯片支持包
# ================================
# IDE 自动下载的芯片支持包,无需提交
/.pack/**
# ================================
# Renesas 瑞萨工程专用忽略规则
# ================================
# e² studio (Eclipse-based) IDE 配置(本地环境相关,忽略)
# Eclipse 项目本地设置
/.settings/
# Eclipse 工作区元数据
/.metadata/
# 启动/调试配置文件(本地生成)
/*.launch
# 远程调试临时文件
/RemoteSystemsTempFiles/
# CS+ (CubeSuite+) IDE 文件(自动生成或本地相关,忽略)
# 绝对路径文件
*.abs
# 编译中间文件
*.poc
# 自动生成的 include 文件
*.inc
# 工程信息文件(本地环境相关)
*.ipr
# 旧备份文件
*.org
# 系统文件
*.sys
# 构建日志
*.log
# Motorola S-Record 固件文件
*.mot
# CS+ 自动生成的编译中间文件 / 增量编译缓存
*.mtud
# Renesas Pack / Device 文件(自动下载,无需提交)
# MCU Pack 文件
*.pack
# 调试配置文件(本地机器相关)
.rlaunch
# 系统视图描述文件(自动生成)
*.scvd
# 临时 / 备份文件
# 编辑器临时文件
*~
# 备份文件
*.bak
# Vim 临时文件
*.swp
# Vim 临时文件
*.swo
# 临时文件
*.tmp
# 用户本地配置
*.user
# 数据库缓存
*.db
# 操作系统相关
# macOS Finder 缓存
.DS_Store
# Windows 缩略图缓存
Thumbs.db
# Windows 文件夹属性
desktop.ini
# 汇编源文件、源码文件和必要工程文件除外,其他产物均忽略
gcc/
iar/
ticlang/

9
3rd/delay.c Normal file
View File

@@ -0,0 +1,9 @@
#include "Delay.h"
#include "ti_msp_dl_config.h"
void delay_ms(uint16_t ms)
{
while(ms--)
{
delay_cycles(CPUCLK_FREQ / 1000);
}
}

7
3rd/delay.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef delay_h
#define delay_h
#include <stdint.h>
void delay_ms(uint16_t ms);
#endif /* ti_msp_dl_config_h */

114
3rd/mt6701.c Normal file
View File

@@ -0,0 +1,114 @@
#include "MT6701.h"
#include "ti_msp_dl_config.h"
volatile int16_t angle;
volatile float angle_f;
/* Data sent to the Target */
uint8_t gTxPacket[I2C_TX_PACKET_SIZE] =
{
0x03
};
/* Data received from Target */
volatile uint8_t gRxPacket[I2C_RX_PACKET_SIZE];
/* I2C clock configuration */
DL_I2C_ClockConfig gI2CclockConfig;
/* Frequency of selected I2C clock*/
volatile uint32_t gClockSelFreq;
/* Cycles to delay after controller transfer initiated */
volatile uint32_t gDelayCycles;
/* I2C Target address */
#define I2C_TARGET_ADDRESS (0x06)
void MT6701_iic_read_angel(void)
{
/* Get I2C clock source and clock divider to use for delay cycle calculation */
DL_I2C_getClockConfig(I2C_1_INST, &gI2CclockConfig);
switch(gI2CclockConfig.clockSel)
{
case DL_I2C_CLOCK_BUSCLK:
gClockSelFreq = 32000000;
break;
case DL_I2C_CLOCK_MFCLK:
gClockSelFreq = 4000000;
break;
default:
break;
}
/*
* Calculate number of clock cycles to delay after controller transfer initiated
* gDelayCycles = 3 I2C functional clock cycles
* gDelayCycles = 3 * I2C clock divider * (CPU clock freq / I2C clock freq)
*/
gDelayCycles = (3 * (gI2CclockConfig.divideRatio + 1)) *
(CPUCLK_FREQ / gClockSelFreq);
/*
* Fill FIFO with data. This example will send a MAX of 8 bytes since it
* doesn't handle the case where FIFO is full
*/
DL_I2C_fillControllerTXFIFO(I2C_1_INST, &gTxPacket[0], I2C_TX_PACKET_SIZE);
/* Wait for I2C to be Idle */
while(!(
DL_I2C_getControllerStatus(I2C_1_INST) & DL_I2C_CONTROLLER_STATUS_IDLE))
;
/* Send the packet to the controller.
* This function will send Start + Stop automatically.
*/
DL_I2C_startControllerTransfer(I2C_1_INST, I2C_TARGET_ADDRESS,
DL_I2C_CONTROLLER_DIRECTION_TX, I2C_TX_PACKET_SIZE);
/* Workaround for errata I2C_ERR_13 */
delay_cycles(gDelayCycles);
/* Poll until the Controller writes all bytes */
while(
DL_I2C_getControllerStatus(I2C_1_INST) & DL_I2C_CONTROLLER_STATUS_BUSY)
;
/* Trap if there was an error */
if(DL_I2C_getControllerStatus(I2C_1_INST) &
DL_I2C_CONTROLLER_STATUS_ERROR)
{
/* LED will remain high if there is an error */
__BKPT(0);
}
/* Wait for I2C to be Idle */
while(!(
DL_I2C_getControllerStatus(I2C_1_INST) & DL_I2C_CONTROLLER_STATUS_IDLE))
;
/* Add delay between transfers */
delay_cycles(1000);
/* Send a read request to Target */
DL_I2C_startControllerTransfer(I2C_1_INST, I2C_TARGET_ADDRESS,
DL_I2C_CONTROLLER_DIRECTION_RX, I2C_RX_PACKET_SIZE);
/*
* Receive all bytes from target. LED will remain high if not all bytes
* are received
*/
for(uint8_t i = 0; i < I2C_RX_PACKET_SIZE; i++)
{
while(DL_I2C_isControllerRXFIFOEmpty(I2C_1_INST))
;
gRxPacket[i] = DL_I2C_receiveControllerData(I2C_1_INST);
}
}
void MT6701_get_angle_degree(void)
{
MT6701_iic_read_angel();
angle = ((int16_t)gRxPacket[0] << 6) | (gRxPacket[1] >> 2);
angle_f = (float)angle * 360 / 16384;
}

25
3rd/mt6701.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef MT6701_H
#define MT6701_H
#include <stdint.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define I2C_TX_PACKET_SIZE (1)
/*
* Number of bytes to received from target.
* This example uses FIFO with polling, and the maximum FIFO size is 8.
* Refer to interrupt examples to handle larger packets
*/
#define I2C_RX_PACKET_SIZE (2)
void MT6701_iic_read_angel(void);
void MT6701_get_angle_degree(void);
#ifdef __cplusplus
}
#endif
#endif /* MT6701_H */

53
3rd/uart_redircet.c Normal file
View File

@@ -0,0 +1,53 @@
#include "ti_msp_dl_config.h"
#include <stdio.h>
#include <string.h>
/* ARM Compiler 6 半主机模式禁用声明 */
#if (__ARMCC_VERSION >= 6010050)
__asm(".global __use_no_semihosting\n\t");
__asm(".global __ARM_use_no_argv \n\t");
#else
#pragma import(__use_no_semihosting)
#endif
FILE __stdout;
/* 系统退出函数实现 */
void _sys_exit(int x)
{
x = x;
while (1)
; /* 死循环防止程序异常退出 */
}
/* ARM Compiler 6 printf重定向实现 */
int fputc(int c, FILE *stream)
{
/* 等待UART发送缓冲区就绪 */
while (DL_UART_Main_isBusy(UART_0_INST))
;
/* 发送字符 */
DL_UART_Main_transmitData(UART_0_INST, (uint8_t)c);
return c;
}
int fputs(const char *restrict s, FILE *restrict stream)
{
uint16_t i, len;
len = strlen(s);
for (i = 0; i < len; i++)
{
fputc(s[i], stream);
}
return len;
}
int puts(const char *_ptr)
{
int count = fputs(_ptr, stdout);
count += fputc('\n', stdout); /* 自动添加换行 */
return count;
}

7
3rd/uart_redircet.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef Uart_h
#define Uart_h
#include <stdint.h>
void UART_Console_write(const uint8_t *data, uint16_t size);
#endif /* ti_msp_dl_config_h */

30
Event.dot Normal file
View File

@@ -0,0 +1,30 @@
digraph H {
parent [
shape=plaintext
label=<
<table border='1' cellborder='1'>
<tr>
<td bgcolor="grey" port='chan_1'>Channel 1</td>
<td bgcolor="grey" port='chan_2'>Channel 2</td>
<td bgcolor="grey" port='chan_3'>Channel 3</td>
<td bgcolor="grey" port='chan_4'>Channel 4</td>
<td bgcolor="grey" port='chan_5'>Channel 5</td>
<td bgcolor="grey" port='chan_6'>Channel 6</td>
<td bgcolor="grey" port='chan_7'>Channel 7</td>
<td bgcolor="grey" port='chan_8'>Channel 8</td>
<td bgcolor="grey" port='chan_9'>Channel 9</td>
<td bgcolor="grey" port='chan_10'>Channel 10</td>
<td bgcolor="grey" port='chan_11'>Channel 11</td>
<td bgcolor="black" port='chan_12'><font color="grey">Channel 12</font></td>
<td bgcolor="black" port='chan_13'><font color="grey">Channel 13</font></td>
<td bgcolor="black" port='chan_14'><font color="grey">Channel 14</font></td>
<td bgcolor="black" port='chan_15'><font color="grey">Channel 15</font></td>
</tr>
</table>
>];
}

115
README.html Normal file

File diff suppressed because one or more lines are too long

41
README.md Normal file
View File

@@ -0,0 +1,41 @@
## Example Summary
Empty project using DriverLib.
This example shows a basic empty project using DriverLib with just main file
and SysConfig initialization.
## Peripherals & Pin Assignments
| Peripheral | Pin | Function |
| --- | --- | --- |
| SYSCTL | | |
| DEBUGSS | PA20 | Debug Clock |
| DEBUGSS | PA19 | Debug Data In Out |
## BoosterPacks, Board Resources & Jumper Settings
Visit [LP_MSPM0G3507](https://www.ti.com/tool/LP-MSPM0G3507) for LaunchPad information, including user guide and hardware files.
| Pin | Peripheral | Function | LaunchPad Pin | LaunchPad Settings |
| --- | --- | --- | --- | --- |
| PA20 | DEBUGSS | SWCLK | N/A | <ul><li>PA20 is used by SWD during debugging<br><ul><li>`J101 15:16 ON` Connect to XDS-110 SWCLK while debugging<br><li>`J101 15:16 OFF` Disconnect from XDS-110 SWCLK if using pin in application</ul></ul> |
| PA19 | DEBUGSS | SWDIO | N/A | <ul><li>PA19 is used by SWD during debugging<br><ul><li>`J101 13:14 ON` Connect to XDS-110 SWDIO while debugging<br><li>`J101 13:14 OFF` Disconnect from XDS-110 SWDIO if using pin in application</ul></ul> |
### Device Migration Recommendations
This project was developed for a superset device included in the LP_MSPM0G3507 LaunchPad. Please
visit the [CCS User's Guide](https://software-dl.ti.com/msp430/esd/MSPM0-SDK/latest/docs/english/tools/ccs_ide_guide/doc_guide/doc_guide-srcs/ccs_ide_guide.html#sysconfig-project-migration)
for information about migrating to other MSPM0 devices.
### Low-Power Recommendations
TI recommends to terminate unused pins by setting the corresponding functions to
GPIO and configure the pins to output low or input with internal
pullup/pulldown resistor.
SysConfig allows developers to easily configure unused pins by selecting **Board**→**Configure Unused Pins**.
For more information about jumper configuration to achieve low-power using the
MSPM0 LaunchPad, please visit the [LP-MSPM0G3507 User's Guide](https://www.ti.com/lit/slau873).
## Example Usage
Compile, load and run the example.

58
empty.c Normal file
View File

@@ -0,0 +1,58 @@
/*
* Copyright (c) 2021, Texas Instruments Incorporated
* All rights reserved.
*
* 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.
*/
#include "ti_msp_dl_config.h"
#include "Delay.h"
#include "MT6701.h"
#include <stdio.h>
#include <string.h>
extern float angle_f;
const float num_f = 0.123456f;
int main(void)
{
SYSCFG_DL_init();
NVIC_EnableIRQ(UART_0_INST_INT_IRQN);
while (1) {
DL_GPIO_togglePins(LED_PORT,LED_PA0_PIN);
MT6701_get_angle_degree();
delay_ms(20);
//printf("test \n");
printf("angle %.5f \n" , angle_f);
}
}

79
empty.syscfg Normal file
View File

@@ -0,0 +1,79 @@
/**
* 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-48(PT)" --product "mspm0_sdk@2.07.00.05"
* @v2CliArgs --device "MSPM0G3507" --package "LQFP-48(PT)" --product "mspm0_sdk@2.07.00.05"
* @versions {"tool":"1.25.0+4268"}
*/
/**
* Import the modules used in this configuration.
*/
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 SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
const UART = scripting.addModule("/ti/driverlib/UART", {}, false);
const UART1 = UART.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
const gate7 = system.clockTree["MFCLKGATE"];
gate7.enable = true;
GPIO1.$name = "LED";
GPIO1.associatedPins[0].$name = "PA0";
GPIO1.associatedPins[0].pin.$assign = "PA0";
const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
Board.peripheral.$assign = "DEBUGSS";
Board.peripheral.swclkPin.$assign = "PA20";
Board.peripheral.swdioPin.$assign = "PA19";
I2C1.$name = "I2C_1";
I2C1.advAnalogGlitchFilter = "DISABLED";
I2C1.basicEnableController = true;
I2C1.basicControllerStandardBusSpeed = "Fast";
I2C1.peripheral.sdaPin.$assign = "PB3";
I2C1.peripheral.sclPin.$assign = "PB2";
I2C1.sdaPinConfig.hideOutputInversion = scripting.forceWrite(false);
I2C1.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
I2C1.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
I2C1.sdaPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2";
I2C1.sclPinConfig.hideOutputInversion = scripting.forceWrite(false);
I2C1.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
I2C1.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
I2C1.sclPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3";
SYSCTL.forceDefaultClkConfig = true;
SYSCTL.peripheral.$assign = "SYSCTL";
UART1.$name = "UART_0";
UART1.rxFifoThreshold = "DL_UART_RX_FIFO_LEVEL_ONE_ENTRY";
UART1.targetBaudRate = 115200;
UART1.uartClkDiv = "8";
UART1.enableFIFO = true;
UART1.txFifoThreshold = "DL_UART_TX_FIFO_LEVEL_ONE_ENTRY";
UART1.enabledDMATXTriggers = "DL_UART_DMA_INTERRUPT_TX";
UART1.peripheral.$assign = "UART0";
UART1.peripheral.rxPin.$assign = "PA11";
UART1.peripheral.txPin.$assign = "PA10";
UART1.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0";
UART1.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1";
UART1.DMA_CHANNEL_TX.$name = "DMA_CH0";
UART1.DMA_CHANNEL_TX.addressMode = "b2f";
UART1.DMA_CHANNEL_TX.srcLength = "BYTE";
UART1.DMA_CHANNEL_TX.dstLength = "BYTE";
UART1.DMA_CHANNEL_TX.peripheral.$assign = "DMA_CH0";
const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig", {}, 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.
*/
I2C1.peripheral.$suggestSolution = "I2C1";

View File

@@ -0,0 +1,463 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
<SchemaVersion>2.1</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Targets>
<Target>
<TargetName>empty_LP_MSPM0G3507_nortos_keil</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6220000::V6.22::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>MSPM0G3507</Device>
<Vendor>Texas Instruments</Vendor>
<PackID>TexasInstruments.MSPM0G1X0X_G3X0X_DFP.1.3.1</PackID>
<PackURL>https://software-dl.ti.com/msp430/esd/MSPM0-CMSIS/MSPM0G1X0X_G3X0X/latest/exports/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IRAM2(0x20100000,0x00008000) IROM(0x00000000,0x00020000) IROM2(0x00400000,0x00020000) XRAM(0x20200000,0x00008000) XRAM2(0x20300000,0x00008000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll></FlashDriverDll>
<DeviceId></DeviceId>
<RegisterFile></RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>$$Device:MSPM0G3507$03_SVD\MSPM0G350X.svd</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<IncludePath></IncludePath>
<LibPath></LibPath>
<RegisterFilePath></RegisterFilePath>
<DBRegisterFilePath></DBRegisterFilePath>
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
<ButtonStop>0</ButtonStop>
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\Objects\</OutputDirectory>
<OutputName>empty_LP_MSPM0G3507_nortos_keil</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>cmd.exe /C "$P../../../../../../tools/keil/syscfg.bat '$P' empty.syscfg"</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopA1X>0</nStopA1X>
<nStopA2X>0</nStopA2X>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>0</AlwaysBuild>
<GenerateAssemblyFile>0</GenerateAssemblyFile>
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<DllOption>
<SimDllName>SARMCM3.DLL</SimDllName>
<SimDllArguments>-MPU</SimDllArguments>
<SimDlgDll>DARMCM1.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM0+</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments>-MPU</TargetDllArguments>
<TargetDlgDll>TARMCM1.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments>
</DllOption>
<DebugOption>
<OPTHX>
<HexSelection>1</HexSelection>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
</DebugOption>
<Utilities>
<Flash1>
<UseTargetDll>1</UseTargetDll>
<UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
<DriverSelection>0</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2></Flash2>
<Flash3></Flash3>
<Flash4></Flash4>
<pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp>
<pFcArmRoot></pFcArmRoot>
<FcArmLst>0</FcArmLst>
</Utilities>
<TargetArmAds>
<ArmAdsMisc>
<GenerateListings>0</GenerateListings>
<asHll>1</asHll>
<asAsm>1</asAsm>
<asMacX>1</asMacX>
<asSyms>1</asSyms>
<asFals>1</asFals>
<asDbgD>1</asDbgD>
<asForm>1</asForm>
<ldLst>0</ldLst>
<ldmm>1</ldmm>
<ldXref>1</ldXref>
<BigEnd>0</BigEnd>
<AdsALst>1</AdsALst>
<AdsACrf>1</AdsACrf>
<AdsANop>0</AdsANop>
<AdsANot>0</AdsANot>
<AdsLLst>1</AdsLLst>
<AdsLmap>1</AdsLmap>
<AdsLcgr>1</AdsLcgr>
<AdsLsym>1</AdsLsym>
<AdsLszi>1</AdsLszi>
<AdsLtoi>1</AdsLtoi>
<AdsLsun>1</AdsLsun>
<AdsLven>1</AdsLven>
<AdsLsxf>1</AdsLsxf>
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M0+"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
<hadIROM>1</hadIROM>
<hadIRAM>1</hadIRAM>
<hadXRAM>1</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>1</hadIROM2>
<StupSel>0</StupSel>
<useUlib>1</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
<RoSelD>0</RoSelD>
<RwSelD>5</RwSelD>
<CodeSel>0</CodeSel>
<OptFeed>0</OptFeed>
<NoZi1>0</NoZi1>
<NoZi2>0</NoZi2>
<NoZi3>0</NoZi3>
<NoZi4>0</NoZi4>
<NoZi5>0</NoZi5>
<Ro1Chk>0</Ro1Chk>
<Ro2Chk>0</Ro2Chk>
<Ro3Chk>0</Ro3Chk>
<Ir1Chk>0</Ir1Chk>
<Ir2Chk>0</Ir2Chk>
<Ra1Chk>0</Ra1Chk>
<Ra2Chk>0</Ra2Chk>
<Ra3Chk>0</Ra3Chk>
<Im1Chk>0</Im1Chk>
<Im2Chk>0</Im2Chk>
<OnChipMemories>
<Ocm1>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm1>
<Ocm2>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm2>
<Ocm3>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm3>
<Ocm4>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm4>
<Ocm5>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm5>
<Ocm6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm6>
<IRAM>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x8000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x20000</Size>
</IROM>
<XRAM>
<Type>1</Type>
<StartAddress>0x20200000</StartAddress>
<Size>0x8000</Size>
</XRAM>
<OCR_RVCT1>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT1>
<OCR_RVCT2>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT2>
<OCR_RVCT3>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x20000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
<StartAddress>0x400000</StartAddress>
<Size>0x20000</Size>
</OCR_RVCT5>
<OCR_RVCT6>
<Type>0</Type>
<StartAddress>0x20200000</StartAddress>
<Size>0x8000</Size>
</OCR_RVCT6>
<OCR_RVCT7>
<Type>0</Type>
<StartAddress>0x20300000</StartAddress>
<Size>0x8000</Size>
</OCR_RVCT7>
<OCR_RVCT8>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT8>
<OCR_RVCT9>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x8000</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>0</Type>
<StartAddress>0x20100000</StartAddress>
<Size>0x8000</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>3</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>
<Strict>0</Strict>
<EnumInt>0</EnumInt>
<PlainCh>0</PlainCh>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<wLevel>4</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<uGnu>0</uGnu>
<useXO>0</useXO>
<v6Lang>3</v6Lang>
<v6LangP>3</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>__MSPM0G3507__</Define>
<Undefine></Undefine>
<IncludePath>../;../../../../../../source/third_party/CMSIS/Core/Include;../../../../../../source;..\3rd</IncludePath>
</VariousControls>
</Cads>
<Aads>
<interw>1</interw>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<thumb>0</thumb>
<SplitLS>0</SplitLS>
<SwStkChk>0</SwStkChk>
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<ClangAsOpt>1</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads>
<LDads>
<umfTarg>0</umfTarg>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange></TextAddressRange>
<DataAddressRange></DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile>./mspm0g3507.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc>../../../../../../source/ti/driverlib/lib/keil/m0p/mspm0g1x0x_g3x0x/driverlib.a</Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
<Group>
<GroupName>Source</GroupName>
<Files>
<File>
<FileName>empty.c</FileName>
<FileType>1</FileType>
<FilePath>../empty.c</FilePath>
</File>
<File>
<FileName>empty.syscfg</FileName>
<FileType>5</FileType>
<FilePath>../empty.syscfg</FilePath>
</File>
<File>
<FileName>startup_mspm0g350x_uvision.s</FileName>
<FileType>2</FileType>
<FilePath>startup_mspm0g350x_uvision.s</FilePath>
</File>
<File>
<FileName>ti_msp_dl_config.h</FileName>
<FileType>5</FileType>
<FilePath>../ti_msp_dl_config.h</FilePath>
</File>
<File>
<FileName>ti_msp_dl_config.c</FileName>
<FileType>1</FileType>
<FilePath>../ti_msp_dl_config.c</FilePath>
</File>
<File>
<FileName>delay.c</FileName>
<FileType>1</FileType>
<FilePath>..\3rd\delay.c</FilePath>
</File>
<File>
<FileName>delay.h</FileName>
<FileType>5</FileType>
<FilePath>..\3rd\delay.h</FilePath>
</File>
<File>
<FileName>mt6701.c</FileName>
<FileType>1</FileType>
<FilePath>..\3rd\mt6701.c</FilePath>
</File>
<File>
<FileName>mt6701.h</FileName>
<FileType>5</FileType>
<FilePath>..\3rd\mt6701.h</FilePath>
</File>
<File>
<FileName>uart_redircet.c</FileName>
<FileType>1</FileType>
<FilePath>..\3rd\uart_redircet.c</FilePath>
</File>
<File>
<FileName>uart_redircet.h</FileName>
<FileType>5</FileType>
<FilePath>..\3rd\uart_redircet.h</FilePath>
</File>
</Files>
</Group>
</Groups>
</Target>
</Targets>
<RTE>
<apis/>
<components/>
<files/>
</RTE>
<LayerInfo>
<Layers>
<Layer>
<LayName>empty_LP_MSPM0G3507_nortos_keil</LayName>
<LayPrjMark>1</LayPrjMark>
</Layer>
</Layers>
</LayerInfo>
</Project>

61
keil/mspm0g3507.sct Normal file
View File

@@ -0,0 +1,61 @@
/*****************************************************************************
Copyright (C) 2024 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.
*****************************************************************************/
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x00000000 0x00020000 { ; load region size_region
ER_IROM1 0x00000000 ALIGNALL 8 0x00020000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM2 0x20200000 0x00008000 { ; RW data
.ANY (+RW +ZI)
.ANY (.ramfunc)
}
}
LR_BCR 0x41C00000 0x00000100 { ; load region size_region
BCR_CONFIG 0x41C00000 0x000000FF{
.ANY (.BCRConfig)
}
}
LR_BSL 0x41C00100 0x00000100 { ; load region size_region
BSL_CONFIG 0x41C00100 0x00000080{
.ANY (.BSLConfig)
}
}

View File

@@ -0,0 +1,252 @@
;//*****************************************************************************
;//
;// Copyright (C) 2022 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.
;//
;// MSPM0G3507 startup file
;//
;//****************************************************************************
;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
;*/
; <h> Stack Configuration
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Stack_Size EQU 0x00000100
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
__initial_sp
; <h> Heap Configuration
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Heap_Size EQU 0x00000000
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
PRESERVE8
THUMB
; Vector Table Mapped to Address 0 at Reset
AREA RESET, DATA, READONLY
EXPORT __Vectors
EXPORT __Vectors_End
EXPORT __Vectors_Size
__Vectors DCD __initial_sp ; Top of Stack
DCD Reset_Handler ; Reset Handler
DCD NMI_Handler ; NMI Handler
DCD HardFault_Handler ; Hard Fault Handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD SVC_Handler ; SVCall Handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD PendSV_Handler ; PendSV Handler
DCD SysTick_Handler ; SysTick Handler
; External Interrupts
DCD GROUP0_IRQHandler ; 1: GROUP0 interrupt handler
DCD GROUP1_IRQHandler ; 2: GROUP1 interrupt handler
DCD TIMG8_IRQHandler ; 3: TIMG8 interrupt handler
DCD UART3_IRQHandler ; 4: UART3 interrupt handler
DCD ADC0_IRQHandler ; 5: ADC0 interrupt handler
DCD ADC1_IRQHandler ; 6: ADC1 interrupt handler
DCD CANFD0_IRQHandler ; 7: CANFD0 interrupt handler
DCD DAC0_IRQHandler ; 8: DAC0 interrupt handler
DCD 0 ; 9: Reserved
DCD SPI0_IRQHandler ; 10: SPI0 interrupt handler
DCD SPI1_IRQHandler ; 11: SPI1 interrupt handler
DCD 0 ; 12: Reserved
DCD 0 ; 13: Reserved
DCD UART1_IRQHandler ; 14: UART1 interrupt handler
DCD UART2_IRQHandler ; 15: UART2 interrupt handler
DCD UART0_IRQHandler ; 16: UART0 interrupt handler
DCD TIMG0_IRQHandler ; 17: TIMG0 interrupt handler
DCD TIMG6_IRQHandler ; 18: TIMG6 interrupt handler
DCD TIMA0_IRQHandler ; 19: TIMA0 interrupt handler
DCD TIMA1_IRQHandler ; 20: TIMA1 interrupt handler
DCD TIMG7_IRQHandler ; 21: TIMG7 interrupt handler
DCD TIMG12_IRQHandler ; 22: TIMG12 interrupt handler
DCD 0 ; 23: Reserved
DCD 0 ; 24: Reserved
DCD I2C0_IRQHandler ; 25: I2C0 interrupt handler
DCD I2C1_IRQHandler ; 26: I2C1 interrupt handler
DCD 0 ; 27: Reserved
DCD 0 ; 28: Reserved
DCD AES_IRQHandler ; 29: AES interrupt handler
DCD 0 ; 30: Reserved
DCD RTC_IRQHandler ; 31: RTC interrupt handler
DCD DMA_IRQHandler ; 32: DMA interrupt handler
__Vectors_End
__Vectors_Size EQU __Vectors_End - __Vectors
AREA |.text|, CODE, READONLY
; Reset Handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
;IMPORT SystemInit
IMPORT __main
; SystemInit can be called here, but not necessary for MSPM0
;LDR R0, =SystemInit
;BLX R0
LDR R0, =__main
BX R0
ENDP
; Dummy Exception Handlers (infinite loops which can be modified)
NMI_Handler PROC
EXPORT NMI_Handler [WEAK]
B .
ENDP
HardFault_Handler\
PROC
EXPORT HardFault_Handler [WEAK]
B .
ENDP
SVC_Handler PROC
EXPORT SVC_Handler [WEAK]
B .
ENDP
PendSV_Handler PROC
EXPORT PendSV_Handler [WEAK]
B .
ENDP
SysTick_Handler PROC
EXPORT SysTick_Handler [WEAK]
B .
ENDP
Default_Handler PROC
EXPORT Default_Handler [WEAK]
EXPORT GROUP0_IRQHandler [WEAK]
EXPORT GROUP1_IRQHandler [WEAK]
EXPORT TIMG8_IRQHandler [WEAK]
EXPORT UART3_IRQHandler [WEAK]
EXPORT ADC0_IRQHandler [WEAK]
EXPORT ADC1_IRQHandler [WEAK]
EXPORT CANFD0_IRQHandler [WEAK]
EXPORT DAC0_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT UART1_IRQHandler [WEAK]
EXPORT UART2_IRQHandler [WEAK]
EXPORT UART0_IRQHandler [WEAK]
EXPORT TIMG0_IRQHandler [WEAK]
EXPORT TIMG6_IRQHandler [WEAK]
EXPORT TIMA0_IRQHandler [WEAK]
EXPORT TIMA1_IRQHandler [WEAK]
EXPORT TIMG7_IRQHandler [WEAK]
EXPORT TIMG12_IRQHandler [WEAK]
EXPORT I2C0_IRQHandler [WEAK]
EXPORT I2C1_IRQHandler [WEAK]
EXPORT AES_IRQHandler [WEAK]
EXPORT RTC_IRQHandler [WEAK]
EXPORT DMA_IRQHandler [WEAK]
GROUP0_IRQHandler
GROUP1_IRQHandler
TIMG8_IRQHandler
UART3_IRQHandler
ADC0_IRQHandler
ADC1_IRQHandler
CANFD0_IRQHandler
DAC0_IRQHandler
SPI0_IRQHandler
SPI1_IRQHandler
UART1_IRQHandler
UART2_IRQHandler
UART0_IRQHandler
TIMG0_IRQHandler
TIMG6_IRQHandler
TIMA0_IRQHandler
TIMA1_IRQHandler
TIMG7_IRQHandler
TIMG12_IRQHandler
I2C0_IRQHandler
I2C1_IRQHandler
AES_IRQHandler
RTC_IRQHandler
DMA_IRQHandler
B .
ENDP
ALIGN
; User Initial Stack & Heap
IF :DEF:__MICROLIB
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
ELSE
IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap
__user_initial_stackheap PROC
LDR R0, = Heap_Mem
LDR R1, =(Stack_Mem + Stack_Size)
LDR R2, = (Heap_Mem + Heap_Size)
LDR R3, = Stack_Mem
BX LR
ENDP
ALIGN
ENDIF
END

202
ti_msp_dl_config.c Normal file
View File

@@ -0,0 +1,202 @@
/*
* Copyright (c) 2023, Texas Instruments Incorporated
* All rights reserved.
*
* 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.
*/
/*
* ============ ti_msp_dl_config.c =============
* Configured MSPM0 DriverLib module definitions
*
* DO NOT EDIT - This file is generated for the MSPM0G350X
* by the SysConfig tool.
*/
#include "ti_msp_dl_config.h"
/*
* ======== SYSCFG_DL_init ========
* Perform any initialization needed before using any board APIs
*/
SYSCONFIG_WEAK void SYSCFG_DL_init(void)
{
SYSCFG_DL_initPower();
SYSCFG_DL_GPIO_init();
/* Module-Specific Initializations*/
SYSCFG_DL_SYSCTL_init();
SYSCFG_DL_I2C_1_init();
SYSCFG_DL_UART_0_init();
SYSCFG_DL_DMA_init();
}
SYSCONFIG_WEAK void SYSCFG_DL_initPower(void)
{
DL_GPIO_reset(GPIOA);
DL_GPIO_reset(GPIOB);
DL_I2C_reset(I2C_1_INST);
DL_UART_Main_reset(UART_0_INST);
DL_GPIO_enablePower(GPIOA);
DL_GPIO_enablePower(GPIOB);
DL_I2C_enablePower(I2C_1_INST);
DL_UART_Main_enablePower(UART_0_INST);
delay_cycles(POWER_STARTUP_DELAY);
}
SYSCONFIG_WEAK void SYSCFG_DL_GPIO_init(void)
{
DL_GPIO_initPeripheralInputFunctionFeatures(GPIO_I2C_1_IOMUX_SDA,
GPIO_I2C_1_IOMUX_SDA_FUNC, DL_GPIO_INVERSION_DISABLE,
DL_GPIO_RESISTOR_NONE, DL_GPIO_HYSTERESIS_DISABLE,
DL_GPIO_WAKEUP_DISABLE);
DL_GPIO_initPeripheralInputFunctionFeatures(GPIO_I2C_1_IOMUX_SCL,
GPIO_I2C_1_IOMUX_SCL_FUNC, DL_GPIO_INVERSION_DISABLE,
DL_GPIO_RESISTOR_NONE, DL_GPIO_HYSTERESIS_DISABLE,
DL_GPIO_WAKEUP_DISABLE);
DL_GPIO_enableHiZ(GPIO_I2C_1_IOMUX_SDA);
DL_GPIO_enableHiZ(GPIO_I2C_1_IOMUX_SCL);
DL_GPIO_initPeripheralOutputFunction(
GPIO_UART_0_IOMUX_TX, GPIO_UART_0_IOMUX_TX_FUNC);
DL_GPIO_initPeripheralInputFunction(
GPIO_UART_0_IOMUX_RX, GPIO_UART_0_IOMUX_RX_FUNC);
DL_GPIO_initDigitalOutput(LED_PA0_IOMUX);
DL_GPIO_clearPins(LED_PORT, LED_PA0_PIN);
DL_GPIO_enableOutput(LED_PORT, LED_PA0_PIN);
}
SYSCONFIG_WEAK void SYSCFG_DL_SYSCTL_init(void)
{
//Low Power Mode is configured to be SLEEP0
DL_SYSCTL_setBORThreshold(DL_SYSCTL_BOR_THRESHOLD_LEVEL_0);
DL_SYSCTL_setSYSOSCFreq(DL_SYSCTL_SYSOSC_FREQ_BASE);
/* Set default configuration */
DL_SYSCTL_disableHFXT();
DL_SYSCTL_disableSYSPLL();
DL_SYSCTL_setULPCLKDivider(DL_SYSCTL_ULPCLK_DIV_1);
DL_SYSCTL_setMCLKDivider(DL_SYSCTL_MCLK_DIVIDER_DISABLE);
}
static const DL_I2C_ClockConfig gI2C_1ClockConfig = {
.clockSel = DL_I2C_CLOCK_BUSCLK,
.divideRatio = DL_I2C_CLOCK_DIVIDE_1,
};
SYSCONFIG_WEAK void SYSCFG_DL_I2C_1_init(void) {
DL_I2C_setClockConfig(I2C_1_INST,
(DL_I2C_ClockConfig *) &gI2C_1ClockConfig);
DL_I2C_disableAnalogGlitchFilter(I2C_1_INST);
/* Configure Controller Mode */
DL_I2C_resetControllerTransfer(I2C_1_INST);
/* Set frequency to 400000 Hz*/
DL_I2C_setTimerPeriod(I2C_1_INST, 7);
DL_I2C_setControllerTXFIFOThreshold(I2C_1_INST, DL_I2C_TX_FIFO_LEVEL_EMPTY);
DL_I2C_setControllerRXFIFOThreshold(I2C_1_INST, DL_I2C_RX_FIFO_LEVEL_BYTES_1);
DL_I2C_enableControllerClockStretching(I2C_1_INST);
/* Enable module */
DL_I2C_enableController(I2C_1_INST);
}
static const DL_UART_Main_ClockConfig gUART_0ClockConfig = {
.clockSel = DL_UART_MAIN_CLOCK_BUSCLK,
.divideRatio = DL_UART_MAIN_CLOCK_DIVIDE_RATIO_8
};
static const DL_UART_Main_Config gUART_0Config = {
.mode = DL_UART_MAIN_MODE_NORMAL,
.direction = DL_UART_MAIN_DIRECTION_TX_RX,
.flowControl = DL_UART_MAIN_FLOW_CONTROL_NONE,
.parity = DL_UART_MAIN_PARITY_NONE,
.wordLength = DL_UART_MAIN_WORD_LENGTH_8_BITS,
.stopBits = DL_UART_MAIN_STOP_BITS_ONE
};
SYSCONFIG_WEAK void SYSCFG_DL_UART_0_init(void)
{
DL_UART_Main_setClockConfig(UART_0_INST, (DL_UART_Main_ClockConfig *) &gUART_0ClockConfig);
DL_UART_Main_init(UART_0_INST, (DL_UART_Main_Config *) &gUART_0Config);
/*
* Configure baud rate by setting oversampling and baud rate divisors.
* Target baud rate: 115200
* Actual baud rate: 115107.91
*/
DL_UART_Main_setOversampling(UART_0_INST, DL_UART_OVERSAMPLING_RATE_16X);
DL_UART_Main_setBaudRateDivisor(UART_0_INST, UART_0_IBRD_4_MHZ_115200_BAUD, UART_0_FBRD_4_MHZ_115200_BAUD);
/* Configure DMA Transmit Event */
DL_UART_Main_enableDMATransmitEvent(UART_0_INST);
/* Configure FIFOs */
DL_UART_Main_enableFIFOs(UART_0_INST);
DL_UART_Main_setRXFIFOThreshold(UART_0_INST, DL_UART_RX_FIFO_LEVEL_ONE_ENTRY);
DL_UART_Main_setTXFIFOThreshold(UART_0_INST, DL_UART_TX_FIFO_LEVEL_ONE_ENTRY);
DL_UART_Main_enable(UART_0_INST);
}
static const DL_DMA_Config gDMA_CH0Config = {
.transferMode = DL_DMA_SINGLE_TRANSFER_MODE,
.extendedMode = DL_DMA_NORMAL_MODE,
.destIncrement = DL_DMA_ADDR_UNCHANGED,
.srcIncrement = DL_DMA_ADDR_INCREMENT,
.destWidth = DL_DMA_WIDTH_BYTE,
.srcWidth = DL_DMA_WIDTH_BYTE,
.trigger = UART_0_INST_DMA_TRIGGER,
.triggerType = DL_DMA_TRIGGER_TYPE_EXTERNAL,
};
SYSCONFIG_WEAK void SYSCFG_DL_DMA_CH0_init(void)
{
DL_DMA_initChannel(DMA, DMA_CH0_CHAN_ID , (DL_DMA_Config *) &gDMA_CH0Config);
}
SYSCONFIG_WEAK void SYSCFG_DL_DMA_init(void){
SYSCFG_DL_DMA_CH0_init();
}

148
ti_msp_dl_config.h Normal file
View File

@@ -0,0 +1,148 @@
/*
* Copyright (c) 2023, Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* 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.
*/
/*
* ============ ti_msp_dl_config.h =============
* Configured MSPM0 DriverLib module declarations
*
* DO NOT EDIT - This file is generated for the MSPM0G350X
* by the SysConfig tool.
*/
#ifndef ti_msp_dl_config_h
#define ti_msp_dl_config_h
#define CONFIG_MSPM0G350X
#define CONFIG_MSPM0G3507
#if defined(__ti_version__) || defined(__TI_COMPILER_VERSION__)
#define SYSCONFIG_WEAK __attribute__((weak))
#elif defined(__IAR_SYSTEMS_ICC__)
#define SYSCONFIG_WEAK __weak
#elif defined(__GNUC__)
#define SYSCONFIG_WEAK __attribute__((weak))
#endif
#include <ti/devices/msp/msp.h>
#include <ti/driverlib/driverlib.h>
#include <ti/driverlib/m0p/dl_core.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* ======== SYSCFG_DL_init ========
* Perform all required MSP DL initialization
*
* This function should be called once at a point before any use of
* MSP DL.
*/
/* clang-format off */
#define POWER_STARTUP_DELAY (16)
#define CPUCLK_FREQ 32000000
/* Defines for I2C_1 */
#define I2C_1_INST I2C1
#define I2C_1_INST_IRQHandler I2C1_IRQHandler
#define I2C_1_INST_INT_IRQN I2C1_INT_IRQn
#define I2C_1_BUS_SPEED_HZ 400000
#define GPIO_I2C_1_SDA_PORT GPIOB
#define GPIO_I2C_1_SDA_PIN DL_GPIO_PIN_3
#define GPIO_I2C_1_IOMUX_SDA (IOMUX_PINCM16)
#define GPIO_I2C_1_IOMUX_SDA_FUNC IOMUX_PINCM16_PF_I2C1_SDA
#define GPIO_I2C_1_SCL_PORT GPIOB
#define GPIO_I2C_1_SCL_PIN DL_GPIO_PIN_2
#define GPIO_I2C_1_IOMUX_SCL (IOMUX_PINCM15)
#define GPIO_I2C_1_IOMUX_SCL_FUNC IOMUX_PINCM15_PF_I2C1_SCL
/* Defines for UART_0 */
#define UART_0_INST UART0
#define UART_0_INST_FREQUENCY 4000000
#define UART_0_INST_IRQHandler UART0_IRQHandler
#define UART_0_INST_INT_IRQN UART0_INT_IRQn
#define GPIO_UART_0_RX_PORT GPIOA
#define GPIO_UART_0_TX_PORT GPIOA
#define GPIO_UART_0_RX_PIN DL_GPIO_PIN_11
#define GPIO_UART_0_TX_PIN DL_GPIO_PIN_10
#define GPIO_UART_0_IOMUX_RX (IOMUX_PINCM22)
#define GPIO_UART_0_IOMUX_TX (IOMUX_PINCM21)
#define GPIO_UART_0_IOMUX_RX_FUNC IOMUX_PINCM22_PF_UART0_RX
#define GPIO_UART_0_IOMUX_TX_FUNC IOMUX_PINCM21_PF_UART0_TX
#define UART_0_BAUD_RATE (115200)
#define UART_0_IBRD_4_MHZ_115200_BAUD (2)
#define UART_0_FBRD_4_MHZ_115200_BAUD (11)
/* Defines for DMA_CH0 */
#define DMA_CH0_CHAN_ID (0)
#define UART_0_INST_DMA_TRIGGER (DMA_UART0_TX_TRIG)
/* Port definition for Pin Group LED */
#define LED_PORT (GPIOA)
/* Defines for PA0: GPIOA.0 with pinCMx 1 on package pin 1 */
#define LED_PA0_PIN (DL_GPIO_PIN_0)
#define LED_PA0_IOMUX (IOMUX_PINCM1)
/* clang-format on */
void SYSCFG_DL_init(void);
void SYSCFG_DL_initPower(void);
void SYSCFG_DL_GPIO_init(void);
void SYSCFG_DL_SYSCTL_init(void);
void SYSCFG_DL_I2C_1_init(void);
void SYSCFG_DL_UART_0_init(void);
void SYSCFG_DL_DMA_init(void);
bool SYSCFG_DL_saveConfiguration(void);
bool SYSCFG_DL_restoreConfiguration(void);
#ifdef __cplusplus
}
#endif
#endif /* ti_msp_dl_config_h */