I use this TTL USB converter which has a switch for prog and uart.
I have two different boards. One is ESP01 and another is ESP01S.
I just select Generic ESP8266 Module as board in my Arduino IDE. It works for ESP01S board but not for ESP01 board.
When I use ESP01S --> It works and code uploads but when I use ESP01 i get this error "Fatal error" Timed out waiting for packet data. Am I missing something?
When you say 'use' do you mean you have two different boards, an ESP01 and an ESP01S? Or do you mean you change the selected board from esp01 to esp01s?
Select the correct board, Esp01s often has more flash than esp01. Also take care of the necessary pullups.
Differences between ESP-01 and ESP-01S
The ESP-01S differs from the ESP-01 in that it includes 12K pullups on the RST , GPI0, and CH_PD pins which allows the module to stably enter boot mode at power up without the addition of external resistors.
Other changes include 1Mb of flash, the removal of the power and Tx LED and in its place there is a user controllable LED fitted to the GPIO2 pin.
Sorry I dont quite understand what changes do i need to do? I just plug that USB thing to the laptop and in IDE, i just click upload (which compiles the code and upload to ESP01S). So what changes I need to do for ESP01 to work with same setup?
I suggest you reread post 4 and add the pullups to the ESP-01. If that doesn't fix the problem at least you will have eliminated one possible problem.
I have looked through my collection and any ESP-01 modules I had are apparently in dedicated projects. All I have left are ESP-01S modules. When I started I used a breadboard and USB to serial adapter for programming and included the pullups. By the time I invested in a programmer that looks like yours all I used were ESP-01S versions.
If you have a breadboard and a USB - Serial adapter you can try that. If you don't have a USB-Serial adapter you can use the converter on an UNO with some difficulty. If you have a clone UNO make sure it has the series resistor the following site assumes is there.