In clock configuration, you have set the prescaler as 2. Does it work on other prescaler? If so, should I need to make any changes in the .c and .h files?
Hello! I am using STM32F303VCT6 discovery board, I want to use the RFID sensor and on following your steps and since I am using the STM32f3 version, on changing the include files and fixing up some minor errors when I run it, on Live Expressions I cant see the sNum string I can only see the first two that are fixed (147, 32) but the rest 3 numbers are 0 and are not updating when I bring another card? Could you help me what I can do to make this work??
@@user-seojihye71 The way I am doing it is that the main function enters in a while loop where it continually checks for the presence of an RFID card using the MFRC522_Request function. When a card is detected, it reads the card's UID using the MFRC522_Anticoll function and compares it with a pre-stored UID. If the UID matches, an LED connected to GPIO that I included as pin PA8 is turned on; otherwise, the LED is turned off. The LED connected to GPIO pin PC13 toggles state to provide feedback each time a card is detected. If no card is detected within a specified period, I am setting it to reset after a second or two. Make sure that you don't change anything in the h and c file that was provided in the video but on changing the main file like above it started working!
hello , im working on stm32MP157f-K2 and i need the rfid reader library but im not sure that the library you have provided in the video would work in my project ? any help please ?
It should work I tested this library with STM32F446RE Nucleo and STM32F411CE also, it worked! All I had to change was to edit rc522.h line1 #include "stm32f1xx_hal.h" to #include "stm32f4xx_hal.h" Lines 10-15 (According to pins settings) #define HSPI_INSTANCE &hspi1 #define MFRC522_CS_PORT GPIOA #define MFRC522_CS_PIN GPIO_PIN_4 #define MFRC522_RST_PORT GPIOB #define MFRC522_RST_PIN GPIO_PIN_0 Clock configurations does not effect but I had to set the Prescalor in SPI so that the baud rate is around 9MBit Wish you all the best
Yeah, I've already fixed it, but the value still shows as 147 32 0 0. I don't know what the problem is because the values were appearing yesterday, but today, nothing. Even when I change the RFID, it's still the same problem @@NizarMohideen
Could I have your email or something similar to send you a screenshot? Maybe you could help me identify the problem. It's really important for my project. Would you be able to do me this favor, please
If your project progressed this much far, you are very close to the completion. check the status variable in the live expression and make sure you are getting 0. // Success or error code is returned when communication #define MI_OK 0 #define MI_NOTAGERR 1 #define MI_ERR 2
This only works with global variables, i.e. declared outside of main() community.st.com/t5/stm32cubeide-mcus/getting-quot-error-target-not-available-quot-in-value-column-in/td-p/170240
I am working on a project for an airport with STM32 Nucleo. I have created many systems, each in a separate file, but I don't know how to make them work simultaneously. It is the last step, but I don't know how to do that. Have you already done that in your channel
You can keep 8MHz. It will be fine 72MHz is better because it is faster If you keep at 8MHz, you need to change the prescaler in SPI for the baud rate to be around 9MBit
Hello sir, I have a problem that need your help. The library is great but it i found that the first and the second of str[] is not fixed. My first and second of str[] is 0x70 and 0xB1 (this is the correct code), but sometime it shows 0x93 and 0x20, and then repeat with 0x70 and 0xB1 then repeat 0x93 and 0x20. I saw that your video have met the same error with me. Did you fix that or can you help me fix the bug. Btw, thanks for your tutorial and wish you all the best.
Thanks for trying my setups and codes and making it work. As for the first two values 0x93 and 0x20, they are showing up even if no cards are present. Of course, it is a bug. I am also looking for the fix I think we can get away with this for simple projects, avoiding (147) 0x93 and (32) 0x20
Hello,I face the problem (status only display 2/sNum display 147 32 0 0) ,may I know u how to fix this problem? I use stm32f103vet6 and follow the video coding, but I use mini-rc522,is code not suitable for mini-one? The project is stuck here,hope for help
@@user-seojihye71i didn’t fix this problem as well,even i change the code and use normal rc522😢 I think problem is come from board type is not compatible
If this code is generated by CubeIDE GUI, keep as it is. No need to change But You need to change the SPI Prescalor in GUI and see the the baud rate. When the baud rate in is around 9MBit, keep that corresponding Prescalor
@@NizarMohideenwhat are the factors that involves baud rate cause in my case in the mx either i get 6 or 13 as baud rates ( prescalor either 8 or 16) how can i put to 9 ?
Thank you so much such a helpful tutorial.
Thanks nice project ...🎉🎉🎉
Thanks to you
In clock configuration, you have set the prescaler as 2. Does it work on other prescaler? If so, should I need to make any changes in the .c and .h files?
If you have different clock speed, you can change the prescaler in SPI but the baud rate should be around 9MBit. No need to change .c and .h files
My status variable sometimes is 2 and sometimes is 1. It never be 0. How to fix this issue? I am using STM32F0.
It shows error reading variable how to fix? Please help
Hello! I am using STM32F303VCT6 discovery board, I want to use the RFID sensor and on following your steps and since I am using the STM32f3 version, on changing the include files and fixing up some minor errors when I run it, on Live Expressions I cant see the sNum string I can only see the first two that are fixed (147, 32) but the rest 3 numbers are 0 and are not updating when I bring another card? Could you help me what I can do to make this work??
Thanks for trying my codes.
I hope you have figured out the reason
Please make sure the rfid cards are good
i have the same problem, do you have find a solution?🙏
@@giuseppemazzocca9813 I had fixed the problem using HAL, I restructured the code and wrote it again in the main file and it started working!!
@@user-seojihye71 The way I am doing it is that the main function enters in a while loop where it continually checks for the presence of an RFID card using the MFRC522_Request function. When a card is detected, it reads the card's UID using the MFRC522_Anticoll function and compares it with a pre-stored UID. If the UID matches, an LED connected to GPIO that I included as pin PA8 is turned on; otherwise, the LED is turned off.
The LED connected to GPIO pin PC13 toggles state to provide feedback each time a card is detected. If no card is detected within a specified period, I am setting it to reset after a second or two.
Make sure that you don't change anything in the h and c file that was provided in the video but on changing the main file like above it started working!
@@devagyabudhiraja1150 Thank you so much. Thanks to you, I was able to finish the work for a long time. Thank you so much
hello , im working on stm32MP157f-K2 and i need the rfid reader library but im not sure that the library you have provided in the video would work in my project ? any help please ?
It should work
I tested this library with STM32F446RE Nucleo and STM32F411CE also, it worked!
All I had to change was to edit rc522.h
line1 #include "stm32f1xx_hal.h" to #include "stm32f4xx_hal.h"
Lines 10-15 (According to pins settings)
#define HSPI_INSTANCE &hspi1
#define MFRC522_CS_PORT GPIOA
#define MFRC522_CS_PIN GPIO_PIN_4
#define MFRC522_RST_PORT GPIOB
#define MFRC522_RST_PIN GPIO_PIN_0
Clock configurations does not effect but I had to set the Prescalor in SPI so that the baud rate is around 9MBit
Wish you all the best
hey do you think it essential that i configure the reset of thr rfid even tho that im not gonna use it ?
We have to use the reset pin.
@@NizarMohideen hey i want to know what i need to change in the main code if i want him to read any rfid card not specific ones ?
You can use the same code. It will read all rfid cards
When I click on 'resume,' the values do not change. How can I solve this?
In the debugger
Enable live expressions (Tick)
Yeah, I've already fixed it, but the value still shows as 147 32 0 0. I don't know what the problem is because the values were appearing yesterday, but today, nothing. Even when I change the RFID, it's still the same problem
@@NizarMohideen
Could I have your email or something similar to send you a screenshot? Maybe you could help me identify the problem. It's really important for my project. Would you be able to do me this favor, please
If your project progressed this much far, you are very close to the completion. check the status variable in the live expression and make sure you are getting 0.
// Success or error code is returned when communication
#define MI_OK 0
#define MI_NOTAGERR 1
#define MI_ERR 2
"I don't understand your response. They still show as 147 32 0 0."
@@NizarMohideen
Hello sir, I am currently getting "Target Not Available" when on the debug step, any part of the code or circuit I should check?
This only works with global variables, i.e. declared outside of main()
community.st.com/t5/stm32cubeide-mcus/getting-quot-error-target-not-available-quot-in-value-column-in/td-p/170240
@@NizarMohideen Thank you, I got that fixed, however I am getting value of 0 after resume when the pill is touched.
Would you please make a video to connect STM32 with a RFID Wiegand Reader. Or share some resource.
Thanks.
I am working on a project for an airport with STM32 Nucleo. I have created many systems, each in a separate file, but I don't know how to make them work simultaneously. It is the last step, but I don't know how to do that. Have you already done that in your channel
Not yet
oh okay ,can you do it please i realy need this tutorial@@NizarMohideen
why did we need to setting the clock from 8 to 72kHZ ? i dont understand why. Can someone explain for me
You can keep 8MHz. It will be fine
72MHz is better because it is faster
If you keep at 8MHz, you need to change the prescaler in SPI for the baud rate to be around 9MBit
thanks to @@NizarMohideen, I appreciated about this
Hello sir, I have a problem that need your help. The library is great but it i found that the first and the second of str[] is not fixed. My first and second of str[] is 0x70 and 0xB1 (this is the correct code), but sometime it shows 0x93 and 0x20, and then repeat with 0x70 and 0xB1 then repeat 0x93 and 0x20. I saw that your video have met the same error with me. Did you fix that or can you help me fix the bug. Btw, thanks for your tutorial and wish you all the best.
Thanks for trying my setups and codes and making it work.
As for the first two values 0x93 and 0x20, they are showing up even if no cards are present.
Of course, it is a bug. I am also looking for the fix
I think we can get away with this for simple projects, avoiding (147) 0x93 and (32) 0x20
Hello,I face the problem (status only display 2/sNum display 147 32 0 0) ,may I know u how to fix this problem?
I use stm32f103vet6 and follow the video coding, but I use mini-rc522,is code not suitable for mini-one?
The project is stuck here,hope for help
I am using the Nucleo F103RB board. I'm having the same problem as you, can you tell me how to fix it?
@@user-seojihye71i didn’t fix this problem as well,even i change the code and use normal rc522😢
I think problem is come from board type is not compatible
@@hpw5897 I see. Thank you for the information🥲
this is the clock config of my stm32mp157f-k2 what do nu think should i change to make it work ? void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_CSI|RCC_OSCILLATORTYPE_LSI
|RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.CSIState = RCC_CSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
RCC_OscInitStruct.PLL2.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL2.PLLSource = RCC_PLL12SOURCE_HSE;
RCC_OscInitStruct.PLL2.PLLM = 1;
RCC_OscInitStruct.PLL2.PLLN = 50;
RCC_OscInitStruct.PLL2.PLLP = 2;
RCC_OscInitStruct.PLL2.PLLQ = 1;
RCC_OscInitStruct.PLL2.PLLR = 1;
RCC_OscInitStruct.PLL2.PLLFRACV = 0;
RCC_OscInitStruct.PLL2.PLLMODE = RCC_PLL_INTEGER;
RCC_OscInitStruct.PLL3.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL3.PLLSource = RCC_PLL3SOURCE_HSE;
RCC_OscInitStruct.PLL3.PLLM = 1;
RCC_OscInitStruct.PLL3.PLLN = 61;
RCC_OscInitStruct.PLL3.PLLP = 27;
RCC_OscInitStruct.PLL3.PLLQ = 17;
RCC_OscInitStruct.PLL3.PLLR = 37;
RCC_OscInitStruct.PLL3.PLLRGE = RCC_PLL3IFRANGE_1;
RCC_OscInitStruct.PLL3.PLLFRACV = 6660;
RCC_OscInitStruct.PLL3.PLLMODE = RCC_PLL_FRACTIONAL;
RCC_OscInitStruct.PLL4.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** RCC Clock Config
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_ACLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
|RCC_CLOCKTYPE_PCLK3|RCC_CLOCKTYPE_PCLK4
|RCC_CLOCKTYPE_PCLK5;
RCC_ClkInitStruct.AXISSInit.AXI_Clock = RCC_AXISSOURCE_PLL2;
RCC_ClkInitStruct.AXISSInit.AXI_Div = RCC_AXI_DIV1;
RCC_ClkInitStruct.MCUInit.MCU_Clock = RCC_MCUSSOURCE_PLL3;
RCC_ClkInitStruct.MCUInit.MCU_Div = RCC_MCU_DIV1;
RCC_ClkInitStruct.APB4_Div = RCC_APB4_DIV2;
RCC_ClkInitStruct.APB5_Div = RCC_APB5_DIV4;
RCC_ClkInitStruct.APB1_Div = RCC_APB1_DIV2;
RCC_ClkInitStruct.APB2_Div = RCC_APB2_DIV2;
RCC_ClkInitStruct.APB3_Div = RCC_APB3_DIV2;
If this code is generated by CubeIDE GUI, keep as it is. No need to change
But You need to change the SPI Prescalor in GUI and see the the baud rate.
When the baud rate in is around 9MBit, keep that corresponding Prescalor
@@NizarMohideenwhat are the factors that involves baud rate cause in my case in the mx either i get 6 or 13 as baud rates ( prescalor either 8 or 16) how can i put to 9 ?
Baud rate 6 will be ok
@@NizarMohideen can i email you my project maybe you´ll have an idea about the problem?