Quadflash Not found in 15.3 Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
RitchRock
XCore Addict
Posts: 219
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

I seem to have it working again. I added in a second "factory_image" instead of just checking "image". I wonder why It worked previously?

So this section now looks like:

Code: Select all

fl_BootImageInfo image;
                fl_BootImageInfo factory_image;

                int flashstatus = fl_getFactoryImage(image);

                factory_image = image;

                if (flashstatus != 0)
                {
                    debug_printf("No factory image exists in flash\n");
                    DFU_STATUS = no_factory_image; // No factory image
                    return 0;
                }
                else
                {
                    flashstatus = fl_getNextBootImage(image);

                    if (flashstatus != 0)
                    {
                        // No upgrade image exists in flash
                        debug_printf("No upgrade image exists in flash\n");
                        debug_printf("Check Point A\n");
                    }

                    int result;

                    do
                    {
                        if (flashstatus != 0)
                        {
                            result = fl_startImageAdd(factory_image, FLASH_MAX_UPGRADE_IMAGE_SIZE, 0);
                            debug_printf("Check Point B. result  = %d\n", result);
                        }
                        else
                        {
                            result = fl_startImageReplace(image, FLASH_MAX_UPGRADE_IMAGE_SIZE);
                            debug_printf("Check Point C. result  = %d\n", result);
                        }
                    } while (result > 0);
View Solution