Hi how I can move or copy data from a 16bit buffer to an 8 bit buffer?
@banjohat5 ай бұрын
@@Radplus usually you would split into 2 bytes and put each one in the buffer separately
@Radplus5 ай бұрын
@@banjohat 👍👍👍
@Radplus5 ай бұрын
@@banjohat one another question : Why uart sends data reversed For example If I want to send 1139(ascii) = 0473(hex) When uart sends data i have 7304(hex) in my computer
@banjohat5 ай бұрын
@@Radplus it is because of endianness and how the stm32 stores values in memory
@Radplus5 ай бұрын
@@banjohat is it possible to reverse this data before sending to finally get a non reversed value in computer?
@AmitSharma-bm2qj2 жыл бұрын
What changes i need to run this on stm32f407
@banjohat2 жыл бұрын
Nothing much, really. Import the files and adjust the UART reference :)
@AmitSharma-bm2qj2 жыл бұрын
@@banjohat there is an error show in uart_isr_txe
@eddyv5245 жыл бұрын
I added the UartRingbuf.cpp and .h files to the project. Refreshed the project. They showed up in the file list. Even code completion is aware of the files. However,during linking, no matter what i do, i always get 5 error similar to "undefined reference to `Ringbuf_init.... Any idea what's wrong?
@hanspeterhaastrup-nielsen84465 жыл бұрын
It's not enough that the project knows the file. You have to explicitly include the header files in the files that uses the ringbuffer calls
@TurboBobBailey5 жыл бұрын
did you put the extern "C" stuff in the header file? calls from cpp files won't find the functions without it.
@TurboBobBailey5 жыл бұрын
I put it in the UartRingbuffer.h file, similar to how the it.h file has it. it belongs there more than in main.h
@TurboBobBailey5 жыл бұрын
have you tried receiving data with this code? in loopback mode it seems ok, but when I try to receive fast data it gets stuck in the ISR.
@banjohat5 жыл бұрын
that's strange. For me it works just fine. Where in the ISR does it get stuck?
@TurboBobBailey5 жыл бұрын
@@banjohat Debugging is tough in my setup, as halting and stepping does not halt the OS tick, so it always goes to the interrupt handler and I can't step the code. There is surely a setting to fix this but I have not found it. In any case, I played with my own ring buffer for the CAN which worked ok, but the final solution was to use a FreeRTOS queue for the data. The queue handles all the interrupt and task issues, but be sure to set the interrupt priorities correctly for the RTOS.
@patrickanderson17633 жыл бұрын
@@TurboBobBailey hello friend, i'm a brazilian student and i have a project using ST's MCU together with ESP8266, my problem is exactly this, when receiving data quickly by UART, the data ends up getting lost, you would have the code you used to solve this? I've been looking for a solution for days.
@TurboBobBailey3 жыл бұрын
@@patrickanderson1763 my application is working now. I have a periodic message that I receive. I call the checking function every 5 ms, and when the number of total bytes received is the same for 2 samples, I copy out my working buffer and reset the uart. The uart is using the interrupt driven rx methods.
@seyoungbaik81414 жыл бұрын
Thanks for your lecture. However, I m faced with the problem. and Anybody help me plz? error: 'USART_ISR_TXE' undeclared (first use in this function); Im using cortex M7 series and was trying to apply it to my project. I think this is becuase the difference of cortex-m series ...or not...
@hanspeterhaastrup-nielsen84464 жыл бұрын
Sounds like you're missing an include somwhere in the top of the file generating the error
@naasikhendricks15015 жыл бұрын
Hi I have tried to implement your edited version on the G0 because I want to port it to I2C
@naasikhendricks15015 жыл бұрын
Void isr_void in .C file fails
@peterloster14843 жыл бұрын
thanks for the help; I had a similar solution but less straight forward; NOTE: if you write your changes next to the place where you added them, in the area between the comments /* USER CODE BEGIN ... */ /* USER CODE END ...*/ ---> the code will not disappear if you change something in your CubeMX configuration after a new set was generated.