New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM8L152R8: add experimental support for USART2 and USART3 #358
Comments
#358 experiment with STM8L Medium+ and High Density devices
Hi Thomas, |
Thanks @4yerba! I have a bare STM8L052R8 chip and a LQFP64 breakout board in the basement - one of those with a bad solder resist mask that makes it hard to avoid shorts. Also the Vss, Vdd are all over the place. Not the ideal chip for a quick test. Maybe I'll try soldering it anyway. Edit: Halfway through with soldering - I still need to get all the Vss and Vdd right. |
So, while there's code that may work for the STM8L052R8 in the repo (but only when using USART3) the code most certainly broke access to USART2 and ... the USART1 console of STM8L Medium Density devices like STM8L151K4. |
Bug fixed and tested with @Eelkhoorn 's board. This doesn't mean that USART2 and USART3 console options work ... that still remains to be tested and this ticket stays open. |
I finally finished soldering (0.5mm pitch LQFP64 wasn't that bad - soldering tiny wires for Vss, Vdd was worse and the cheap Chinese double-row headers were the wurst. This is for tomorrow:
|
Sorry, I couldn't get to my board last weekend so no progress on my side. |
That's great, thanks! I just gave my breakout board a try - there is a short between Vdd and Vss somewhere.... |
@4yerba I added an STM8L152R8 folder - now it's |
I've removed the shorts and now I get a console on USART1. |
@4yerba: I've got USART2 and USART3 working! I'll make configuration options for USART1 and USART3 GPIO assignment and the push the code. |
There will be a new option for controlling alternative port assignments of USART1: If the default USART is used:
If USART3 is used (
If USART2 is used ( |
Next step: take |
@4yerba it works now but your offer was a great motivation! Running a quick test would, of course, still be appreciated - but you can start with the assumption that it "should work" :-) I'm thinking of making this feature a bit more generic so that it can be used by other devices, like STM8L051F3. One option is turning some of the configuration into an assembler macro (no one wants to read |
No, no. It is me who should be grateful, Thomas. The quick test turned out to be quite an experience. First, it took me close to half an hour to get to the board as it was buried deep under some other stuff. Then UART1 and UART3 didn't seem to work receiving some garbage data.Then I looked into the code and the board schematic and closely inspected the board itself. Nothing! Only then I realized the only culprit could be the cable which I made myself years ago and ...bingo ! As it turned out it was a bad joint on the cable connector. Took me two hours to prove to myself every little detail counts. In the end I'm happy it works. |
That's good to hear! It's always easier if there is something that's known to be in good working condition - I should know that since the STM8L101 had played tricks on me for a very long time ;-) The STM8L152R8 (or STM8L058R8) is a rather interesting chip since it's versatile and relatively cheap (from $0.60 @ 20 or $0.90 @ 10). I have long wanted to play with LCDs and this seems to be the right µC to do that. |
Nice find. |
I never ordered from any of these distributors - if I'd do hardware design for a living or if I'd work in a shop where several colleagues do that their shipping and handling fees would hardly be an issue. About the LCD controller: I'm not certain that only the "L152" devices have that. Surprisingly, STM8L151 devices have Vlcd bonded out. I'm also suspicious about the amount of memory in STM8L Medium+ Density devices and the CAN controller in STM8S207/208 devices. |
It's a hobby for me too. |
I absolutely agree, a developer in a commercial setting seldom has the opportunity to max something out. Sometimes teams get pretty far (especially when a product reaches maturity at the end of a product life cycle). Often such highly optimized resist refactoring, simply because the people who created them are no longer there or because the set of problems that a solutions was designed to solve is not longer known (!). With the next product generation asset becomes legacy, and if not legacy then sedimented knowledge. Semantic without tokens, solutions without a rationale, or even a department with a budget. |
I'm sorry to say that, but experimental support means that someone else will have to experiment since I don't have a board with an STM8L Medium+ or High Density device like the NUCLEO-8L152R8 (yet).
See notes in the STM8L151K4 board folder.
The text was updated successfully, but these errors were encountered: