Hello, currently i am using STM32F469 microcontroller with freertos to my system. I am using PN532 nfc reader and lvgl as the display and i want both run at the same time so i am using freertos. If i use one of them, it can be run perfectly but when both run, the nfc cannot read any card. please help, any advice or reference will much helpful
Hello @bramalka,
Welcome to the FreeRTOS Forums.
I have not used either the display or the NFC reader. However, there are a few suspects that you should look at:
- Are you using a common memory for some variables which are being access by both the devices? If so, then this might be a memory corruption issue.
- Is there timing requirement for the NFC reader? If so, then this might be the issue as the FreeRTOS scheduler might be switching between both the display and the NFC reader. It can be simply fixed by increasing the priority of the NFC reader task.
- Also, how can you be sure that the NFC reader is not working? I mean do you print out the result on the display? Or have you put a breakpoint on the reader’s output and verified the data.
Let me know if any of these points apply to you.
Also, if you don’t mind, can you tell us how are you trying to achieve this? Are you using two tasks? Are they communicating somehow? Are you using same priority? etc. The more detail the better
Thanks,
Aniruddha
-
Are you using a common memory for some variables which are being access by both the devices? If so, then this might be a memory corruption issue.
Yes, i’m using the common memory for both -
Is there timing requirement for the NFC reader? If so, then this might be the issue as the FreeRTOS scheduler might be switching between both the display and the NFC reader. It can be simply fixed by increasing the priority of the NFC reader task.
I think the library using some timing for the reading the nfc data, i will try this thank you -
Also, how can you be sure that the NFC reader is not working? I mean do you print out the result on the display? Or have you put a breakpoint on the reader’s output and verified the data.
Yes, i printout the data from the nfc, im pretty sure that the nfc is not reading the data from the card.
Im using both task together to write the nfc using a button, so they are communicating. Im using the same priority for both, but the nfc can read only if the display is off. thank you for your answer
Just giving an update, i already increasing the nfc priority but i still the same. I found out that the nfc works fine if i dont initialize the LTDC, but still cannot do both task together. If anyone knows about this pls help
Can you elaborate on this? I am asking because if the memory is being corrupted, then you might need a mutex around the common memory location.
Can you also give me a bit more info about how you are using both of the systems? Better if you can put the code in GitHub and share the link. I think that we’ll need a bit more information since this is a very broad problem and can be caused by many many things! Without more information, I believe that it’d be very hard for us to help you
Thanks
https:// github. com/bramalka/FreeRTOS-nfc-lvgl
Here is the github link
Hello,
The above link is fine but the files in the repository are empty. Or did I miss something? Can you please check the files in the repository once more?
Thanks,
Aniruddha
Sorry for the long reply, i’m sure the repository is fine in that link. I tried in different acc and same, the link is good. Can you check this link pls?
https:// github. com/bramalka/FreeRTOS_pn532_stm