Hi,
For your first questions. Debug session type specifies the options to initiate a debug session using pre-configured debug configurations.
• Download - Resets the target if the debug configuration specifies the action.
Further, the command stops the target, (optionally) runs an initialization script,downloads the specified ELF file, and modifies the program counter(PC).
• Attach - Assumes that code is already running on the board and therefore does not run a target initialization file. The state of the running program is undisturbed.
The debugger loads symbolic debugging information for the current build target's executable. The result is that you have the same source-level debugging facilities you have in a normal debug session (the ability to view source code and variables, and so on). The function does not reset the target, even if the launch configuration specifies this action. Further, the command loads symbolics, does not stop the target, run an initialization script, download an ELF file, or modify the program counter (PC).
NOTE: The debugger does not support restarting debugging sessions that you start by attaching the debugger to a process.
• Connect - Runs the target initialization file specified in the RSE configuration to set up the board before connecting to it. The Connect debug session type does not load any symbolic debugging information for the current build target's executable thereby, denying access to source-level debugging and variable display. The Connect command resets the target if the launch configuration specifies this action. Further, the command stops the target, (optionally) runs an initialization script, does not load symbolics, download an ELF file, or modify the program counter(PC).
NOTE: The default debugger configuration causes the debugger to cache symbolics between sessions. However, selecting the Connect option invalidates this cache. If you must preserve the contents of the symbolics cache, and you plan to use the Connect option, clear the Cache Symbolics Between Sessions checkbox in the Symbolics tab page.
Simply speaking, Download used to download code to target and debug/run. Attach is used to debug target which have code running already in the target. And Connect is usually for debugging hardware configuration issue.
For your second questions, based on above and your use case, it's Download.
BR