Recently one of our customers reported an issue when he tried to run "dspi_edma_demo" with KSDK 1.0 on K22F freedom board. He connected SPI signals between master and slave according to the demo user guide on freedom board, but the demo was not working.
I reproduced the issue on freedom and found this is due to incorrect documentation in demo user guide.
The connection table shown in demo user guide for K22F freedom board is as follows. This is not correct.
It should be the following table instead.
Master | Connects to | Slave | |||
Signal | Pin Name | Board Location | Pin Name | Board Location | |
SS | PTD0 | J6 Pin 8 | -> | PTD4 | J2 Pin 6 |
SCK | PTD1 | J6 Pin 5 | -> | PTD5 | J2 Pin 12 |
Data Out | PTD2 | J6 Pin 6 | -> | PTD7 | J2 Pin 10 |
Data In | PTD3 | J6 Pin7 | -> | PTD6 | J2 Pin 8 |
Also, the associated pin mux configuration in pin_mux.c file should be changed from the original workaround one in red to the original commented one.
void pin_mux_SPI(uint32_t instance)
{
switch(instance) {
case 0: /* SPI0 */
/* PORTD_PCR0 */
PORT_HAL_SetMuxMode(g_portBaseAddr[3],0u,kPortMuxAlt2);
//PORT_HAL_SetMuxMode(g_portBaseAddr[2],4u,kPortMuxAlt2); /*** Temporary work around until next board spin. ***/
/* PORTD_PCR3 */
PORT_HAL_SetMuxMode(g_portBaseAddr[3],3u,kPortMuxAlt2);
//PORT_HAL_SetMuxMode(g_portBaseAddr[2],5u,kPortMuxAlt2); /*** Temporary work around until next board spin. ***/
/* PORTD_PCR1 */
PORT_HAL_SetMuxMode(g_portBaseAddr[3],1u,kPortMuxAlt2);
//PORT_HAL_SetMuxMode(g_portBaseAddr[2],6u,kPortMuxAlt2); /*** Temporary work around until next board spin. ***/
/* PORTD_PCR2 */
PORT_HAL_SetMuxMode(g_portBaseAddr[3],2u,kPortMuxAlt2);
//PORT_HAL_SetMuxMode(g_portBaseAddr[2],7u,kPortMuxAlt2); /*** Temporary work around until next board spin. ***/
break;
}
}