2023-08-20 11:07 PM
Hi,
My MCU us stm32f401rct6.
This MCU has three UART and all UART are using for service. No console UART port :(
So, I make a USB CDC device to use console port.
But, iwdg is not working. When I use UART console port, while(1); occur watchdog reset. But, when I use USB CDC for console, while(1); not occur watchdog reset.
Thank you in advanced.
BR
Paul
Solved! Go to Solution.
2023-08-21 08:55 PM
I solve this problem by removing pull-up resister on D+.
Some blog say D+ in stm32f4 has pull-up resister in it.
2023-08-20 11:10 PM - edited 2023-08-21 02:11 AM
CDC function is working well except watchdog
2023-08-21 06:22 AM
IWDG is independent of everything. It uses its own clock. Unlikely it's not working due to whatever else you're doing on the chip. Perhaps it didn't get initialized or is being refreshed somewhere else. Recheck your assumptions.
2023-08-21 06:47 PM - edited 2023-08-21 07:55 PM
Hi,
I did as follow.
2023-08-21 08:42 PM - edited 2023-08-21 08:48 PM
Hi,
I found a reason.
When software restart, USB device is not working properly. I don't know exactly.
In first CDC_Transmit_FS(), watchdog timer is expired.
Because, I call while (CDC_Transmit_FS((uint8_t*)&c, 1) != USBD_OK); to ensure tx opeation thru USB is completly before next tx.
At this line, watchdog is working. It looks not working my board.
Temporary, I modify this line and test like this.
And go next step.
When USB cable is disconnect on the go or USB cable is not connected at reboot time, CDC_Transmit_FS((uint8_t*)&c, 1) return FAIL.
How can I detect USB cable is not connected or disconnected.
What is the reason USB can not detect at software restart?
CDC_Transmit_FS((uint8_t*)&c, 1) is not working after software reset.
USB cable remove and connect again, CDC_Transmit_FS((uint8_t*)&c, 1) is wiorking.
I hardware pull-up 1.5K on D+, do I need to add tr on pull-up resister to re-recognize?
BR
Paul
2023-08-21 08:55 PM
I solve this problem by removing pull-up resister on D+.
Some blog say D+ in stm32f4 has pull-up resister in it.
2023-08-22 06:50 AM
You can also use the reference manual for such information rather than relying on random blogs.