Skip to content

How can I view a defined value at build time #1864

Closed Answered by fpistm
alextrical asked this question in Q&A
Discussion options

You must be logged in to vote

Well in stm32_eeprom.c add:
#include "utils.h"

Then after FLASH_END definition:
#pragma message("The value of FLASH_END: " XSTR(FLASH_END))

Anyway you will not have exact value as it can depends on ll function, example:

EEPROM\src\utility\stm32_eeprom.c:75:9: note: '#pragma message: The value of FLASH_END: ((uint32_t)(0x08000000UL + (((((uint32_t)(((LL_GetFlashSize() * 1024) / 0x00000800U) - 1)) +1) * 0x00000800U))-1))'
   75 | #pragma message("The value of FLASH_END: " XSTR(FLASH_END))
      |         ^~~~~~~

If you want exact vaule then simply add a method to get it in the c file and export it then display it with Serial at sketch level.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@alextrical
Comment options

Comment options

You must be logged in to vote
3 replies
@alextrical
Comment options

@bxparks
Comment options

@alextrical
Comment options

Answer selected by alextrical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants