cancel
Showing results for 
Search instead for 
Did you mean: 

Junk value (?) comes on serial port

swamy_8065
Associate II

Hi,

we are using stm32wb55 board for wearable project. logs on serial port are fine when we flashed simple hello world program in loop. But when flashed the application menu developed by us we are seeing some junk value all the time. we are setting the baud rate to 115200. Please somebody help to resolve this issue.

Thanks
Rudraswamy

 

8 REPLIES 8
Danish1
Lead II

That sounds like a problem in the software you've written.

Without sight of that, not many of us will be able to help. After all, those here are just interested volunteers.

By "all the time", do you mean a continuous stream of characters coming out of the serial port one immediately after the the previous one (so at 115200 baud that's about 10000 characters per second)? If so, and you have set up an output buffer, maybe the buffer code doesn't cope with becoming empty.

Or is it slower than that, perhaps once round your loop of menuing? In which case maybe that's a debugging code that you haven't removed.

Or are these not well-formed characters. Maybe you're re-initialising the serial-port each time you go round your loop, rather than once at startup.

These are all guesses. You'd need to tell us more for us to be able to help

STTwo-32
ST Employee

Hello @swamy_8065

I suggest you start from a ready to use example as this one. And then do the modifications you need.

PS: Make sure to use the same configurations for your Serial monitor (all configuration are explained on the Readme file of the example).

Best Regards.

STTwo-32 

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Data you are outputting?

How is the buffering set up? Does data have scope over the duration of the transmission time? Managing string lengths and data sizes properly?

Situation is very poorly presented. 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes, It is slower than that, we are seeing that the menu list and the relevant text to be displayed is all junk value. I have attached a screenshot of the serial logs that we are seeing on the console for your reference. 

We are open to any suggestions, it is crucial for us that the issue gets resolved ASAP. 

Thanks Danish,

Rudraswamy

Screenshot from 2023-12-18 16-07-22.png

 

Hi STTwo-32,

Thanks for the suggestion, we have tried something similar. We had written a basic 'Hello World' application on STMCubeIDE with LPUART initialized in the IOC File to test the RX/TX line. Upon flashing this binary, we are seeing that 'Hello World' is successfully printing on the serial logs in the loop that we had configured it in, thus validating the HW to be working fine.

We are open to any suggestions, it is crucial for us that the issue gets resolved ASAP. 

Thanks STTwo-32,

Rudraswamy

Hi Tesla DeLorean,

Apologies for poor explanation, I had written this summary in a hurry without giving much detail. Here is the issue mentioned above written better for your understanding:

 

We are using STM32WB55VGY6TR as the MCU for a wearable based project of ours.
We had initially flashed our Test Application on STM32 Programmer Application to test the various peripherals attached to the MCU. The mode of communication is LPUART. After flashing the binary and running the test application on the serial console, we are seeing that the menu list and the relevant text to be displayed is all junk value. We were initially suspecting it to be a HW issue on the PCB, so to validate, we had written a basic 'Hello World' application on STMCubeIDE with LPUART initialized in the IOC File to test the TX line. Upon flashing this binary, we are seeing that 'Hello World' is successfully printing on the serial logs in the loop that we had configured it in, thus validating the HW to be working fine.

Screenshot from 2023-12-18 16-07-22.png

We are open to any suggestions, it is crucial for us that the issue gets resolved ASAP. 

Thanks Tesla DeLorean,

Rudraswamy

 

 

 

Danish1
Lead II

How does the text in that image compare with what you're expecting to see?

r023-12-18 15:43z09

looks like a string one might expect in a banner showing the software version.

There are many characters that seem to be non-printable. If some do get through and others not, it could be an error in the baud rate. How strongly do you know that the baud rate is accurate? Have you checked it with an oscilloscope?

Do things work better at a slower baud rate (I suggest 9600 baud)? If so, maybe your wires are too long, with too much stray capacitance for the driver chip you are using.

 

>>it is crucial for us that the issue gets resolved ASAP

Show the code related to this output. You are focusing on the SYMPTOMS, not the CAUSE.

We have no visibility into what you are doing.

If sending via DMA or IRQ watch the buffer life span as the output doesn't occur immediately. A buffer within a function as local/auto variables will lose scope as soon as the function itself exits.

Watch perhaps parity settings, bit width, and inter-symbol gap.

Put a logic-analyzer on the signal and perhaps inspect more closely

Check HSE_VALUE vs clocking source, perhaps exported via PA8 (MCO) pin

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..