DSP281x_CodeStartBranch.asm 可以不需要吗?

DSP281x_CodeStartBranch.asm 可以不需要吗?,第1张

回复 2# 我是在纯软件仿真环境下,进行的调试,发现加不加该文件都可以执行。以前没太注意这些细节问题,只管编写应用程序,现在想弄明白:在RAM中运行时,难道不需要执行跳转指令吗?F2812在上电或复位后,如果是BOOT TO H0,指针会执行到0x3F8000;如果是BOOT TO FLASH,指针会执行到0x3F7FF6,此时需要这个汇编程序使指针从0x3F7FF6指向c_int00函数,完成c初始化,然后c_int00函数会跳转到main()函数执行应用程序,这个过程是在库文件boot.asm中执行的....但是如果在ram中运行不需要DSP281x_CodeStartBranch.asm ,也就没有跳转指令跳转至c_int00函数,没有这一步,程序指针PC如何跳到main()函数处呢?求正解

需要手动加入库文件:C:/CCStudio_v3.1/C6000/csl/lib/cslDM642.lib

/*

* 功能:CSL中cache module和timer module的使用示例

* 说明: 需要手动加入库文件:C:/CCStudio_v3.1/C6000/csl/lib/cslDM642.lib,建议到TI网站下载最新的CSL库更新,否则有些模块可能会出问题

* 设计者: 3881

* 日期: 2010-5-28

*/

#include <csl.h> //顶层应用程序模块,用于初始化CSL。

main初始化部分,分三部分代码麻烦分析,main调用,BSP部分,GUI初始化部分

<div class="blockcode"><blockquote>int main(void)

{

/* STM32F4xx HAL library initialization:

- Configure the Flash prefetch, instruction and Data caches

- Configure the Systick to generate an interrupt each 1 msec

- Set NVIC Group Priority to 4

- Global MSP (MCU Support Package) initialization

*/

HAL_Init()

/* Configure the system clock to 180 MHz */

SystemClock_Config()

BSP_Config()

/* Configure LED1 and LED3 */

BSP_LED_Init(LED1)

BSP_LED_Init(LED3)

file_isok = FatFS_Init()

/* Thread 1 definition */

osThreadDef(LED1, LED_Thread1, osPriorityNormal, 0, configMINIMAL_STACK_SIZE)

/* Thread 2 definition */

osThreadDef(LED3, LED_Thread2, osPriorityNormal, 0, configMINIMAL_STACK_SIZE)

osThreadDef(GUI_TASKID, GUI_Thread, osPriorityNormal, 0, 2048)

/* Start thread 1 */

LEDThread1Handle = osThreadCreate (osThread(LED1), NULL)

/* Start thread 2 */

LEDThread2Handle = osThreadCreate (osThread(LED3), NULL)

GUIThreadHandle = osThreadCreate (osThread(GUI_TASKID), NULL)

//init_gui()

/* Start scheduler */

osKernelStart()

/* We should never get here as control is now taken by the scheduler */

for()

}

void BSP_Config(void)

{

/* Initializes the SDRAM device */

BSP_SDRAM_Init()

/* Initialize the Touch screen */

BSP_TS_Init(800, 480)

//BSP_TS_Init(320, 240)

/* Enable the CRC Module */

__HAL_RCC_CRC_CLK_ENABLE()

__HAL_RCC_BKPSRAM_CLK_ENABLE()

/* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */

uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1

/* Set TIMx instance */

TimHandle.Instance = TIM3

/* Initialize TIM3 peripheral as follows:

+ Period = 500 - 1

+ Prescaler = ((SystemCoreClock/2)/10000) - 1

+ ClockDivision = 0

+ Counter direction = Up

*/

TimHandle.Init.Period = 500 - 1

TimHandle.Init.Prescaler = uwPrescalerValue

TimHandle.Init.ClockDivision = 0

TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP

if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK)

{

while(1)

{

}

}

/*##-2- Start the TIM Base generation in interrupt mode ####################*/

/* Start Channel1 */

if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)

{

while(1)

{

}

}

}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11916924.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存