Do I need to set up the FLEWT bit in the FLSCL register before writing or erasing flash from firmware?
The FLEWT bit needs to be set to '1' before any flash write/erase procedure to ensure that the flash timing is extended during those operations. Firmware can either set this bit to '1' at the beginning of code execution and leave it set to '1', or it can be set to '1' at the beginning of the flash write/erase procedure and then reset to '0' at the end of that procedure. There is no adverse effect of leaving it set to '1' throughout the entire execution of the application.
The relevant C8051F5xx datasheets include a note in the Flash memory section to state that this bit needs to be set to '1' before any flash write/erase operation. Some older example code might not include this setting, so any example code should be reviewed for this before being used in an application.