Not very much specific information, but you can try the following approaches.
1. Is it the same firmware, i.e. not one a debug and the other a release build ? If it is not the same, check for differences.
2. Check the startup code. I know at least one toolchain that has implemented an infinite wait loop in the reset handler, to catch the debugger. Such debug versions don't run standalone.
3. There might be real issues, probably related to timing. Often, this is clock setup or Flash init (speed and waitstates). You can add instrumentation code (GPIO toggle, UART, ...) to see were it gets stuck without a debugger, and gradually narrow down the responsible code line(s).