I’m working with an MSP432E401Y processor development kit (MSP-EXP432E401Y) from Texas Instruments. The processor is an Arm Cortex M4F. The core FreeRTOSv202012.00 works well adapted from a TI sample project, and I’ve written an Ethernet driver for the board that can send and receive packets. The Ethernet interrupts work and I’ve verified with a debugger that none of the FreeRTOS Assert traps are causing entry into an infinite debugging loop. The processor speed is 120 MHz and is clocked from the default 25 MHz crystal. The compiler is the CCS TI compiler, not gcc.
However, once the prvIPTask is started, and a few seconds after the xSendEventStructToIPTask() is called, the processor crashes. After commenting out the xSendEventStructToIPTask(), the processor still continues to run. I’ve also set up another task to blink an LED and the LED stops blinking when the processor crashes. The debugger loses contact with the processor. I think that the stack size is adequate for this processor and to ensure that the task can run. Here are the defines being used. heap_4.c is being used along with BufferAllocation_2.c.
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 100 )
#define configCPU_CLOCK_HZ ( ( unsigned long ) 120000000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
#define configTOTAL_HEAP_SIZE ((size_t) 0x30000)
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 100 )
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 15
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configUSE_PREEMPTION 1
#define configUSE_TIME_SLICING 0
#define configUSE_TICKLESS_IDLE 0
Note that to debug the problem, I’ve turned off tickless idle (since tickless idle never worked well with interrupts) and I’ve turned off configUSE_PORT_OPTIMISED_TASK_SELECTION to ensure that the C code is used rather than the optimized task selection code for the port. This does not change the crash behavior.
Switching to BufferAllocation_1.c, the crash occurs after roughly 30 seconds, leading me to believe that this is a memory issue.
In the vReleaseNetworkBufferAndDescriptor() function in the BufferAllocation1.c file, I had to add the following line:
if(pxNetworkBuffer == NULL) return;
After adding this line, the crashes stop. However, the crashes still occur when using BufferAllocation_2.c and I am still uncertain what could cause this. I am thinking that this is an issue with a NULL pointer, and it could be compiler-related as well.