[En-Nut-Discussion] Doubts about dcb_deinit()

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Jan 6 17:28:18 CET 2015


Hello,

it seems that no NutOs function uses dcd_deinit(). Strange!

My problem:
Put the Usart pins in a safe state if the USB CDC device connected to the
uart is unpowered (by USB).

This happens with a STM32 Nucleo board where I added a battery backup. When
the USB CDC is USB powered, everything is fine. If USB power fails and the
circuit is battery powered, UART TX is high and tries to power the USB CDC
device via the Pin protected diodes(1). This triples the current consumption.

Possible solution 1: Add a UART IOCTL to change the UART pin mode from
driving to floating or pull-down. However this doesn't care for flusshing
etc...

Possible solution 2: Release the Pins with dcd_deinit().
However this propably needs implemenation of NutUnregisterDevice(), as
pin setup is only done in dev_init() and dev_init() only called in
NutRegisterDevice() and at present NutRegisterDevice() can only be called
once.

Any ideas?

(1): If Nucleo would have used a 3.3 Volt tolerant pin the problem would be
nonexistant. Argh...
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------


More information about the En-Nut-Discussion mailing list