- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't figure out how to fix the following compiler warning:
assignment discards 'const' qualifier from pointer target type
I have set up an area in Flash to store firmware for another PSoC (I will be bootloading it):
const uint8 FW831[FW_SIZE] __ALIGNED(CY_FLASH_SIZEOF_ROW) = {0u};
My understanding is that I have to use "const" or the compiler won't put it into Flash. I also understand that it has to be set to a value as well - which in my case makes for a very large hex or cyacd file since FW_SIZE is 56320.
Later, I define a pointer to the flash area (its type is to match the functions that it is passed to):
unsigned char *Firmware;
Then the following line generates the warning:
Firmware = &FW[0];
The Firmware pointer is then passed to CyBtldr_ParseHeader and CyBtldr_ParseRowData
Ideas?
Solved! Go to Solution.
- Labels:
-
PSoC 5 Device Programming
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
c - "assignment discards 'const' qualifier" error on non-const pointer - Stack Overflow
Second time, what is the warning that you get