- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello I am trying to execute the following code:
int main()
{
/* Initialize ADC. Conversion is not enabled yet. */
//void ADC_Start();
CyGlobalIntEnable;
ADC_Start();
ADC_IRQ_Enable();
ADC_StartConvert();
/* Start ADC conversion. */
for(;;)
{
while(row_count<2u)
{
CySysFlashWriteRow(row_count,Buffer);
}
for(k=1u;k<2u;k++)
{
*readptr = CY_FLASH_BASE + (k*CY_FLASH_SIZEOF_ROW);
for(byte_count=0u;byte_count< CY_FLASH_SIZEOF_ROW;byte_count++)
{
read_data[byte_count] = (*(uint8 *)(readptr + byte_count));
//byte_count++;
}
// k++;
}
}
}
However, after writing and entering the for(k=1u;k<2u;k++) loop it enters into this while loop which I found from debugging:
#ifdef CY_BOOT_INT_DEFAULT_HANDLER_EXCEPTION_ENTRY_CALLBACK
CyBoot_IntDefaultHandler_Exception_EntryCallback();
#endif /* CY_BOOT_INT_DEFAULT_HANDLER_EXCEPTION_ENTRY_CALLBACK */
while(1)
{
}
Any ideas as to what the problem might be?
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the debugger to see if the flash contains correct value. Check the return value of CySysFlashWriteRow() for success (zero)
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I have got some ideas. But your code snippet is incomplete, so can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
EDIT: I just see that you overwrite flash in row 1 and 2 where your program resides.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
read_data[byte_count] = (readptr + byte_count);
This line is flagged with a warning, but I would consider clearing that.
As a result: Use the upper flash rows. When no bootloader is used and the program not too big they are free.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi I am using the upper flash rows indeed. And I cleared the flag as following but am still experiencing this problem:
read_data[byte_count] = (*((uint8*)(readptr + byte_count)));
Thanks,
Rikin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the debugger to see if the flash contains correct value. Check the return value of CySysFlashWriteRow() for success (zero)
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it is writing correctly. However, I was able to fix the problem by making a new project and copying the code over.
Thanks,
Rikin