Why is there a "BOARD_FLASH_SIZE" check in new project?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why is there a "BOARD_FLASH_SIZE" check in new project?

695 Views
myke_predko
Senior Contributor III

My prototype PCBs have finally come in and I've got a question about the software build as I bring up the boards - I am getting the warning:

#warning "BOARD_FLASH_SIZE not set, using 0 as default value" [-Wcpp]

When I do a search on "BOARD_FLASH_SIZE" in all of my projects, the only time it comes up is in the recently created MK2xFN1M0Zxxx12 projects (see below).  I was expecting that there was a value that was generated by the system, but it doesn't seem to be there, it is also strange that it is not there in any of the FRDM-K22F projects I've been working on (with the same version of MCUXPresso) nor is it in any of the previous projects.  I looked at the board.c and board.h files from an old project and the "BOARD_FLASH_SIZE" statements listed above which generated the warning are NOT present in them.  

My target is an MK22FN1M0AVMD12 and I am using SDK 2.3.1 (the latest for it), FreeRTOS 9.0.0 (standard with SDK 2.3.1) and MCUXpresso 11.3.1.  

I had created some software for the TWR-K21 and the MK22VN1M0AVLL12 using the same versions of the SDK and FreeRTOS. No build errors or warnings- unfortunately, I don't have the MCUXpresso version number when I did the builds.  

For the past six to eight months, I've been developing/testing software on the FRDM-K22F (SDK 2.7.0 & FreeRTOS 10) because it was easier to prototype hardware on the Freedom baord.  No build errors or warnings at the time.  

It seems like when MCUXpresso's new project wizard is creating the project, it's inserting the following statements into "board.c":

#if BOARD_FLASH_SIZE == 0
#warning "BOARD_FLASH_SIZE not set; using 0 as default value"
#endif

These statements are not located in the earlier MK22FN10Axxx12 projects nor in the FRDM-K22F.  I tried creating a new project from the source and files of an older project which didn't have the warning previously and the warning was generated in it's board.c file when I created the project. 

In one of the older projects, I did an "Update Code" in the pin wizard (updating the .mex file as well as the associated board files) but the statements above weren't added to board.c

I could take out the statements or set a value for them manually but I don't want to do anything until I understand the issue.  

"-Wcpp" is not listed as a GCC option - but I don't think it's a factor as it is not a GCC compiler option.  I'm only mentioning it for completeness.  

If I look at Properties->C/C++ Build->MCU Settings, I see 1MB of Flash defined as "PROGRAM_FLASH".  I also did a search for this in all of my projects and it wasn't something the projects are checking for.  

 

This seems like a problem with MCUXpresso's build wizard or am I not setting some build parameter correctly?  

Comments?

NOTE: I am posting this simultaneously in the Kinetis and MCUXpresso forums

0 Kudos
1 Reply

678 Views
FelipeGarcia
NXP Employee
NXP Employee

This is a duplicated thread, please refer to  Re: Why is there a "BOARD_FLASH_SIZE" check in new... - NXP Community  

0 Kudos