Other Parts Discussed in Thread: BOOSTXL-EDUMKII
Tool/software: TI C/C++ Compiler
Hi People, I'm new to this not sure what is happening hope there someone can help me solve it.
I've downloaded both projects freerto SPI_Master & SPI_Slave.
I make small changes of the wiring connection as below
As originally CONFIG_SPI_SLAVE_READY was using P6.0/2(header), It was because I need to retrieve data from the joystick (which was using P6.0) therefore changed to P6.1/23(header).
Scenario 1: Without attached BOOSTXL-EDUMKII, Both my MSP432 master and slave able to transmit data. (This is correct flow)
Scenario 2: Once I attached BOOSTXL-EDUMKII, SPI not working (NOT SURE WHY)
I added the code to display a string on the screen. as refer below. other than that I didn't make any changes
/* * ======== main_freertos.c ======== */ #include <stdint.h> #ifdef __ICCARM__ #include <DLib_Threads.h> #endif /* POSIX Header files */ #include <pthread.h> /* RTOS header files */ #include <FreeRTOS.h> #include <task.h> /* Driver configuration */ #include <ti/drivers/Board.h> #include <ti/devices/msp432p4xx/inc/msp.h> #include <ti/devices/msp432p4xx/driverlib/driverlib.h> #include <ti/grlib/grlib.h> #include "LcdDriver/Crystalfontz128x128_ST7735.h" #include <stdio.h> /* Graphic library context */ Graphics_Context g_sContext; extern void *mainThread(void *arg0); /* Stack size in bytes */ #define THREADSTACKSIZE 1024 /* * ======== main ======== */ int main(void) { pthread_t thread; pthread_attr_t attrs; struct sched_param priParam; int retc; /* initialize the system locks */ #ifdef __ICCARM__ __iar_Initlocks(); #endif /* Call driver init functions */ Board_init(); /* Initializes display */ Crystalfontz128x128_Init(); /* Set default screen orientation */ Crystalfontz128x128_SetOrientation(LCD_ORIENTATION_UP); /* Initializes graphics context */ 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_drawStringCentered(&g_sContext, (int8_t *)"Testing", AUTO_STRING_LENGTH, 64, 30, OPAQUE_TEXT); /* Initialize the attributes structure with default values */ pthread_attr_init(&attrs); /* Set priority, detach state, and stack size attributes */ priParam.sched_priority = 1; retc = pthread_attr_setschedparam(&attrs, &priParam); retc |= pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED); retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE); if (retc != 0) { /* failed to set attributes */ while (1) {} } retc = pthread_create(&thread, &attrs, mainThread, NULL); if (retc != 0) { /* pthread_create() failed */ while (1) {} } // retc = pthread_create(&thread, &attrs, screenThread, NULL); // if (retc != 0) { // /* pthread_create() failed */ // while (1) {} // } /* Start the FreeRTOS scheduler */ vTaskStartScheduler(); } //***************************************************************************** // //! \brief Application defined malloc failed hook //! //! \param none //! //! \return none //! //***************************************************************************** void vApplicationMallocFailedHook() { /* Handle Memory Allocation Errors */ while(1) { } } //***************************************************************************** // //! \brief Application defined stack overflow hook //! //! \param none //! //! \return none //! //***************************************************************************** void vApplicationStackOverflowHook(TaskHandle_t pxTask, char *pcTaskName) { //Handle FreeRTOS Stack Overflow while(1) { } }