2019-10-23 09:06 PM
After migrating to Nordic-nrf52832 platform with STM32CubeExpansion_NFC5_V2.0.0, I can initialize successfully (all initialization processes can succeed), and fail to Polling Tag Detect.
Refer to the example completely for program running process
int main(void)
{
bsp_board_init(BSP_INIT_LEDS);
bsp_board_init(BSP_INIT_BUTTONS);
APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_DEFAULT_BACKENDS_INIT();
timers_init();
spiInit();
NRF_LOG_INFO("SPI example started.");
if( true != demoIni() )
{
NRF_LOG_ERROR("************ rfal NG **************");
}
while (1)
{
demoCycle();
NRF_LOG_FLUSH();
// bsp_board_led_invert(BSP_BOARD_LED_0);
nrf_delay_ms(500);
}
}
Debug Log
Democycle() didn't crash, just couldn't get the card searching result.
Solved! Go to Solution.
2019-10-25 10:00 AM
Hi,
typically Saleae can be configured to sample much faster. If your device is really limited to 2MHz, then reduce SPI to 1MHz and send me the traces.
Regards, Ulysses
2019-10-24 06:08 AM
Hi,
which voltage are you referring in the log output? How was it retrieved?
Best if you could provide a logic analyzer trace of rfalInitialize().
Regards, Ulysses
2019-10-24 08:38 PM
The voltage is init RF power 5V
rfalInitialize -> st25r3911Initialize -> st25r3911MeasureVoltage
uint8_t spiTxRx(const uint8_t *txData, uint8_t *rxData, uint16_t length)
{
uint8_t i=0;
if((NULL == txData) && (NULL == rxData))
{
return i;
}
if(length > 128)
{
return i;
}
struct rt_spi_message msg1, msg2;
if(txData != NULL)
{
if(rxData != NULL) // RX �?�空
{
msg1.send_buf = txData; // �?��?缓存
msg1.recv_buf = rx_buff;// 接收缓存
msg1.length = length;
msg1.cs_take = 1;
msg1.cs_release = 0;
msg1.next = &msg2;
msg2.send_buf = RT_NULL;
msg2.recv_buf = RT_NULL;
msg2.length = 0;
msg2.cs_take = 0;
msg2.cs_release = 1;
msg2.next = RT_NULL;
rt_spi_transfer_message(spi_dev_st25r, &msg1);
memcpy(rxData, rx_buff, length);
}
else // RX NULL
{
msg1.send_buf = txData; // �?��?缓存
msg1.recv_buf = RT_NULL;
msg1.length = length; // �?��?长度
msg1.cs_take = 1;
msg1.cs_release = 0;
msg1.next = &msg2;
msg2.send_buf = RT_NULL;
msg2.recv_buf = RT_NULL;
msg2.length = 0;
msg2.cs_take = 0;
msg2.cs_release = 1;
msg2.next = RT_NULL;
rt_spi_transfer_message(spi_dev_st25r, &msg1);
}
}
else // TX NULL
{
if(rxData != NULL) // RX �?�空
{
msg1.send_buf = RT_NULL;
msg1.recv_buf = RT_NULL;
msg1.length = 0;
msg1.cs_take = 1;
msg1.cs_release = 0;
msg1.next = &msg2;
msg2.send_buf = RT_NULL;
msg2.recv_buf = rx_buff; // 接收缓存
msg2.length = length;
msg2.cs_take = 0;
msg2.cs_release = 1;
msg2.next = RT_NULL;
rt_spi_transfer_message(spi_dev_st25r, &msg1);
memcpy(rxData, rx_buff, length);
}
}
rt_thread_mdelay(5);
return i;
}
2019-10-25 12:18 AM
Hi,
Regards, Ulysses
2019-10-25 06:33 AM
Under the same hardware platform, I can use STM32CubeExpansion_NFC5_V2.0.0 l476 example without any problem. The antenna matching is OK, and the SPI rate I have tried is useless. Delay time also tried all kinds of useless. Even if you know that the data of logic analyzer is wrong, what else can I do to improve it?
2019-10-25 10:00 AM
Hi,
typically Saleae can be configured to sample much faster. If your device is really limited to 2MHz, then reduce SPI to 1MHz and send me the traces.
Regards, Ulysses