2018-10-12 10:48 AM
I generated a new cube project, included everything what nfc reader needed(like the sample project for 401), I modified the platform.h, the SPI is working, but its a bit confusing, because if I use HSI the reading is freezing in demoPollNFCA() - without any card. If I use the 072 with 48Mhz HSI the polling works fine but if i put a card in front of the reader I get a hardfault ISR..
So the ST25 init succeeded, the SPI and the interrupts are working. Maybe there is some problem with timings, (like NFC's GP or SW IT..)
Solved! Go to Solution.
2018-10-15 12:04 AM
Hi,
you are most likely hit by a limitation of the STM32F0 HAL SPI drivers: They cannot operate on non-16-bit aligned 8-bit pointers. To completely verify please set USE_FULL_ASSERT to 1...
As solution I can only recommend tweaking the HAL driver, by e.g.
<< *((uint16_t *)pRxData) = hspi->Instance->DR;
>> uint16_t temp;
>> temp = hspi->Instance->DR;
>> *((uint8_t *)pRxData) = temp & 0xff;
>> *(((uint8_t *)pRxData)+1) = temp >> 8;
This shows only receiving side, similar for sending side.
Regards, Ulysses
2018-10-15 12:04 AM
Hi,
you are most likely hit by a limitation of the STM32F0 HAL SPI drivers: They cannot operate on non-16-bit aligned 8-bit pointers. To completely verify please set USE_FULL_ASSERT to 1...
As solution I can only recommend tweaking the HAL driver, by e.g.
<< *((uint16_t *)pRxData) = hspi->Instance->DR;
>> uint16_t temp;
>> temp = hspi->Instance->DR;
>> *((uint8_t *)pRxData) = temp & 0xff;
>> *(((uint8_t *)pRxData)+1) = temp >> 8;
This shows only receiving side, similar for sending side.
Regards, Ulysses