이 코드의 문제점은 tx 중에 rx 인터럽트가 걸리면 rx가 busy 상태에서 빠져 나오지 못하는 치명적인 문제점을 발견했습니다. 해결방법은 tx 전에 interrupt를 disable 하는 것인데, 간헐적으로 동일한 문제가 발생하는것을 발견했습니다. 이러한 방식을 사용하시면 안됩니다.
Hi, great video!!! some devices (like GPS) sends data in short burst with big delay between them (20msec of data every second) and we need to parse the data as soon as it get available. All this examples will work ok and we doesn't loose data. But if we are not synchronized with the burst we will be parsing data from the previous second. Can you cover this special case?
Thank u. But can you add function for hex data for rx and tx ring buffer as well. It might help some body who is working on project hex command either string handling. Thank u again and looking to see that.
Hello ControllersTech; My question is this project works with ESP32-S3 instead of ESP8266 ? Other question why this one set rendom values in those buffers in the main function: extern uint8_t MainBuf[128]; getDataFromBuffer("*", "#", MainBuf, buffer);
If i start the code while there is already communication present on the RX-line, the program refuses to receive anything. However if i start the program while the RX-line is in idle mode it always works. Any ideas on what is the cause und how to fix it?
I have a question. My arm chip use 2 uart1 and 2. Get data by uart 1 with high speeed 9600. After it will send data by uart2 with speed 300. Can you help me solution for over buffer. Thanks! My chip str912faw
Thank sir, but i got some troubles when follow this tutorial: 1. I run the debug and "stuck" at this line "while ((!isOK)&&(TIMEOUT));" ( and any loop within your function, i tried remove TIMEOUT, only using isOK ) , even though the TIMEOUT hit the negative number, and keep decreasing, or isOK become 1, it always stuck at while loop within isConfirmed of waitFor function. The strange thing is when it was stuck, I can receiver data from incoming uart buffer normally, even isOK variable change arrcodingly. I'm using STM32F103C8T6 with KeilC v5. 2. I am have some misunderstanding about ringbuffer, at the first time when the RxBuffer received data, and push the data into MainBuffer, you will get a big MainBuffer with exactly the data which the sender sent, then you do something with that data, why didnt you flush the Mainbuffer afterthat, and it will clear and ready for the next data. 3. Is goto statement good? I heard that it is not recommended in C Great video and Thank you so much!
1. I don't know whats wrong with that. All i can say is don't halt the cpu while the data is being received or you will losse the data. 2. The buffers are being used as ring buffers. We already keep track of which data is being read. So flushing will do nothing special. It's just the waste of cpu cycles. 3. Using goto is not good. But if used properly, it's not a bad move..
@@ControllersTech 1. I add HAL_Delay(1) into "while ((!isOK)&&(TIMEOUT));" and it worked. Dont know why @@ 2. Ah, i read about the ringbuffer and got the idea. Your MainBuf is circular so every your function or method are written with handling this circular too. As my very childlike thinking, i thought if the data isn't too big, i will receiver everything and push into a buffer, then do work with it. Then, i will flush everything and wait for the data again Thank sir!!!
Oh i thought 234 bytes.. You can use small buffer like 512 B for Rx and 1KB for main buffer. See the data is going to be 234KB but it's not going to come at once. It will cone in chunks.. so i think 512 bytes should be okay
Great video and it really helps! I am wondering why you have always used Normal DMA mode instead of Circular. In your previous video and this one you sort of already made a ring buffer to handle long data. Why not just use the built-in version of ring DMA?
I guess you probably want that IDLE line interrupt to fire which won't with circular mode enabled? Is that correct guess? Otherwise, you would have to build a parser on it.
thank you, it's so nice but i got an issue and i couldn't solve this. I use the h743zı2 so i complete all CORTEX M7 RELATED videos but receive data is not correct. for example always sending letters like 'ü ÿ þ' . I cant send a string from hercules but ı can send data from teraterm byte by byte. do you know how ı can solve these problems?
@@ControllersTech Well you can set it up to work for 25MHz if you go with the PLL clock. That's what most people do nowadays, using a lower crystal and scaling it. However I suppose that's not what he meant.
important function
5:33 IsConfirmed ( int32_t Timeout)
이 코드의 문제점은 tx 중에 rx 인터럽트가 걸리면 rx가 busy 상태에서 빠져 나오지 못하는 치명적인 문제점을 발견했습니다. 해결방법은 tx 전에 interrupt를 disable 하는 것인데, 간헐적으로 동일한 문제가 발생하는것을 발견했습니다. 이러한 방식을 사용하시면 안됩니다.
Hi, great video!!! some devices (like GPS) sends data in short burst with big delay between them (20msec of data every second) and we need to parse the data as soon as it get available. All this examples will work ok and we doesn't loose data. But if we are not synchronized with the burst we will be parsing data from the previous second. Can you cover this special case?
Thank u. But can you add function for hex data for rx and tx ring buffer as well. It might help some body who is working on project hex command either string handling. Thank u again and looking to see that.
Hello ControllersTech;
My question is this project works with ESP32-S3 instead of ESP8266 ?
Other question why this one set rendom values in those buffers in the main function:
extern uint8_t MainBuf[128];
getDataFromBuffer("*", "#", MainBuf, buffer);
If i start the code while there is already communication present on the RX-line, the program refuses to receive anything.
However if i start the program while the RX-line is in idle mode it always works.
Any ideas on what is the cause und how to fix it?
I have a question. My arm chip use 2 uart1 and 2. Get data by uart 1 with high speeed 9600. After it will send data by uart2 with speed 300. Can you help me solution for over buffer. Thanks! My chip str912faw
Hello can you make a new video for managing multiple Uart? In my opinion these codes are better than previous one.
Thank sir, but i got some troubles when follow this tutorial:
1. I run the debug and "stuck" at this line "while ((!isOK)&&(TIMEOUT));" ( and any loop within your function, i tried remove TIMEOUT, only using isOK ) , even though the TIMEOUT hit the negative number, and keep decreasing, or isOK become 1, it always stuck at while loop within isConfirmed of waitFor function. The strange thing is when it was stuck, I can receiver data from incoming uart buffer normally, even isOK variable change arrcodingly. I'm using STM32F103C8T6 with KeilC v5.
2. I am have some misunderstanding about ringbuffer, at the first time when the RxBuffer received data, and push the data into MainBuffer, you will get a big MainBuffer with exactly the data which the sender sent, then you do something with that data, why didnt you flush the Mainbuffer afterthat, and it will clear and ready for the next data.
3. Is goto statement good? I heard that it is not recommended in C
Great video and Thank you so much!
1. I don't know whats wrong with that. All i can say is don't halt the cpu while the data is being received or you will losse the data.
2. The buffers are being used as ring buffers. We already keep track of which data is being read. So flushing will do nothing special. It's just the waste of cpu cycles.
3. Using goto is not good. But if used properly, it's not a bad move..
@@ControllersTech
1. I add HAL_Delay(1) into "while ((!isOK)&&(TIMEOUT));" and it worked. Dont know why @@
2. Ah, i read about the ringbuffer and got the idea. Your MainBuf is circular so every your function or method are written with handling this circular too.
As my very childlike thinking, i thought if the data isn't too big, i will receiver everything and push into a buffer, then do work with it.
Then, i will flush everything and wait for the data again
Thank sir!!!
@@vinhphamquang8209 can you please tell how did you resolve the problem of while ((!isOK)&&(TIMEOUT))
Hi
Is this able to apply with the ESP32 dev board? Anything needs to modify?
The video says STM32 not ESP32
@Controllers Tech , I wanted to receive 234KB (KilloBytes) of data through SIM7600 module UART.
What shiuld be by RxBuffer Size?
Keep higher than 234..
@@ControllersTech But the RAM size is only 128KByte. What should i do?
Oh i thought 234 bytes..
You can use small buffer like 512 B for Rx and 1KB for main buffer.
See the data is going to be 234KB but it's not going to come at once. It will cone in chunks.. so i think 512 bytes should be okay
@@ControllersTech Thank you Sir, I will try this
You are using an USART, that different from an UART. Does the same apply for UARTs?
Yes
Thank you for this video
Great video and it really helps! I am wondering why you have always used Normal DMA mode instead of Circular. In your previous video and this one you sort of already made a ring buffer to handle long data. Why not just use the built-in version of ring DMA?
I guess you probably want that IDLE line interrupt to fire which won't with circular mode enabled? Is that correct guess? Otherwise, you would have to build a parser on it.
같은데이터가 반복적으로 버퍼에 쌓이기때문에 normal로 설정해야 합니다만, 이 코드의 문제점은 tx 중에 rx 인터럽트가 걸리면 rx가 busy 상태에서 빠져 나오지 못하는 치명적인 문제점을 발견했습니다.
thank you, it's so nice but i got an issue and i couldn't solve this. I use the h743zı2 so i complete all CORTEX M7 RELATED videos but receive data is not correct. for example always sending letters like 'ü ÿ þ' . I cant send a string from hercules but ı can send data from teraterm byte by byte. do you know how ı can solve these problems?
Check the baud rate in Hercules. Incorrect characters appears due to different baud rates between source and destination
I don't think so this didn't work for me. I solved when change the HSE value from 25Hz to 8Hz thanks anyway..
It's not something you solved. If your board have 8 MHz crystal and you setup with 25 MHz, how would you expect it to work ?
Yeah you are right it's not a solvable problem it's my fault sorry
@@ControllersTech Well you can set it up to work for 25MHz if you go with the PLL clock. That's what most people do nowadays, using a lower crystal and scaling it. However I suppose that's not what he meant.
Hello !! I love your videos, could you make a video about how to use LCD with I2C DMA?
There already is a video about lcd using i2c.
If you want to use dma, then instead of simply using I2C transmit, just use I2C transmit DMA
@@ControllersTech I wanted to receive 234KB (KilloBytes) of data through SIM7600 module UART.
What should be by RxBuffer Size?
great work!
Thank you sir! :D
Thanks!!!! Excellent!!!!
perfect video
Excelent!
Thx
thank you for the video