Dear Sirs,
I tried to Read the Status Register (RDSR) of the SPI flash on DR1174 carrier board.
(In order to try the SPI interface, I did not use the flash memory API)
However, I can not get the correct response.
Attached below are my procedures.
vAHI_SpiConfigure(0, FALSE, FALSE, FALSE, 16, FALSE, FALSE);
vAHI_SpiSelect(1);
vAHI_SpiStartTransfer8(0x05); // RDSR
vAHI_SpiWaitBusy();
u32Data = u32AHI_SpiReadTransfer32();
vAHI_SpiSelect(0);
DBG_vPrintf(TRUE, "u32Data=0x%08x\n", u32Data);
Why is the output value of u32Data becoming 0x000005ff?
Thanks!
Solved! Go to Solution.
Hi Alan,
vAHI_SpiSelect:
The slave-select lines are asserted immediately if “automatic slave selection” is disabled, or otherwise only during data transfers. The number of valid bits in u8SlaveMask depends on the setting of u8SlaveEnable in a previous call to vAHI_SpiConfigure().
Please look at the vLcdSendCommand_ST7565() routine, and how it is sending the SPI command. LCD_Driver.c
Regards,
Mario
Hi all,
Is there any reference procedure for testing SPI interface on DR1174 carrier board?
Hi Alan,
Please look at the example driver code that we provide, the example is setting a DIO0 as Slave Select
C:\NXP\bstudio_nxp\sdk\JN-SW-4170\Platform\DK4\Source\LcdDriver.c
Be sure that you are toggling in the CS.
Regards,
Mario
Hi Mario,
Refer to LcdDriver.c, I put the below lines for test.
vAHI_SpiConfigure(0, FALSE, FALSE, FALSE, 16, FALSE, FALSE);
vAHI_SpiSelect(1);
vAHI_SpiStartTransfer8(0x05); // RDSR
vAHI_SpiWaitBusy();
u32Data = u32AHI_SpiReadTransfer32();
vAHI_SpiSelect(0);
DBG_vPrintf(TRUE, "u32Data=0x%08x\n", u32Data);
But it did not work on DR1174 carrier board with JN5169.
Is there any problem in my test?
Hi Alan,
Are you toggling the DIO? before the vAHI_SpiSelect?
PRIVATE void vLcdRSSelect(uint8 u8Status)
{
if (u8Status == 1) // ON required
{
vAHI_DioSetOutput(LCD_RS_BIT_MASK, 0);
}
else {
vAHI_DioSetOutput(0, LCD_RS_BIT_MASK);
}
}
Regards,
Mario
Dear Mario,
My test firmware is for read status register of SPI flash (M25P40) which is mounted on DR1174 carried board.
Supposed, the chip select (/SS) is toogled by vAHI_SpiSelect(1) and vAHI_SpiSelect(0).
Why can not work correctly?
Thanks
Hi Alan,
vAHI_SpiSelect:
The slave-select lines are asserted immediately if “automatic slave selection” is disabled, or otherwise only during data transfers. The number of valid bits in u8SlaveMask depends on the setting of u8SlaveEnable in a previous call to vAHI_SpiConfigure().
Please look at the vLcdSendCommand_ST7565() routine, and how it is sending the SPI command. LCD_Driver.c
Regards,
Mario