Page 1 of 1

Check for NULL ptr in HAL_PAL

Posted: Tue May 22, 2018 8:56 pm
by faisal
The PAL driver dereferences a pointer to a peripheral address (i.e. GPIOA->ODR). The 'port' pointer should be checked for a NULL pointer using chDbgCheck() (so that it can be disabled for release builds).

Re: Check for NULL ptr in HAL_PAL

Posted: Sun May 27, 2018 11:40 am
by Giovanni
Hi,

Where exactly?

Giovanni

Re: Check for NULL ptr in HAL_PAL

Posted: Sun May 27, 2018 11:55 am
by faisal
The dereferencing is done mainly in the hal_pal_lld.h macro. I'm thinking we could do a null ptr check at the hal_pal layer before calling the LLD driver routines/macros.

Re: Check for NULL ptr in HAL_PAL

Posted: Sun Jan 06, 2019 4:59 pm
by Giovanni
bump

A point, the "port" parameter is not necessarily a pointer, it is dependent on architecture, this should be performed in the various LLDs.

Giovanni