[PATCH 3/5] bsps/stm32h7: allow config and usage of QSPI memory on stm32h757i-eval BSP

Karel Gardas karel at functional.vision
Fri Jun 17 14:42:11 UTC 2022


On 6/15/22 17:00, Gedare Bloom wrote:
> On Fri, Jun 10, 2022 at 6:49 AM Karel Gardas <karel at functional.vision> wrote:
>>
>> The QSPI memory is initialized and used only when the BSP configure file
>> sets QSPI memory size to non-zero value. Currently QSPI is run in memory
>> mapped mode which allows future RTEMS binary linkage and upload into QSPI
>> memory.
>>
>> Sponsored-By:   Precidata
>> ---
>>   .../stm/stm32h757i-eval/stm32h7-bspstarthooks.c | 17 +++++++++++++++++
>>   bsps/arm/stm32h7/include/bsp.h                  |  1 +
>>   .../bsps/arm/stm32h7/bspstm32h757i-eval.yml     |  5 ++++-
>>   spec/build/bsps/arm/stm32h7/optmemquadspisz.yml |  1 +
>>   4 files changed, 23 insertions(+), 1 deletion(-)
>>
>> diff --git a/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/stm32h7-bspstarthooks.c b/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/stm32h7-bspstarthooks.c
>> index 8d34e357ee..9916b740ce 100644
>> --- a/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/stm32h7-bspstarthooks.c
>> +++ b/bsps/arm/stm32h7/boards/stm/stm32h757i-eval/stm32h7-bspstarthooks.c
>> @@ -36,6 +36,22 @@
>>
>>   #include <string.h>
>>
>> +#if defined(STM32H7_MEMORY_QUADSPI_SIZE) && STM32H7_MEMORY_QUADSPI_SIZE > 0
>> +#include <stm32h747i_eval_qspi.h>
>> +BSP_QSPI_Init_t QSPinit;
> 
> Do you need this variable to be in the global namespace? Can it be a
> static variable here?

I've just resent patch version just for 757i-eval to make review simpler 
where I've switch to static variable here. It has its own pros/cons:

+ not populating global namespace
+ not require explicit initialization
- require to be used after BSS is initialized

So it's really a question what is prefefrred way here.

Thanks,
Karel


More information about the devel mailing list