Fix the gpio handling and flash resource declaration, thanks to Daniel Gimpelevich