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?

1,087 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
10 Replies

1,044 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Myke,

I was able to replicate the issue you are facing with MK22FN10Axxx12 new project wizard, as you mentioned BOARD_FLASH_SIZE is not used anywhere so I assume this is a bug with project generation.

I tried also to replicate the bug in FRDM-K22F and same as you this warning is not there in new projects for the evaluation board.

I am going to report this with our internal team to fix it in future releases. Thank you for reporting this problem!

Best regards,

Felipe

1,025 Views
bobpaddock
Senior Contributor III

It is not specific to the 22. 

I had it happen with the K32L and/or KL27.

 

 

1,011 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi,

Could you please specify specific SDK where you have seen this issues as well? I will add them to the report.

Best regards,

Felipe

0 Kudos

1,004 Views
bobpaddock
Senior Contributor III

SDK 2.9.0 Manifest 3.8.0.
MCUXPresso 11.3.1_5262.

 

 

0 Kudos

1,001 Views
myke_predko
Senior Contributor III

I'm using the same version of MCUXpresso as @bobpaddock 

MCUXpresso IDE v11.3.1 [Build 5262] [2021-04-02]

The SDK is SDK_2.x_MK22FN1M0Ax version 2.3.1 and Manifest 3.20

0 Kudos

939 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi @myke_predko,

Just to inform that I have already sent your feedback to the appropiate team. Internal team confirmed that this issue should not affect customer application. However, it will be reported to MCUXpresso development team to fix it for future releases.

Thank you very much for your report.

Best regards,

Felipe

0 Kudos

935 Views
myke_predko
Senior Contributor III

Hi @FelipeGarcia 

Thank you for following up.  

Please keep us informed as to when the issue is fixed (hopefully in the next release of MCUXpresso).

myke

0 Kudos

976 Views
FelipeGarcia
NXP Employee
NXP Employee

Thank you for letting me know. I have contacted internal team, any update I will let you know.

Best regards,

Felipe

0 Kudos

1,067 Views
bobpaddock
Senior Contributor III

I ran into the same problem a while ago.  I just deleted BOARD_FLASH_SIZE and moved on.

I've found that MCUXpresso is not well tested if you deviate the slightest from what the creators expected.
Warnings like that or pulling in the same debugging module twice and they have different versions etc.

-Wcpp is the C Pre Processor warning control.

It is coming up because an undefined constant was used in a #if.

It is wise to turn on -Wall and -Wextra as well.

 

 

1,063 Views
myke_predko
Senior Contributor III

Hey @bobpaddock 

Thanx for the reply.  

I was pretty sure the "BOARD_FLASH_SIZE" shouldn't have been there, but I would like a reply from NXP on that.  

-Wall is always enabled and -Wextra I use as a periodic check - the problem with -Wextra is that it picks up a lot of warnings in NXP generated code (you said something that MCUXpresso not being that well tested?).   

0 Kudos