Manage multiple uarts in STM32 || Head and Tail || circular buffer || serial devices

  Рет қаралды 20,759

ControllersTech

ControllersTech

Күн бұрын

Пікірлер: 69
@unomasenelmar
@unomasenelmar 4 жыл бұрын
Gracias por subir este material!, yo uso el STM32F401CE y realmente estoy muy conforme, estoy usando MBED. Gracias.
@bugaje100
@bugaje100 Жыл бұрын
It worked. Thank you sir, but i had to download the AT firmware on the esp32.
@mecatronicamx582
@mecatronicamx582 3 жыл бұрын
Excusme because define twice rx_buffer1,tx_buffer1, etc?
@zlad1
@zlad1 2 жыл бұрын
well hello i have some issue at multi uart while using the hal its fine,but while using the ringbuffer isr it crash the receive well be fine but the transmission cant send while using multi uart ,testing in single fine
@haunchung346
@haunchung346 2 жыл бұрын
Hello! Thank you for the tutorial and code. I have been trying to implement this, but when I send an AT command via RealTerm it only increments in the _tx_buffer1 and _rx_buffer2 in the debugger. The _rx_buffer1 and _tx_buffer2 remain empty and I don't get any response on RealTerm from the wifi module. Do you know, what I could do to fix this?
@eddyv524
@eddyv524 4 жыл бұрын
Thanks for posting! Very useful video! What would you 'get after' if you are transmitting google protocol buffers over a serial link between a stm32 processor and a esp32?
@naveent9163
@naveent9163 2 жыл бұрын
Hi Eddy how did you integrate Google Protocol Buffers on STM32 Project , Please Help me in this Process i can't integrate Google Protocol Buffers on STM32 project iam getting many dependency and compiler errors Thanks in Advance
@eduardodelarosaferrer2205
@eduardodelarosaferrer2205 4 жыл бұрын
I miss you !!
@dighuyntran1351
@dighuyntran1351 2 жыл бұрын
Thanks for the tutorial but for some instances, the uart doesn't receive fully string that ESP respones, like i should get:"AT+CIPMUX=0 Ok " but i just get "AT+CIPMUX" instead. Because of that, the function always stucks at Wait_for("Ok ").
@ControllersTech
@ControllersTech 2 жыл бұрын
can't help that. This is a very fragile code and things like that can happen.
@nodirbekchoriev1763
@nodirbekchoriev1763 3 жыл бұрын
Thank you )))
@andrey7530
@andrey7530 4 жыл бұрын
good luck! and ths
@eddyv524
@eddyv524 4 жыл бұрын
Thanks for posting your videos! I ported the code to a stm32H750 processor and expanded it to 3 interfaces. i had to change some register names that access the flags etc but for the most part it works great except for one issue that i can not get rid of. 2 of the uarts are usarts and 1 is a uart. when i receive data on the uart , the data ends up in the buffer but then the interrupt for that uart (uart4) keeps firing and the program never gets to the main loop anymore. Do you know if setting and resetting interrupt flags is different for uart and usart blocks?
@eddyv524
@eddyv524 4 жыл бұрын
Never mind i found the issue :)
@enderkulucka
@enderkulucka 4 жыл бұрын
I use stm32l496G discovery. I am not user usart1 because this board (stm32 discovery board) hasn't usart1 pin. therefore I am used LPUART1 for communication with esp8266. I have a problem. my problem is in Uart_isr function. error: USART_typedef has no member named 'DR'; did you mean 'RDR'? HELP ME.
@ControllersTech
@ControllersTech 4 жыл бұрын
Check the description. There is a solution for that
@chandreshsuthar1247
@chandreshsuthar1247 3 жыл бұрын
hello sir , thanks for the amazing ring_buffer uart tutorial , it works fine for me with only one uart , when i try this with my stm32f103c8t6 it gets blocked and doesn't answer , i need to erase the flash to reprogram it , can you please guide me what's wrong with it ?? Thanking You in Advance !!!
@onurolce
@onurolce 4 жыл бұрын
13:40 So if a function blocks UART then is it better to use USART in interrupt mode always?
@ControllersTech
@ControllersTech 4 жыл бұрын
Buddy, this is uart ring buffer. It is always working in interrupt mode. In blocking mode the data is still being received in the Rx bufger anyway. If u use the if loop, you can even do rest of the functions normally. It's just, you won't be able to do anything with the data received in the uart, until the string is matched and characters are copied..
@onurolce
@onurolce 4 жыл бұрын
@@ControllersTech So I need to look previous video for your own header file and functions.
@onurolce
@onurolce 4 жыл бұрын
I've looked UartRingbuffer files now and it looks a bit heavy code for me :(
@ControllersTech
@ControllersTech 4 жыл бұрын
Although it might look heavy but it's very simple to use. Give it a try. It's your best shot for unknown data length
@onurolce
@onurolce 4 жыл бұрын
@@ControllersTech You are right. I'll try to make it via watching your video for my MCU.
@onurolce
@onurolce 4 жыл бұрын
Is not there a build BIN or HEX file directly and upload it into BluePill STM32F103C8T6 device via ST-Link V2 Mini programmer ?
@ControllersTech
@ControllersTech 4 жыл бұрын
There is a hex file generated after you build the project. Look for it inside the project folder. You can upload it via st link utility or maybe some other software too. But it's better to use the st link directly. This way u will have the option to debug also.
@onurolce
@onurolce 4 жыл бұрын
@@ControllersTech OK, when I tried to Debug then CubeIDE said me "you ave to update your ST-Link V2 mini device firmware" and then I clicked to Upgrade button and it's done. But now Cube IDE and Cube Programmer says " error 4. No device found". Sometimes it uploads if I press on Reset Buttton on my BluePill (STM32F103C8T6) board and it uploads but sometimes even this way does not work. Maybe upgraded version has a bug ? If it is so how can I fix it ?
@ControllersTech
@ControllersTech 4 жыл бұрын
Frankly, i also have a lot of problems with my bluepill connection. That's why I am making more videos with nucleo board now a days. It's like half the time get wasted on just connecting that thing. I'll try to look into some other way of connecting it using serial connection or something. But till then i can only say that keep trying... Connect disconnect and hope it works..
@onurolce
@onurolce 4 жыл бұрын
@@ControllersTech Yeah, since yesterday I am working to fix it and learn to program in STM32 Cube. it was working well in Arduino IDE but it has another problem that it doesnot Work 2nd UART Channel in Arduino IDE. That's why I am trying to switch to more better programming environment like Cube IDE. Do you have any idea how to make work to UART2 in Arduino IDE ?
@ControllersTech
@ControllersTech 4 жыл бұрын
I can recommend you something but telegram me.. i need more information about the way you are using things. Telegram me @controllerstech
@ersahgucel1945
@ersahgucel1945 3 жыл бұрын
can we use this library with 3 or more usart port?
@ControllersTech
@ControllersTech 3 жыл бұрын
Yes you can.. but define it just like i did for the 2 uarts
@ersahgucel1945
@ersahgucel1945 3 жыл бұрын
@@ControllersTech Thanks for the answer, have you a tutorial for MQTT with freeRTOS and GSM. I can not find a freeRTOS MQTT tutorial.
@ControllersTech
@ControllersTech 3 жыл бұрын
Nope. I don't have anything for mqtt..
@ersahgucel1945
@ersahgucel1945 3 жыл бұрын
@@ControllersTech So can your ring buffer library be used on freertos?
@orlandocarvalho409
@orlandocarvalho409 2 жыл бұрын
Hi, i'm trying to implement the projet, however when i do the sending buffer by usart ("AT" ASCI), (Usart 2 -> Usart 1) it only receive the carcter "A" . Don't know what's happening here. Don't know what's the change to do, any help ? I check the code, and i don't have the "READ_REG(huart->Instance->ISR)" and the "unsigned char c = huart->Instance->RDR;",, we only have the SR and the DR registers!! I'm using the STm32F103RBTX MCU
@ControllersTech
@ControllersTech 2 жыл бұрын
Read the description
@orlandocarvalho409
@orlandocarvalho409 2 жыл бұрын
@@ControllersTech The program does it ok, following this tutorial. But when the code reaches the point of :: Uart_sendstring("AT ", wifi_uart while(!(Wait_for("AT OK ", wifi_uart))); The system breaks.. This line of code it's in the ESP8266_Hal.c file
@orlandocarvalho409
@orlandocarvalho409 2 жыл бұрын
Forget it!! We just did the connection !! However don't know what was the problem ... Thanks for the help and the fast response.
@ahmadroshanfar8904
@ahmadroshanfar8904 4 жыл бұрын
Hi, I'm using ESP-01 and stm32f4 discovery. When I reset my wifi module with a button, I receive the Wifi connected and Wifi got IP message in my terminal, but when sending AT command, the module doesn't any reaction to it and rx_buffer1 and tx_buffer2 haven't the value.
@ControllersTech
@ControllersTech 4 жыл бұрын
Maybe you are not sending the command in the right way. Which serial console you are using ?
@ahmadroshanfar8904
@ahmadroshanfar8904 4 жыл бұрын
@@ControllersTech I'm using Arduino terminal and Gtkterm in ubuntu and Realterm in Windows. In realterm some garbage data is available in terminal. for example "u" instead of "OK" to answer of "AT". CR and LF is checked and baudrate is 115200
@ControllersTech
@ControllersTech 4 жыл бұрын
Some esp8266 don't have a default baudrate 115200, you should try with other BR like 38400, or something. You should test firat by simply connecting esp to the computer usinf some ftdi
@ahmadroshanfar8904
@ahmadroshanfar8904 4 жыл бұрын
@@ControllersTech I test it before and do some projects with Arduino. 115200 is correct!
@ControllersTech
@ControllersTech 4 жыл бұрын
Check if Both the uarts are set up at 115200
@naasikhendricks1501
@naasikhendricks1501 4 жыл бұрын
So it worked???
@ControllersTech
@ControllersTech 4 жыл бұрын
What? Can u elaborate..
@naasikhendricks1501
@naasikhendricks1501 4 жыл бұрын
@@ControllersTech I asked if this would work for multiple instances
@ControllersTech
@ControllersTech 4 жыл бұрын
Yes it does. That's what shown in the video buddy. U can use it to interface some serial based device. Just like you use hardware serial and software serial in arduino..
@sarathkumar-tf4lr
@sarathkumar-tf4lr 4 жыл бұрын
in this code is not working ...when am send "AT" command to esp8266 from PC terminal it's return a "AT" response to the PC terminal what is the problem occurred here.... please give the solution about this.....
@ControllersTech
@ControllersTech 4 жыл бұрын
Use realterm for the serial monitor
@sarathkumar-tf4lr
@sarathkumar-tf4lr 4 жыл бұрын
@@ControllersTech ya....i use the realterm serial monitor but did not get the correct output....then what is the solution to get the correct output......
@sarathkumar-tf4lr
@sarathkumar-tf4lr 4 жыл бұрын
@@ControllersTech am using stm32l476rg nucleo controller
@ControllersTech
@ControllersTech 4 жыл бұрын
First try without the microcontroller. Simply use any TTL device like ftdi and check the ESP response
@sarathkumar-tf4lr
@sarathkumar-tf4lr 4 жыл бұрын
@@ControllersTech ya...i use ftdi but no response comes....pls give the right solution
Interface 74HC4051 multiplexer with STM32 || CubeIDE || HAL
9:25
ControllersTech
Рет қаралды 7 М.
UART Ring Buffer using Head and Tail in STM32 || STM32 CubeIDE
14:25
ControllersTech
Рет қаралды 34 М.
Worst flight ever
00:55
Adam W
Рет қаралды 31 МЛН
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 2,1 МЛН
Writing a Rust-based ring buffer
40:01
timClicks
Рет қаралды 6 М.
WATCHDOGS in STM32 || IWDG and WWDG || CubeIDE
16:56
ControllersTech
Рет қаралды 30 М.
Getting Started with Meshtastic - Devices
15:01
The Comms Channel
Рет қаралды 212 М.
6 Horribly Common PCB Design Mistakes
10:40
Predictable Designs
Рет қаралды 203 М.
How to create delay in nano/micro seconds using timers in stm32
7:41
ControllersTech
Рет қаралды 47 М.
The RS-232 protocol
26:10
Ben Eater
Рет қаралды 843 М.
eapbg #29 Ring Buffer
20:55
eapbg
Рет қаралды 20 М.
Worst flight ever
00:55
Adam W
Рет қаралды 31 МЛН