[En-Nut-Discussion] Re STM32F7xx Fixes

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Tue Apr 19 11:43:34 CEST 2016

>>>>> "Holger" == Holger Mai <mai at gemac.info> writes:

    Holger> OK i see that. In fact i let me irritate, that another tool from
    Holger> standard periphal drivers, RCC_GetClocksFreq(), brings out wrong
    Holger> values since clock management is reworked. This tool uses the
    Holger> real divider settings in the RCC configuration rergisters, and
    Holger> has an invalid prescaler table for this case. So this tool has
    Holger> to be updated instead stm32_clk.c.

What is wrong with NutClockGet()?
With mixing two libraries, you get the errors of both libraries.

    Holger>  But, on the other side, it
    Holger> looks for me, that the background of the HPRE organisation is,
    Holger> to switch between full and reduced AHB clock without loose the
    Holger> divider of reduced clock.  I dont can say, if other familys are
    Holger> affected by this effect. Therefore i think it can be better, to
    Holger> continue the HPRE setting in the "old" way: set HPRE to 0000 if
    Holger> no divider is used. That will be good for down compatibility
    Holger> with existing applications.

We could start searching the list with index 0 and so waste some cycles. But
is that really worth the effort? Some bootloader or part of the user program
may have set xPRE to a none-zero value for no division. So the library
must cope with any allowed value.

    Holger> The construct to define DSABLE/ENABLE only if not defined doesnt
    Holger> work. The preprocessor doesnt know DISABLE/ENABLE, because they
    Holger> are content of an enum (and so only visible for the
    Holger> compiler). So he defines they, and than the compiler finds this
    Holger> as error (because he has DISBALE as content of an enum):
    Holger> ...stm/stm32xxxx.h:487:18: error: expected identifier before
    Holger> numeric constant # define DISABLE 0 ^

I consider prepending NUT to the ENABLE/DISABLE keywords in the habit of
having NUT specific keyword. What other keywords collide with the ST
libraries?  That way all these keywords can be fixed in one changeset.

    Holger> An other way may be, to detect if the type of the enum,
    Holger> FunctionalState, is always defined. But that is not possible
    Holger> with C tools. If anyone knows a backdoor or a trick to do this
    Holger> nevertheless?

    Holger> How tom send patches? I have no repository access, and i dont
    Holger> want that.

Please consider. You can look at the history that way.

    Holger> And atttachments to discussion mails are forbidden.

Really? If it does not work, send in private mail.


Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------

More information about the En-Nut-Discussion mailing list