[En-Nut-Discussion] A few patches
Krzysztof Sawicki
krzysztof.sawicki at mlabs.pl
Tue Dec 13 16:48:27 CET 2016
On 13.12.2016 11:25, Uwe Bonnes wrote:
>>>>>> "Krzysztof" == Krzysztof Sawicki <krzysztof.sawicki at mlabs.pl> writes:
>
> Krzysztof> On 12.12.2016 09:48, Krzysztof Sawicki wrote:
> >> On 12.12.2016 09:11, Krzysztof Sawicki wrote:
> >>> ADD: STM32F412Rx
>
> Krzysztof> and yet another patch for STM32F412Rx
>
> None of the vendor F4 headers defines PINRSTF. Grepping
> nut/include/arch/cm3/stm/vendor> grep PINRSTF *f4*
> gives no result. A patch should fix all devices. Maybe this can be done in
> nut/include/arch/cm3/stm32xxxx after the include of the vendor file. Will
> you have closer look or should I?
>
> ST should also fix the headers. If you are a good ST customer and so you
> have an FAE, report to your FAE. If you only buy small number through
> catalogue distributors (like me), the only chance to report is via the "ST
> communities". If you have a FAE, that way is preferred. Otherwise will you
> report or should I?
Ok, I'll report through our ST sales representative. Anyway PINRSTF (RCC_CSR_PINRSTF) is used in arch/cm3/dev/stm/stm32_reset.c:
int Stm32ResetCause(void)
{
uint32_t csr;
int flags;
csr = RCC->CSR;
flags = 0;
if (csr & RCC_CSR_IWDGRSTF) {
flags |= NUT_RSTTYP_WATCHDOG;
} else if (csr & RCC_CSR_WWDGRSTF) {
flags |= NUT_RSTTYP_WWATCHDOG;
} else if (csr & RCC_CSR_FWRSTF) {
flags |= NUT_RSTTYP_FIREWALL;
} else if (csr & RCC_CSR_SFTRSTF) {
flags |= NUT_RSTTYP_SOFTWARE;
} else if (csr & RCC_CSR_LPWRRSTF) {
flags |= NUT_RSTTYP_LOWPOWER;
} else if (csr & RCC_CSR_OBLRSTF) {
flags |= NUT_RSTTYP_OPTIONLOADER;
} else if (csr & RCC_CSR_V18PWRSTF) {
flags |= NUT_RSTTYP_COREPOWER;
} else if (csr & RCC_CSR_BORRSTF) {
flags |= NUT_RSTTYP_BROWNOUT;
} else if (csr & RCC_CSR_PORRSTF) {
flags |= NUT_RSTTYP_POWERUP;
} else if (csr & RCC_CSR_PINRSTF) {
flags |= NUT_RSTTYP_EXTERNAL;
}
RCC->CSR |= RCC_CSR_RMVF;
return (flags) ? flags : NUT_RSTTYP_UNKNOWN;
}
--
Krzysztof Sawicki
MLabs sp. z o.o.
ul. Kaliska 21
61-131 Poznań
tel. 61 646 84 27
KRS: 0000390306
NIP: 7822533401
More information about the En-Nut-Discussion
mailing list