ESP8266-01 Flash Mode, Need Help

Hello fellows…

I’m new to Arduino and now working on my iot project. I have problem on flashing nodemcu firmware into esp8266-01 wifi module. I use to flash but before flashing i tried to get my device id, so i use this command from command line (i use MacOS).

$sudo --port /dev/cu.usbmodem1421 flash_id

This command returns v2.1
A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header.

My configuration as follows:

Mac to Arduino using USB cable. I use arduino uno as usb serial ttl (empty sketch).

ESP8266 - Arduino

GND <-> GND (black)
VCC <-> 3.3v (red)
GPIO0 <-> GND (purple)
GPIO2 <-> 3.3v (orange)
CH_PD <-> 3.3v (pink)
TX <-> TX (via logic level shifter) (yellow)
RX <-> RX (green)

The esp module works normally in normal mode (Esp GIPO0 ->3.3v), i can run AT commands and connect to access point. But if change the GPIO0 to GND in flash mode, i get no response in serial terminal and also the returns reponse time out.

Is anything wrong with my configuration? sorry i’m new to this, need your help. thank you.

Btw i've managed to flash the firmware. I added "--before no_reset" into command line

sudo --port /dev/cu.usbmodem1421 --before no_reset flash_id

And before flashing, disconnect and the connect the power source. it works.