You definitely don’t want to comment out the
FLASH_isUserModuleInfoValid check! If you comment it out, you let the firmware continue with a factory reset and copy from one place in flash to another whatever arbitrary garbage is stored regardless of whether it is a well-formed firmware module. No wonder your LED is acting strange!
The linker defines lots of info about each module that gets prepended and appended to the firmware binary, including module metadata, third-party product version, and a full file CRC check. If you don’t see that data at the beginning and end, you do not have a valid firmware module.
So psyched to hear you’re working on a new board! That Broadcom chip opens up some exciting possibilities! Here are Particle we are neck deep in the Electron right now, across hardware, firmware, cloud, carrier API integrations, cellular data management in the dashboard, protocol optimizations in the device service, and mobile setup process. We don’t have bandwidth to help you port to a new chip, but I and the rest of the community here will of course help out when we know the answers to your questions. You’re diving pretty deep there moving the modules around!