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.

TMS570LS3137: 在使用freertos 时候 ,在主函数中可以完成dma初始化,在其他任务中无法完成dma初始化,寄存器状态可读不可写 ,When using freertos, dma initialization can be done in the main function, but cannot be done in other tasks, and the register state can be read but not written

Part Number: TMS570LS3137

亲爱的工程师你好,我在使用freertos 时候 ,在主函数中可以完成dma初始化,在其他任务中无法完成dma初始化,寄存器状态可读不可写 ,在dmaEnable 时会进入异常,

Dear engineer hello, when I use freertos, dma initialization can be completed in the main function, dma initialization cannot be completed in other tasks, register status can be read and cannot be written, and an exception will be entered in dmaEnable.

#include "stdio.h"

#include "sys_common.h"

/* 用户代码开始 (1) */
/* 包含 FreeRTOS 调度器文件 */
#include "FreeRTOS.h"
#include "os_task.h"
#include "os_semphr.h"
#include "os_queue.h"
#include "os_timer.h"

/* 包含 HET 头文件 - 系统驱动的类型、定义和函数声明 */
#include "sci.h"
#include "het.h"
#include "os_message.h"
#include "sys_common.h"
#include "system.h"
#include "esm.h"
#include "midApp.h"
#include "aocs_typedef.h"
#include "midCommon_fun.h"
#include "midTimer_fun.h"
#include "midDriver_sciDMA.h"
#include "midDriver_led.h"

/* 定义任务句柄 */
xTaskHandle xTask1Handle; //
xTaskHandle xTask2Handle; //
xTaskHandle xTask3Handle; //
xQueueHandle xQueue; // 定义队列句柄
TimerHandle_t xTimer250ms; // 定义定时器句柄

void vTask_test(void *pvParameters)
{
dmaEnable();
/* 永远运行 */
while (1)
;
}

int main(void)
{
sciInit();
hetInit();


/* 创建队列 */
xQueue = xQueueCreate(5, sizeof(QueueMessage));
if (xQueue == NULL)
{
/* 队列创建失败 */
printf("Failed to create queue\r\n");
return 1;
}

// vTask1(0);
/* 创建任务1 */
if (xTaskCreate(vTask_test, "vTask_test", 512, NULL, 50, &xTask1Handle) != pdTRUE)
{
/* 任务创建失败 */
printf("Failed to create Task1\r\n");
return 1;
}

/* 启动调度器 */
vTaskStartScheduler();

/* 永远运行 */
while (1)
;

return 0;
}