STM32 Resets the com port problem

Post here first, or if you can't find a relevant section!
Post Reply
samtal
Posts: 12
Joined: Sun Feb 16, 2020 4:15 pm

STM32 Resets the com port problem

Post by samtal »

While trying to port and run my old Maple program using Arduino IDE and STM32_Smart board, I noticed one significant difference between the Arduino Atmel (AVR) and the STM32 board: While on Arduino the reset command resets the program only, the STM32_Smart resets also the COM port.
This becomes an issue because the program resets and starts running long before the port resets, and in addition the port resets to close position.
Any serial port action in the Setup will be ignored, and the port has to be reopened manually.
Using a While to wait for the port is of no use: The port is closed, and the program can not open it.
I am not sure if this is due to the nature of the STM32 or the bootloader program or the specific board. I do not recall if I had the same problem with the Maple (STM32)
I find two crucial problems with this phenomenon:
1. I have some startup messages and commands to be sent to the host in the Setup in the case of a reset - they are not uploaded.
2. My program sends unattended continuous real-time data to a host. As the port resets to the close position, no data is being sent out after reset.
Does anyone know of a way to inhibit the com port from being reset?
Thx
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: STM32 Resets the com port problem

Post by fredbox »

Are you using Serial USB? If so, the USB port will disappear every time your smart board is reset. To work around this, you would need to attach a USB serial to TTL adapter on one of the USARTs and redirect your serial output. This will let your serial port will remain open during a reset.

Another issue with the Smart board is that the I2C pins have no pullup resistors. The onboard eeprom is invisible to an I2C scan until the pullups are added.
Post Reply

Return to “General discussion”