2022-10-08 11:19 AM
I have a 3x4 matrix keyboard attached to STM32F401, see schematics (the U4 represents a "black pill" PCB). PB0, PB1, PB2 are column outputs in push-pull mode. PC15, PA0, PA1, PB10 are row inputs in EXTI mode with pull-ups enabled.
The circuit worked as expected during development in lab. When installed in car, it also worked OK until I connected the keyboard. With keyboard connected, the MCU doesn't start at power up and I need to press the reset button to let the FW start. It then works as expected, without missed keypress detections and without false key detections.
The keyboard is connected by seven 1.4m long 0.25mm thick transformer wires twisted altogether.
Adding a 10k pull-up to NRST and to BOOT1 pins didn't help. BOOT0 pin already has a 10k pull-down.
How to diagnose and fix this?
2022-10-08 12:30 PM
OK, this is a board where normally the manufacturer, in this case WeAct Studio, can give you information and support. But I can try to isolate the problem:
When was this board manufactured?
WeAct states on its website: [If the chip on the board is] STM32F401CCU6 - We have stopped production in 2020.6, if the online shopping platform merchant's promotional materials are still marked STM32F401CCU6, then this merchant sells piracy, please do not buy!
On the website you can also find more information on how to recognise such counterfeits.
So if the board is younger, you can assume it is a clone or counterfeit, where the function of the STM32 is not guaranteed.
Regards
/Peter
2022-10-08 05:22 PM
> Adding a 10k pull-up to NRST
You have to remove the pull-up from the board, which was put there by dumb copy-paste "engineers", not add another one!
2022-10-09 03:05 AM
@Piranha: no pull-up on NRST installed on my board originally.
I narrowed the problem to the PB0 & PB1 outputs. Only those two prevent the MCU from starting when they are connected to the keyboard. A workaround was to leave them at default reset state in Device Configuration Tool in STM32CubeIDE and only configure them as outputs later on in my initialization code.