Home > On-Demand Archives > Workshops >
Advanced Serial Communications in an RTOS Environment
Peifang Zhou - Watch Now - EOC 2025 - Duration: 01:09:20

This workshop marks the conclusion of our trilogy on the serial interface, building upon the insights shared in the last two Embedded Online Conferences. In this session, we will explore an advanced Direct Memory Access (DMA) technique that transforms the traditional character-based serial interface into a variable-length, packet-oriented one, similar to Ethernet. This powerful approach opens up new possibilities for reducing the complexity of software required for command handling and file transfers.
We will start by examining the theoretical foundations of this DMA technique, discussing its implementation for managing data packets of varying lengths. Following this, we will demonstrate practical applications through live coding on an STM32 Nucleo board. You will witness firsthand how this transformation simplifies the development of software for command handling and file transfer. By the end of the workshop, you will have a clear understanding of how to apply these concepts to your own projects to enhance the robustness and efficiency of your embedded systems.
Join us for this comprehensive session, where theory meets practice, and elevate your understanding of serial interfaces to the next level.
Glad to hear that you're planning to enhance your design based on insights from the workshop! As demonstrated during the session, using DMA with idle line detection is a robust approach for handling variable-length packets. This is particularly important since text-based commands can vary in length, and in binary file transfers, the final packet often differs in size from the others. Best of luck with your implementation!
Were there going to be materials from the talk made available? Great talk! Thank you so much!!
The workshop files are now available and can be found in left column under 'Files Provided by the Speaker'
Thank you so much for your kind words—I'm really glad you enjoyed the talk! I've shared the workshop materials with Stephane/Jacob, and they’ll be uploading them to the website soon. Thanks again for attending!
11:09:26 From Otzen to Everyone: I for one is glad you have a little technical issues, as I was not able to join from the beginning ;-) 11:11:11 From Mark to Everyone: Yes, it’s great! 11:11:12 From garyb to Everyone: How to get to the discord? 11:11:13 From Tom to Everyone: the discord is great 11:11:36 From Otzen to Everyone: It took some time till I realised that the discord invite should be found in the emails from Stefane. 11:11:51 From Mark to Everyone: The daily newsletter is especially will formatted for being able to add sessions to my calendar. 11:11:54 From Viktor to Everyone: Discord is cool, but difficult to find time to check it - conference schedule is very rich! ) 11:11:57 From Tom to Everyone: i think you could forgoe the session comments on the website in favor of discord discussions. 11:12:08 From David Evennou to Everyone: The EOC organization and timing of the presentations is excellent! 11:12:17 From Otzen to Everyone: Replying to "It took some time till I realised that the discord...": was looking and looking on the website, 11:12:20 From garyb to Everyone: OK, now I know where it is - was looking on the EOC page/account. 11:12:20 From Stephane to Everyone: Link to the discord: https://discord.gg/jvA9NeBV 11:13:32 From RF to Everyone: CAD is so beneficial to many but with so many acronyms being re-used, what does CAD stand for? 'Computer Aided Design' or 'Control Alternate Delete'? 11:13:31 From Javier Leon to Everyone: The discord server is going to be kept alive after the conferences finish? 11:13:43 From ts to Everyone: The EOC is great, I like the effort all presenters put into their sessions. I watch a lot of sessions, as this helps to keep up with technology and best practises, so shared knowledge is very valuable. The Discord channel is also helpful, although I prefer the comment section. 11:14:14 From AndyH to Everyone: It's always a great conference! I have learned a great deal over the years. 11:14:56 From Mark to Everyone: IS it zoomed way in for everyone? 11:15:08 From Tom to Everyone: looks good for me 11:15:14 From AndyH to Everyone: It's ok for me 11:15:39 From AndyH to Everyone: I'm in fullscreen 11:15:42 From Mark to Everyone: Thanks. it’s my end. 11:16:32 From Mark to Everyone: Replying to "Thanks. it’s my end.": Fit to Window 11:17:11 From Mark to Everyone: Replying to "Thanks. it’s my end.": 👍 11:29:10 From garyb to Everyone: Seems that the test board has a HW core for serial RX/TX so it doesn't interrupt main uC processes? 11:30:27 From RF to Everyone: Will it be able to handle the 'AT command Set' (Hayes)? 11:30:33 From Otzen to Everyone: Replying to "Seems that the test board has a HW core for serial...": That is what DMA would do. 11:31:56 From garyb to Everyone: Replying to "Seems that the test board has a HW core for serial...": I need to review resource on DMA and HW support. 11:33:44 From garyb to Everyone: Replying to "Seems that the test board has a HW core for serial...": Only issue is if there is any protocol related processing needed on byte-by-byte results. But that is implementation dependent. 11:33:45 From Mark to Everyone: Replying to "Seems that the test board has a HW core for serial...": The uC gets an interrupt on DMA complete 11:34:17 From Mark to Everyone: Replying to "Seems that the test board has a HW core for serial...": @garyb Yes, at a higher level 11:35:25 From Tom to Everyone: Replying to "Seems that the test board has a HW core for serial...": @garyb, the basic idea is the UART peripheral is configured with a memory buffer that it reads directly to / from. After each chunk of data that does in / out, the UART peripheral advances to the next address in the buffer. Then it is up to your application code to respond to interrupts to process the received data or set up new data to transfer. 11:35:29 From garyb to Everyone: Replying to "Seems that the test board has a HW core for serial...": I've worked on power supplies for data severs and the I2C messaging had some "challenging" timing characteristics. 11:40:51 From garyb to Everyone: Replying to "Seems that the test board has a HW core for serial...": @Tom Thanks - some uC have better DMA support - and I may have been able to construct better design to handle it. 11:44:08 From Mark to Everyone: Replying to "Seems that the test board has a HW core for serial...": I2C is (for me, anyway) a lot more challenging for handling this level of comms processing than UART, at least on STM32. 11:47:56 From garyb to Everyone: Replying to "Seems that the test board has a HW core for serial...": @Mark my design had i2c and multiple UARTs all while maintaining a SMPS. The customer liked to test by stressing the I2C (400kHz) and fast dynamic load changes to see if we could keep regulation. 11:54:39 From Mark to Everyone: Replying to "Seems that the test board has a HW core for serial...": @garyb With all that going on. I can imagine how hard that was to handle all the edge cases. Bravo! 11:56:03 From garyb to Everyone: Replying to "Seems that the test board has a HW core for serial...": @Mark thank you. I did have a really good small team to help! 11:56:56 From Mark to Everyone: Replying to "Seems that the test board has a HW core for serial...": I2C is a lot of fun. Simple at it’s basic level, yet it feels like playing a game. 11:57:12 From Otzen to Everyone: Was that a standard serial terninal? Where was the history, and line edit handlet? 11:57:42 From garyb to Everyone: STM Cube is nice but, as the presenter said, it is a challenge to find what and where too look for the feature you want. 11:59:04 From Mark to Everyone: Replying to "Was that a standard serial terninal? Where was the...": I think it was. He probably has a bunch of single purpose scripts to handle each command. If, so, a nice side benefit is: Makes it so easy to create command line scripts to interactively exercise the system (e.g. from a bash shell). Command history comes for free. 11:59:59 From garyb to Everyone: Thanks for presentation - have to leave early. 12:00:20 From Mark to Everyone: Replying to "STM Cube is nice but, as the presenter said, it is...": I agree. The .ioc file based configurator is powerful,but it can feel a bit quirky. 12:02:09 From Mark to Everyone: Replying to "Thanks for presentation - have to leave early.": Glad this presentation will be saved. It’ll be a great reference. 12:07:50 From Otzen to Everyone: C function pointers, become much nicer if you use typrdef 12:11:11 From RF to Everyone: Replying to "C function pointers, become much nicer if you use ...": 'typedef' even better ;<) 12:12:44 From Mark to Everyone: Replying to "Was that a standard serial terninal? Where was the...": My mistake, he’s using a gitbash session. Same capability, but even better than the terminal inside the IDE. COMmand history is supported by (git)bash, of course. 12:13:19 From Otzen to Everyone: So if caught that right, you extended the x-modem protocol, with the ability to send filesize? 12:15:41 From Jacob Beningo to Everyone: Replying to "The discord server is going to be kept alive after...": Yes 12:16:03 From Otzen to Everyone: @Jacob Beningo Will you curate the questions that came here during the demo? 12:16:15 From Otzen to Everyone: Was refering to your reset pointer 12:17:09 From Mark to Everyone: Replying to "@Jacob Beningo Will you curate the questions that ...": These chat windows can be saved to a text file with two clicks (nice Zoom feature). Very handy for future reference. Click "… “ and hit "Save Chat”. 12:17:52 From Jacob Beningo to Everyone: Replying to "@Jacob Beningo Will you curate the questions that ...": I can if needed 12:18:03 From Jacob Beningo to Everyone: Replying to "@Jacob Beningo Will you curate the questions that ...": I was just looking through to see if there are any past questions to have answered 12:18:26 From Eric Habets to Everyone: If have used an array of 256 function pointers for a simulation of an old 8 Bit CPU, works very nice. 12:20:03 From Otzen to Everyone: Replying to "Was that a standard serial terninal? Where was the...": I didn't know the termite program, looks very intresting :-) 12:20:21 From Tom to Everyone: I'm not a Windows user but I hear the new Windows terminal is fantastic. 12:22:02 From Eric Habets to Everyone: Will the Chat be included in the recording? 12:22:26 From Eric Habets to Everyone: Ok, thanks! 12:22:43 From Mark to Everyone: I just sent the chat file (text). 12:22:58 From Mark to Everyone: meeting_saved_new_chat.txt
Sir Peifang, thank you for presentation and persevering the technical issues on the live stream. The packet and DMA based transfer is useful for may applications especially if the packets are uniform in size - but there are some challenges if packets are variable length. I've implemented I2C based PMBus for a power supply communications, similar to UART but using variable length packets. I can see how I'd be able to modify this idea to add DMA support.