Other Parts Discussed in Thread: BOOSTXL-EDUMKII
主题中讨论的其他器件:BOOSTXL-EDUMKII
工具/软件:TI C/C++编译器
大家好、我不知道正在发生什么、希望有人能帮助我解决这个问题。
我已经下载了两个项目、分别是 SPI_Master和 SPI_Slave。
我对接线连接进行了如下小幅更改
由于 最初 CONFIG_SPI_SLAVE_READY 使用 P6.0/2 (标头)、这是因为我需要从游戏手柄(使用 P6.0)检索数据、因此更改为 P6.1/23 (标头)。
场景1:没有连接 BOOSTXL-EDUMKII、我的 MSP432主设备和从设备都能够传输数据。 (这是正确的流程)
场景2:我连接 BOOSTXL-EDUMKII 后、SPI 不工作(不确定原因)
我添加了代码以在屏幕上显示字符串。 如下所示。 除此之外、我没有做任何更改
/*
=== MAIN_FreeRTOS.c ===
*/
#include
#ifdef __ICCARM __
#include
#endif
/* POSIX 头文件*/
#include
/* RTOS 头文件*/
#include
#include
/*驱动程序配置*/
#include
#include
#include
#include
#include "LcdDriver/Crystalfontz128x128_ST7735.h"
#include
/*图形库上下文*/
Graphics_context g_sContext;
extern void *mainThread (void *arg0);
/*以字节为单位的栈大小*/
#define THREADSTACKSIZE 1024
/*
=== main ====
*/
int main (void)
{
pthread_t 线程;
pthread_attr_t attrs;
struct sched_param primParam;
内部 REC;
/*初始化系统锁定*/
#ifdef __ICCARM __
__IAR_Initlocks();
#endif
/*调用驱动程序初始化函数*/
Board_init();
/*初始化显示*/
Crystalfontz128x128_Init();
/*设置默认屏幕方向*/
Crystalfontz128x128_SetOrientation (LCD_orientation_up);
/*初始化图形上下文*/
graphics_initContext (&g_sContext、&g_sCrystalfontz128x128、&g_sCrystalfontz128x128_funcs);
graphics_setForegroundColor (&g_sContext、graphics_color_red);
graphics_setBackgroundColor (&g_sContext、graphics_color_white);
GrContextFontSet (&g_sContext、&g_sFontFixed6x8);
graphics_clearDisplay (&g_sContext);
GRAPHICS_drawStringCenter(&g_sContext,
(INT8_t *)"测试"、
AUTO_STRING_LENGTH、
64、
30、
不透明文本);
/*使用默认值初始化属性结构*/
pthread_attr_init (atttrs);
/*设置优先级、分离状态和堆栈大小属性*/
priParam.sched_priority = 1;
retc = pthread_attr_setschedparam (&attrs、&priParam);
retc |= pthread_attr_setdetachstate (&attrs、pthread_create_detachstate);
retc |= pthread_attr_setstacksize (&attrs、THREADSTACKSIZE);
如果(retc!= 0){
/*无法设置属性*/
while (1){}
retc = pthread_create (&thread、&attrs、mainThread、NULL);
如果(retc!= 0){
/* pthread_create()失败*/
while (1){}
// retc = pthread_create (&thread、&attrs、screenThread、NULL);
// 如果(retc!= 0){
// /* pthread_create()失败*//
while (1){}
//}
/*启动 FreeRTOS 调度程序*/
vTaskStartScheduler();
}
//*************
//
//! \brief 应用程序定义的 malloc 失败挂钩
//!
//! \param none
//!
//! \无返回
//!
//
void vApplicationMallocFailedHook()
{
/*处理内存分配错误*/
while (1)
{
}
}
//*********
//
//! \brief 应用程序定义的堆栈溢出挂钩
//!
//! \param none
//!
//! \无返回
//!
//
void vApplicationStackOverflowHook (TaskHandle_t pxTask、char * pcTaskName)
{
//处理 FreeRTOS 堆栈溢出
while (1)
{
}
}