I can not get atr by using of st's code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-09-12 05:11 AM
Hi, I am new to stm and I have STM32L053R8 - NUCLEO, I have to make a smartcard project with this.
I am using prepared code by given ST Firm and a smartcard. When I debug the code , it stucks.the code of smartcard project is
http://www.st.com/en/embedded-software/x-cube-smcard.html
I have been trying to get ATR for 1 mounth, but it stucks in code-1
I entered inside of atr_read and tried to find the problem, I think that the problem is about HAL_TIMEOUT.
is there anyone who can help me to solve this ?
I put here code that I believed the problem is linked with (code-2).
Please help me
code-1
/* Read ATR - loop until it's read */
do { atr_size = sizeof(atr_buff); } while (HAL_OK != ATR_Read(&SCInterface, atr_buff, &atr_size)); // it does not get out of herecode-2
if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_RXNE, RESET, Timeout) != HAL_OK)
{return HAL_TIMEOUT;
}
#smartcard #stm32l053r8-nucleo #stm32l053 #cube-mx- Labels:
-
STM32CubeMX
-
STM32L0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-09-12 07:09 AM
>>I have been trying to get ATR for 1 month, but it sticks in code-1
Perhaps look more critically about why this would fail or the card not respond. Look at what happens earlier, and perhaps use a different card.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-09-13 08:51 AM
Actually, I looked into the whole codes but I couldn't find out the problem for certain. It stucks in
SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_RXNE, RESET, Timeout) != HAL_OK
The project was utterly prepared by St Firms,as I shared the link of project above, and my knowledge of code is not enough to understand clearly. By the way, I tried 3 different cards but nothing changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-09-13 09:38 AM
>>The project was utterly prepared by ST
You could perhaps discuss this with your local FAE, either at your distributor, or ST office. There might be some contractors or consultants on their list specializing in smart card applications.
You'll need to rework the looping code to limit the retries, unwind, and recover when the card isn't responding as desired. Most code is provided for demonstrational purposes, and will need to be worked on to deliver a commercial solution.
>>my knowledge of code is not enough to understand clearly
You'll need to familiarize yourself with the protocol and interactions, and review the signals and responses on a logic-analyzer to better understand why the timeout might be occurring
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-09-14 08:34 AM
I think , I found the problem, the problem is that TDA8034 hasn't sent the Vcc to pin of C1(card supply). Thats why , software couln't communucate with smartcard to get the atr.
But there is a new question =)
why doesn't it send Vcc ?
Thank you for helping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-09-14 09:48 AM
Look at how the TDA8034 or equivalent part is used on EVAL boards supporting the card currently. Look at whatever pins from the STM32 are controlling it, replicate that in your design, and make sure you port the pin config code to match what you've built vs the examples.
Up vote any posts that you find helpful, it shows what's working..